CRYPTSETUP-LUKSHEADERBACKUP(8)

πŸ’Ύ NAME πŸ’Ύ

okay bestie, so cryptsetup-luksHeaderBackup β€” it stores a binary backup of the LUKS header and keyslot area. that's it, that's the whole vibe. it's from the cryptsetup manual (section 8, Maintenance Commands), and it's genuinely one of the most important things you can do before you start messing with a LUKS device. no cap. πŸŽ€


✨ SYNOPSIS ✨

cryptsetup luksHeaderBackup --header-backup-file <file> [<options>] <device>

πŸ¦‹ DESCRIPTION πŸ¦‹

Stores a binary backup of the LUKS header and keyslot area.

Using '-' as a filename writes the header backup to a file named '-'. (yes literally a file called -. iconic, confusing, but exactly what it does. πŸ™ˆ)

The backup file and a passphrase valid at the time of backup allow decryption of the LUKS data area, even if the passphrase was later changed or removed from the LUKS device. Note that with a header backup, you lose the ability to wipe the LUKS device securely by just overwriting the header and keyslots. You must either securely erase all header backups or overwrite the encrypted data area.

bestie listen πŸ’€ β€” this is the whole reason this page matters. that backup file is a master key to your data. if someone gets it, they can decrypt even after you change or remove the passphrase. so you can't just shred the header on the disk and call it a day β€” you gotta nuke every single backup too, or overwrite the actual encrypted data area. periodt.

<options> can be [--header, --header-backup-file, --disable-locks].


πŸ’… OPTIONS πŸ’…

  • --batch-mode, -q β€” suppresses all confirmation questions. use with care!

If the --verify-passphrase option is not specified, this option also switches off the passphrase verification.

  • --debug or --debug-json β€” run in debug mode with full diagnostic logs. debug output lines are always prefixed by #.

If --debug-json is used, additional LUKS2 JSON data structures are printed.

  • --disable-locks β€” disable lock protection for metadata on disk. this option is valid only for LUKS2 and is ignored for other formats.
WARNING: Do not use this option unless you run cryptsetup in a restricted environment where locking is impossible to perform (where /run directory cannot be used).

(fr fr, don't just vibe-check this one on. it's for weird locked-down environments only. 🚫)

  • --header <device or file storing the LUKS header> β€” use a detached (separated) metadata device or file where the LUKS header is stored. this option allows one to store the ciphertext and LUKS header on different devices.

For commands that change the LUKS header (e.g., luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

  • --header-backup-file file β€” specify a file with the header backup file. (yes this is the one you literally can't run the command without, so... 🫢)
  • --help, -? β€” show help text and default parameters.
  • --usage β€” show short option help.
  • --version, -V β€” show the program version.

😭 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.

not me begging you to actually include the --debug output πŸ™ the maintainers cannot help you if you just say "it broke". give them the receipts.

🌈 SEE ALSO 🌈


πŸ‘‘ CRYPTSETUP πŸ‘‘

Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


and that's the whole page bestie, you ate it πŸ’– this manual page came to you courtesy of cryptsetup 2.8.8, dated 2026-09-07 β€” go back up your header, you main character πŸ§šβœ¨πŸ’œ

πŸ“¦ where this page comes from