Pcornel
Storage · Data Protection

LUKS

Cheat sheet · https://pcornel.dk/topic.php?topic=4288

Back to the Topic

Answer

LUKS is the standard Linux disk encryption format on dm-crypt. It stores encrypted volume keys in key slots unlocked by passphrases, key files or TPM, managed with cryptsetup.

Remember

  • Back up the LUKS header.
  • Several key slots allow passphrase and key file.
  • Lost passphrase = lost data.

First checks

  • cryptsetup luksDump /dev/<dev> — header and keyslots
  • cryptsetup status <name> — active mapping
  • cryptsetup luksHeaderBackup /dev/<dev> --header-backup-file hdr.img — header backup

Verify in this order

keyslot → master key → dm-crypt → filesystem

Where it usually breaks

First mismatch in source consistency → capture/journal → transport → repository/replica → catalog/checkpoint → restore/failover read-back; preserve identity/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4288

Confirmation

Confirm action

Continue?