configuration

crypttab — Encrypted device declarations

On systemd-based distributions /etc/crypttab declares encrypted block devices to activate, typically during boot. NAME becomes the mapping name; SOURCE identifies the backing device, preferably with a stable UUID. KEYFILE may be none to request interactive or supported configured key discovery; never store real key bytes in examples. OPTIONS may include luks and noauto; noauto prevents automatic activation through the usual target but other dependencies can still pull in a unit. Distribution initramfs tooling and systemd generators may have different supported options. A mapping is not a mounted filesystem: fstab may reference the mapped device separately. Verify the exact UUID, recovery credentials and backups before changing boot configuration. The sample is fictional and only extracts fields. Do not run cryptsetup or regenerate initramfs on the host for this lab. Restore old crypttab and any affected initramfs via a tested recovery route if an approved VM boot test fails.

Formal Syntax & Structure

linux syntaxlinux
NAME SOURCE KEYFILE OPTIONS

Parameters & Attributes

NameTypeDescription
NAMEdirective or fieldMapping name
SOURCEdirective or fieldBacking device
KEYFILEdirective or fieldKey material location or none
OPTIONSdirective or fieldComma-separated activation options

Return Value

configuration or inspection

Mapping declaration; no volume opened.

Working Example

Example Snippetlinux
set -eud=$(mktemp -d)trap 'rm -rf -- "$d"' EXITprintf 'bmdata UUID=00000000-0000-4000-8000-000000000001 none luks,noauto\n' > "$d/crypttab"awk '{print "mapping=" $1, "key=" $3, "options=" $4}' "$d/crypttab"
Linux Reference