VERITYSETUP(8)

๐Ÿ’– veritysetup(8) โ€” the maintenance-commands girlies ๐Ÿ’–

okay so bestie. you know how a file can just... lie to you? like the bytes on disk are NOT the bytes you think you're reading? yeah. veritysetup(8) is the queen who fixes that. she lives in the Maintenance Commands section of the manual, and she is obsessed with making sure your block device isn't gaslighting you. ๐Ÿซถ


โœจ NAME โœจ

veritysetup โ€” the utility for configuring and managing dm-verity devices. that's it, that's the whole vibe. no cap.


โœจ SYNOPSIS โœจ

veritysetup <action> [<options>] <action args>

literally that's the shape of every single thing you'll ever run. action, then some options, then the args that action needs. periodt.


โœจ DESCRIPTION โœจ

veritysetup is a utility for configuring and managing kernel dm-verity devices. ๐Ÿ’…

the kernel device-mapper dm-verity target gives you read-only transparent data integrity protection for block devices. read-only, transparent, integrity โ€” the holy trinity fr fr.

so when you configure a dm-verity device, veritysetup creates a new mapping that applications can access like any regular storage device. nobody has to know. it's giving main character energy but secretly. ๐ŸŒˆ

the kernel does the verification transparently by comparing each block against pre-computed cryptographic hashes. it uses a Merkle tree (iconic data structure, ate) and it all happens at the kernel level without affecting applications. like, your apps literally do not notice. they're just vibing. โœจ

also!! verity devices can be activated during boot through veritytab(5), which is part of systemd(1). so if you're a systemd girlie you're covered. ๐ŸŽ€


๐ŸŒธ BASIC ACTIONS ๐ŸŒธ

veritysetup supports these operations, bestie. learn them, love them, memorize them:

๐Ÿฆ‹ FORMAT

format <data_device> <hash_device>

calculates and permanently stores hash verification data for the data_device. the hash area can be located on the same device after the data, if you specify it with the --hash-offset option. sneaky but legal. ๐Ÿ’…

you need to provide the root hash string for device verification or activation. and the root hash must be trusted. like, that's the whole entire point, do not skip this.

the data or hash device argument can be a block device or a file image. and if the hash device path doesn't exist? it will be created as a file. surprise! it's a file now. ๐ŸŽ

<options> can be [--hash, --no-superblock, --format, --data-block-size, --hash-block-size, --data-blocks, --hash-offset, --salt, --uuid, --root-hash-file].

if option --root-hash-file is used, the root hash is stored in hex-encoded text format in <path>.

๐Ÿฆ‹ OPEN

open <data_device> <name> <hash_device> <root_hash>
open <data_device> <name> <hash_device> --root-hash-file <path>
create <name> <data_device> <hash_device> <root_hash> (OBSOLETE syntax)

creates a mapping with <name> backed by device <data_device> and using <hash_device> for in-kernel verification. ๐Ÿ”ฅ

the <root_hash> is a hexadecimal string. hex girlies rise up.

<options> can be [--hash-offset, --no-superblock, --ignore-corruption or --restart-on-corruption, --panic-on-corruption, --ignore-zero-blocks, --check-at-most-once, --root-hash-signature, --root-hash-file, --use-tasklets, --shared].

if option --root-hash-file is used, the root hash is read from <path> instead of the command line parameter. it expects hex-encoded text, without a terminating newline. NO newline. she will not accept a newline. ๐Ÿ™ˆ

if --no-superblock is used, you must use the same options as in the initial format operation. same options, bestie. don't get cute.

๐Ÿฆ‹ VERIFY

verify <data_device> <hash_device> <root_hash>
verify <data_device> <hash_device> --root-hash-file <path>

verifies data on data_device using hash blocks stored on hash_device.

this command performs userspace verification; no kernel device is created. so it's the chill, non-committal version. very demure.

the <root_hash> is a hexadecimal string.

if option --root-hash-file is used, the root hash is read from <path> instead of the command line parameter. expects hex-encoded text, without a terminating newline.

<options> can be [--hash-offset, --no-superblock, --root-hash-file].

if --no-superblock is used, you must use the same options as in the initial format operation. again!! same options!!

๐Ÿฆ‹ CLOSE

close <name>
remove <name> (OBSOLETE syntax)

removes existing mapping <name>. bye bestie ๐Ÿ’œ

<options> can be [--deferred] or [--cancel-deferred].

๐Ÿฆ‹ STATUS

status <name>

reports status for the active verity mapping <name>. just a lil wellness check on your device. how are you doing girl. ๐Ÿฉบ

๐Ÿฆ‹ DUMP

dump <hash_device>

report parameters of the verity device from the on-disk stored superblock. it's like reading her diary but consensually.

<options> can be [--hash-offset].


๐Ÿ’… OPTIONS ๐Ÿ’…

okay this is the long part. buckle up. every single flag, no skipping, i promised.

  • --batch-mode, -q โ€” do not ask for confirmation. she's on autopilot, she's confident, she's not asking you twice.
  • --cancel-deferred โ€” cancels a previously configured deferred device removal in the close command. oops, changed my mind ๐Ÿ’…
  • --check-at-most-once โ€” instructs the kernel to verify blocks only once they are read from the data device, rather than every time.
WARNING: it provides a reduced level of security because only offline tampering of the data device's content will be detected, not online tampering. so like... it's faster but she's not watching the whole time. know that going in. ๐Ÿ˜ญ
  • --data-blocks blocks โ€” size of the data device used in verification. if not specified, the whole device is used. whole device. all of her.
  • --data-block-size bytes โ€” used block size for the data device. maximum is the page size used by the kernel. do not exceed her limits, she has boundaries.
  • --debug โ€” run in debug mode with full diagnostic logs. debug output lines are always prefixed by #. so you can clock them instantly. ๐Ÿ”
  • --deferred โ€” defers device removal in the close command until the last user closes it. she'll leave when the party's actually over, not before. โœจ
  • --error-as-corruption โ€” handle device I/O errors the same as data corruption. this option must be combined with --restart-on-corruption or --panic-on-corruption. it does not go alone, she's a package deal.
  • --fec-device device โ€” use forward error correction (FEC) to recover from corruption if hash verification fails. uses encoding data from the specified device.

the FEC device argument can be a block device or a file image. for format, if the FEC device path doesn't exist, it will be created as a file.

block sizes for data and hash devices must match. also, if the verity data_device is encrypted, the fec_device should be too. matching outfits, bestie. ๐Ÿ‘ฏ

FEC calculation covers data, hash area, and optional foreign metadata stored on the same device as the hash tree (additional space after the hash area). the size of this optional additional area protected by FEC is calculated from image sizes, so you must use the same images for activation. same images, always, no switching up.

if the hash device is in a separate image, metadata covers the entire image after the hash area.

the metadata ends on the FEC area offset if the hash and FEC device are in the image.

  • --fec-offset bytes โ€” this is the offset, in bytes, from the start of the FEC device to the beginning of the encoding data. ๐Ÿ“
  • --fec-roots number โ€” number of generator roots. this equals the number of parity bytes in the encoding data. in RS(M, N) encoding, the number of roots is M-N. M is 255, and M-N is between 2 and 24 (including). math girlies, this one's for you. ๐Ÿงฎ
  • --format number โ€” specifies the hash version type. format type 0 is the original Chrome OS version. format type 1 is the current version. 0 is vintage, 1 is the moment.
  • --hash hash โ€” hash algorithm for dm-verity. for default, see --help option. she won't tell you here, go ask --help.
  • --hash-block-size bytes โ€” used block size for the hash device. maximum is the page size used by the kernel. same boundary situation as before.
  • --hash-offset bytes โ€” offset of hash area/superblock on hash_device. value must be aligned with the disk sector offset. alignment is not optional, she's picky about it.
  • --help, -? โ€” show help text and default parameters. also where you find out the default --hash. go look, bestie.
  • --ignore-corruption, --restart-on-corruption, --panic-on-corruption โ€” defines what to do if a data integrity problem (data corruption) is detected.

without these options, the kernel fails the I/O operation with an I/O error. with the --ignore-corruption option, the corruption is only logged. with --restart-on-corruption or --panic-on-corruption, the kernel is restarted (panicked) immediately. (you have to provide a way to avoid restart loops.) like genuinely, set up your escape hatch first. ๐Ÿ˜ญ

use these options only for very specific cases. very. specific. cases. do not freestyle this.
  • --ignore-zero-blocks โ€” instructs the kernel not to verify blocks expected to contain zeroes and always directly return zeroes instead. zeroes in, zeroes out, no questions asked.
use this option only in very specific cases. same energy as above. ๐Ÿšฉ
  • --no-superblock โ€” create or use dm-verity without a permanent on-disk superblock. no receipt, no record, just vibes (and you better remember your format options).
  • --root-hash-file file* โ€” path to file with stored root hash in hex-encoded text.
  • --root-hash-signature file* โ€” a path to the root hash signature file used to verify the root hash (in kernel). this feature requires a Linux kernel version 5.4 or more recent. old kernels need not apply. โœจ
  • --salt=hex string โ€” salt used for formatting or verification. format is a hexadecimal string. a lil seasoning for your hashes ๐Ÿง‚
  • --shared โ€” allows the data device to be used in shared mode. the data device is not checked for exclusive access before the device activation and may be mapped in multiple verity mappings. she's polyamorous now, she's fine with sharing.
  • --usage โ€” show short option help. the sparknotes version. ๐Ÿ“
  • --use-tasklets โ€” try to use kernel tasklets in the dm-verity driver for performance reasons. this option is available since Linux kernel version 6.0. new kernel, new tricks.
  • --uuid UUID โ€” use the provided UUID for the format command instead of generating a new one.

the UUID must be provided in standard UUID format, e.g., 12345678-1234-1234-1234-123456789abc. cute lil pattern, isn't she.

  • --verbose, -v โ€” print more information on command execution. she's telling you everything now, she's oversharing, we love that. ๐Ÿ—ฃ๏ธ
  • --version, -V โ€” show the program version. ๐Ÿ‘‘

๐Ÿ› REPORTING BUGS ๐Ÿ›

okay bestie, found a bug? ๐Ÿ’€ do NOT suffer in silence, go tell the maintainers!

Please attach the output of the failed command with --debug option added. ๐Ÿซถ seriously, this is the move. no --debug output and the devs are just out here vibing blind. give them the receipts. ๐Ÿงพโœจ

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€


๐Ÿ‘‘ CRYPTSETUP ๐Ÿ‘‘

Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>. ๐ŸŽ€ that's the whole family right there, and yeah, veritysetup is part of it, iykyk. ๐Ÿ’œ


and that's the whole page, bestie!! ๐Ÿฆ‹ you just read the entirety of VERITYSETUP(8) from the cryptsetup project โ€” veritysetup 2.8.8, dated 2026-09-07 โœจ go forth and verify all the things, you absolute main character. slay, no cap. ๐Ÿ’…๐Ÿ‘‘๐Ÿ’–

๐Ÿ“ฆ where this page comes from