1 .TH INTEGRITYSETUP "8" "January 2021" "integritysetup" "Maintenance Commands"
3 integritysetup - manage dm-integrity (block level integrity) volumes
5 .B integritysetup <options> <action> <action args>
8 Integritysetup is used to configure dm-integrity managed device-mapper mappings.
10 Device-mapper integrity target provides read-write transparent integrity
11 checking of block devices. The dm-integrity target emulates additional data
12 integrity field per-sector. You can use this additional field directly
13 with integritysetup utility, or indirectly (for authenticated encryption)
16 Integritysetup supports these operations:
20 Formats <device> (calculates space and dm-integrity superblock and wipes the device).
22 \fB<options>\fR can be [\-\-data\-device, \-\-batch\-mode, \-\-no\-wipe, \-\-journal\-size,
23 \-\-interleave\-sectors, \-\-tag\-size, \-\-integrity, \-\-integrity\-key\-size,
24 \-\-integrity\-key\-file, \-\-sector\-size, \-\-progress-frequency]
27 \fIopen\fR <device> <name>
29 \fIcreate\fR <name> <device> (\fBOBSOLETE syntax\fR)
31 Open a mapping with <name> backed by device <device>.
33 \fB<options>\fR can be [\-\-data\-device, \-\-batch\-mode, \-\-journal\-watermark,
34 \-\-journal\-commit\-time, \-\-buffer\-sectors, \-\-integrity, \-\-integrity\-key\-size,
35 \-\-integrity\-key\-file, \-\-integrity\-no\-journal, \-\-integrity\-recalculate,
36 \-\-integrity\-recovery\-mode, \-\-allow\-discards]
41 Removes existing mapping <name>.
43 For backward compatibility, there is \fBremove\fR command alias
44 for the \fBclose\fR command.
48 Reports status for the active integrity mapping <name>.
52 Reports parameters from on-disk stored superblock.
57 Print more information on command execution.
60 Run in debug mode with full diagnostic logs. Debug output
61 lines are always prefixed by '#'.
64 Show the program version.
67 Do not ask for confirmation.
69 .B "\-\-progress-frequency <seconds>"
70 Print separate line every <seconds> with wipe progress.
73 Do not wipe the device after format. A device that is not initially wiped will contain invalid checksums.
75 .B "\-\-journal\-size, \-j BYTES"
78 .B "\-\-interleave\-sectors SECTORS"
79 The number of interleaved sectors.
81 .B "\-\-integrity\-recalculate"
82 Automatically recalculate integrity tags in kernel on activation.
83 The device can be used during automatic integrity recalculation but becomes fully
84 integrity protected only after the background operation is finished.
85 This option is available since the Linux kernel version 4.19.
87 .B "\-\-journal\-watermark PERCENT"
88 Journal watermark in percents. When the size of the journal exceeds this watermark,
89 the journal flush will be started.
91 .B "\-\-journal\-commit\-time MS"
92 Commit time in milliseconds. When this time passes (and no explicit flush operation was issued),
93 the journal is written.
95 .B "\-\-tag\-size, \-t BYTES"
96 Size of the integrity tag per-sector (here the integrity function will store authentication tag).
98 \fBNOTE:\fR The size can be smaller that output size of the hash function, in that case only
99 part of the hash will be stored.
101 .B "\-\-data\-device"
102 Specify a separate data device that contains existing data. The <device> then will contain
103 calculated integrity tags and journal for this data device.
105 .B "\-\-sector\-size, \-s BYTES"
106 Sector size (power of two: 512, 1024, 2048, 4096).
108 .B "\-\-buffer\-sectors SECTORS"
109 The number of sectors in one buffer.
111 The tag area is accessed using buffers, the large buffer size means that the I/O size will
112 be larger, but there could be less I/Os issued.
114 .B "\-\-integrity, \-I ALGORITHM"
115 Use internal integrity calculation (standalone mode).
116 The integrity algorithm can be CRC (crc32c/crc32) or hash function (sha1, sha256).
118 For HMAC (hmac-sha256) you have also to specify an integrity key and its size.
120 .B "\-\-integrity\-key\-size BYTES"
121 The size of the data integrity key. Maximum is 4096 bytes.
123 .B "\-\-integrity\-key\-file FILE"
124 The file with the integrity key.
126 .B "\-\-integrity\-no\-journal, \-D"
127 Disable journal for integrity device.
129 .B "\-\-integrity\-bitmap\-mode. \-B"
130 Use alternate bitmap mode (available since Linux kernel 5.2) where dm-integrity uses bitmap
131 instead of a journal. If a bit in the bitmap is 1, the corresponding region's data and integrity tags
132 are not synchronized - if the machine crashes, the unsynchronized regions will be recalculated.
133 The bitmap mode is faster than the journal mode, because we don't have to write the data
134 twice, but it is also less reliable, because if data corruption happens
135 when the machine crashes, it may not be detected.
137 .B "\-\-bitmap\-sectors\-per\-bit SECTORS"
138 Number of 512-byte sectors per bitmap bit, the value must be power of two.
140 .B "\-\-bitmap\-flush\-time MS"
141 Bitmap flush time in milliseconds.
145 In case of a crash, it is possible that the data and integrity tag doesn't match
146 if the journal is disabled.
148 .B "\-\-integrity\-recovery\-mode. \-R"
149 Recovery mode (no journal, no tag checking).
152 \fBNOTE:\fR The following options are intended for testing purposes only.
153 Using journal encryption does not make sense without encryption the data,
154 these options are internally used in authenticated disk encryption with \fBcryptsetup(8)\fR.
156 .B "\-\-journal\-integrity ALGORITHM"
157 Integrity algorithm for journal area.
158 See \-\-integrity option for detailed specification.
160 .B "\-\-journal\-integrity\-key\-size BYTES"
161 The size of the journal integrity key. Maximum is 4096 bytes.
163 .B "\-\-journal\-integrity\-key\-file FILE"
164 The file with the integrity key.
166 .B "\-\-journal\-crypt ALGORITHM"
167 Encryption algorithm for journal data area.
168 You can use a block cipher here such as cbc-aes or
169 a stream cipher, for example, chacha20 or ctr-aes.
171 .B "\-\-journal\-crypt\-key\-size BYTES"
172 The size of the journal encryption key. Maximum is 4096 bytes.
174 .B "\-\-journal\-crypt\-key\-file FILE"
175 The file with the journal encryption key.
177 .B "\-\-allow\-discards\fR"
178 Allow the use of discard (TRIM) requests for the device.
179 This option is available since the Linux kernel version 5.7.
181 The dm-integrity target is available since Linux kernel version 4.12.
184 Format and activation of an integrity device always require superuser
185 privilege because the superblock is calculated and handled in dm-integrity kernel target.
187 .SH LEGACY COMPATIBILITY OPTIONS
190 Do not use these options until you need compatibility with specific old kernel.
192 .B "\-\-integrity\-legacy\-padding"
193 Use inefficient legacy padding.
195 .B "\-\-integrity\-legacy\-hmac"
196 Use old flawed HMAC calclation (also does not protect superblock).
198 .B "\-\-integrity\-legacy\-recalculate"
199 Allow insecure recalculating of volumes with HMAC keys (recalcualtion offset in superblock
203 Integritysetup returns 0 on success and a non-zero value on error.
209 4 wrong device specified
210 5 device already exists, or device is busy.
213 Format the device with default standalone mode (CRC32C):
215 .B "integritysetup format <device>"
217 Open the device with default parameters:
219 .B "integritysetup open <device> test"
221 Format the device in standalone mode for use with HMAC(SHA256):
223 .B "integritysetup format <device> \-\-tag\-size 32 \-\-integrity hmac\-sha256 \
224 \-\-integrity\-key\-file <keyfile> \-\-integrity\-key\-size <key_bytes>"
226 Open (activate) the device with HMAC(SHA256) and HMAC key in file:
228 .B "integritysetup open <device> test \-\-integrity hmac\-sha256 \
229 \-\-integrity\-key\-file <keyfile> \-\-integrity\-key\-size <key_bytes>"
231 Dump dm-integrity superblock information:
233 .B "integritysetup dump <device>"
236 Report bugs, including ones in the documentation, on
237 the cryptsetup mailing list at <dm-crypt@saout.de>
238 or in the 'Issues' section on LUKS website.
239 Please attach the output of the failed command with the
240 \-\-debug option added.
242 The integritysetup tool is written by Milan Broz <gmazyland@gmail.com>
243 and is part of the cryptsetup project.
245 Copyright \(co 2016-2021 Red Hat, Inc.
247 Copyright \(co 2016-2021 Milan Broz
249 This is free software; see the source for copying conditions. There is NO
250 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
252 The project website at \fBhttps://gitlab.com/cryptsetup/cryptsetup\fR
254 The integrity on-disk format specification available at
255 \fBhttps://gitlab.com/cryptsetup/cryptsetup/wikis/DMIntegrity\fR