INTEGRITYSETUP(8) | Maintenance Commands | INTEGRITYSETUP(8) |
NAME¶
integritysetup - utility for configuring and managing dm-integrity devices
SYNOPSIS¶
integritysetup <action> [<options>] <action args>
DESCRIPTION¶
Integritysetup is a utility for configuring and managing kernel dm-integrity devices.
Kernel device-mapper dm-integrity target emulates an additional data integrity tag per disk sector and provides transparent data integrity protection of block devices.
You can configure these additional integrity tags directly with integritysetup, or indirectly (for authenticated encryption) through LUKS2 and cryptsetup(8). Unlike dm-verity, dm-integrity devices support both read and write operations. The kernel performs data integrity checking transparently using a selected checksum or cryptographic hash algorithm.
Integrity devices can be activated during boot through integritytab(5), which is part of systemd(1).
BASIC ACTIONS¶
Integritysetup supports these operations:
FORMAT¶
format <device>
Formats <device> (calculates space and dm-integrity superblock and wipes the device).
<options> can be [--data-device, --batch-mode, --no-wipe, --journal-size, --interleave-sectors, --tag-size, --integrity, --integrity-key-size, --integrity-key-file, --sector-size, --progress-frequency, --progress-json].
OPEN¶
open <device> <name>
create <name> <device> (OBSOLETE syntax)
Open a mapping with <name> backed by device <device>.
If the integrity algorithm of the device is non-default, then the algorithm should be specified with the --integrity option. This will not be detected from the device.
<options> can be [--data-device, --batch-mode, --journal-watermark, --journal-commit-time, --buffer-sectors, --integrity, --integrity-key-size, --integrity-key-file, --integrity-no-journal, --integrity-recalculate, --integrity-recalculate-reset,--integrity-recovery-mode, --allow-discards].
CLOSE¶
close <name>
remove <name> (OBSOLETE syntax)
Removes existing mapping <name>.
<options> can be [--deferred] or [--cancel-deferred].
STATUS¶
status <name>
Reports status for the active integrity mapping <name>.
DUMP¶
dump <device>
Report parameters from the on-disk stored superblock.
RESIZE¶
resize <name>
Resizes an active mapping <name>.
If --size (in 512-byte sectors) or --device-size is not specified, the size is computed from the underlying device. After resize, the recalculating flag is set. If --wipe flag is set and the size of the device is increased, the newly added section will be wiped.
Increasing the size of integrity volumes has been possible since the Linux kernel version 5.7; shrinking should work on older kernels, too.
<options> can be [--size, --device-size, --wipe].
OPTIONS¶
--allow-discards
--batch-mode, -q
--bitmap-flush-time ms
WARNING: In case of a crash, it is possible that the data and integrity tag don’t match if the journal is disabled.
--bitmap-sectors-per-bit sectors
--buffer-sectors sectors
The tag area is accessed using buffers; the large buffer size means the I/O size will be larger, but there could be less I/Os issued.
--cancel-deferred
--data-device <data_device>
To not wipe the data device after initial format, also specify --no-wipe option and activate with --integrity-recalculate to recalculate integrity tags automatically.
--debug
--deferred
--help, -?
--integrity, -I algorithm
For HMAC (hmac-sha256), you must specify an integrity key and its size.
--integrity-bitmap-mode, -B
--integrity-inline
No journal or bitmap is used in this mode. The device should operate with native speed (without any overhead).
This option is available since the Linux kernel version 6.11.
--integrity-key-file file
--integrity-key-size bytes
--integrity-no-journal, -D
--integrity-recalculate
The primary intended use case is to skip initialization (wiping) of the data device after the initial format (see --no-wipe option). This parameter can be used for activation, then the kernel will recalculate integrity tags in the background. The integrity superblock contains a device offset that indicates the boundary to which the integrity tags are already updated. You can check this offset with the dump command.
--integrity-recalculate-reset
--integrity-recovery-mode, -R
--interleave-sectors sectors
--journal-commit-time ms
--journal-crypt algorithm
The journal encryption options are only intended for testing. Using journal encryption does not make sense without encryption of the data.
--journal-crypt-key-file file
--journal-crypt-key-size bytes
--journal-integrity algorithm
--journal-integrity-key-file file
--journal-integrity-key-size bytes
--journal-size, -j butes
--journal-watermark percent
--no-wipe
--progress-frequency seconds
--progress-json
{
"device":"/dev/sda", // backing device or file
"device_bytes":"8192", // bytes wiped so far
"device_size":"44040192", // total bytes to wipe
"speed":"126877696", // calculated speed in bytes per second (based on progress so far)
"eta_ms":"2520012", // estimated time to finish wipe in milliseconds
"time_ms":"5561235" // total time spent wiping device in milliseconds }
Note on numbers in JSON output: Due to JSON parsers' limitations, all numbers are represented in a string format due to the need for full 64-bit unsigned integers.
--sector-size, -s bytes
--tag-size, -t bytes
The size can be smaller than the output size of the hash function; in that case, only part of the hash will be stored.
--usage
--verbose, -v
--version, -V
--wipe
LEGACY COMPATIBILITY OPTIONS¶
Do not use these options until you need compatibility with a specific old kernel.
--integrity-legacy-padding
--integrity-legacy-hmac
--integrity-legacy-recalculate
RETURN CODES¶
Integritysetup returns 0 on success and a non-zero value on error.
Error codes are: 1 wrong parameters, 2 no permission, 3 out of memory, 4 wrong device specified, 5 device already exists or device is busy.
NOTES¶
Format and activation of an integrity device always require superuser privilege because the superblock is calculated and handled in the dm-integrity kernel target.
EXAMPLES¶
Format the device with default standalone mode (CRC32C):
integritysetup format <device>
Open the device with default parameters:
integritysetup open <device> test
Format the device in standalone mode for use with HMAC(SHA256):
integritysetup format <device> --tag-size 32 --integrity hmac-sha256 --integrity-key-file <keyfile> --integrity-key-size <key_bytes>
Open (activate) the device with HMAC(SHA256) and HMAC key in file:
integritysetup open <device> test --integrity hmac-sha256 --integrity-key-file <keyfile> --integrity-key-size <key_bytes>
Dump dm-integrity superblock information:
integritysetup dump <device>
DM-INTEGRITY ON-DISK FORMAT¶
The on-disk format specification is available on the DMIntegrity <https://gitlab.com/cryptsetup/cryptsetup/wikis/DMIntegrity> page.
AUTHORS¶
The integritysetup tool is written by Milan Broz <gmazyland@gmail.com>.
REPORTING BUGS¶
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
Please attach the output of the failed command with --debug option added.
SEE ALSO¶
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
CRYPTSETUP¶
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
2025-08-19 | integritysetup 2.8.1 |