Encrypt and recover a Linux data volume with LUKS

8 steps · about 2 h 30 min · Intermediate

  1. Learn the cryptsetup safety model (reference, Linux man-pages, 22 min)

    Review device mapping, LUKS metadata and destructive command boundaries before using a lab volume.

  2. Create a LUKS2 container (reference, Linux man-pages, 18 min)

    Choose LUKS2 defaults deliberately and confirm the target device before writing its header.

  3. Open and inspect the mapping (reference, Linux man-pages, 16 min)

    Create a device-mapper mapping, build a filesystem above it and verify which layer is encrypted.

  4. Manage a second recovery credential (reference, Linux man-pages, 16 min)

    Add and test a separate key slot before changing an existing credential.

  5. Retire a key slot safely (reference, Linux man-pages, 14 min)

    Verify another credential works before removing access and avoid locking out the volume.

  6. Back up critical LUKS metadata (reference, Linux man-pages, 16 min)

    Protect a header backup separately and understand why it can preserve access to old key material.

  7. Define controlled boot-time activation (reference, systemd documentation, 20 min)

    Configure device identity and credential handling without embedding a plaintext secret in the repository or unit.

  8. Rehearse unlock and header recovery (guide, SUSE documentation, 28 min)

    Restore only in an isolated lab, verify data access and record where recovery material and ordinary backups differ.