LUKS and device mapper
Quick answer
LUKS provides encrypted block-device metadata and key management. Once unlocked, dm-crypt presents a mapped device for normal filesystem access.
Prepare the practice environment
Run python3 lab-fixtures/backup/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Only disposable regular files may be written. Optional examples require an authorized snapshot VM. Never substitute real devices, mount remote shares or change storage configuration. Review the lab guide.
How it works
The stack is backing device, LUKS container, decrypted mapping, filesystem, mount. Encryption at rest helps protect a locked or powered-off device, not data accessible through an unlocked mapping. Keyslots protect access to the volume key; recovery depends on valid credentials and intact metadata. Securely store recovery material separately, protect header backups as sensitive material and test recovery in a VM. Never put passphrases in arguments, environment dumps, shell history or shared logs. The supplied layer report is synthetic, not evidence of encryption.
Think of the decrypted mapping as a view of storage available after unlocking, not a second independent backup of the encrypted device. An authorized process can read plaintext through the mapping subject to normal access controls. When planning recovery, track the encrypted data, its metadata and the required recovery credentials separately. Never test a recovery procedure using the only copy of valuable data.
Try the examples
Read the fictional mapping name, not a real device.
Expected stdout:
bm-vaultA locked state in this exercise is a text record only.
Expected stdout:
state=lockedVM only: instructor supplies a disposable regular-file LUKS image. Inspect metadata, do not publish identifiers or sensitive output; never format or unlock a real disk.
Manual example; not executed locally. Follow its stated environment restrictions.
Common mistakes
Encryption does not replace backup or access control. Loss of all usable credentials or necessary metadata can prevent recovery.
Practice
Draw the five storage layers using layers.txt. Describe how to store recovery credentials separately and how unlocked data remains exposed to authorized processes.
Related references
Study: cryptsetup, dmsetup. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
LUKS and device mapper — Knowledge Check
Apply advanced storage and backup concepts to synthetic fixtures and VM-only scenarios.
What does dm-crypt present when unlocked?
Does encryption at rest protect all data from authorized running processes?
What is a safe credential practice?
What does a fictional layers.txt prove?