Encrypt and recover a Linux data volume with LUKS
8 steps · about 2 h 30 min · Intermediate
- 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.
- Create a LUKS2 container (reference, Linux man-pages, 18 min)
Choose LUKS2 defaults deliberately and confirm the target device before writing its header.
- 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.
- Manage a second recovery credential (reference, Linux man-pages, 16 min)
Add and test a separate key slot before changing an existing credential.
- Retire a key slot safely (reference, Linux man-pages, 14 min)
Verify another credential works before removing access and avoid locking out the volume.
- 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.
- 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.
- 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.