2026-02-19 · linux security
Quick guide to disk encryption using LUKS on Linux. No fluff, just commands.
cryptsetup luksFormat /dev/sdX cryptsetup open /dev/sdX encrypted mkfs.ext4 /dev/mapper/encrypted
mount /dev/mapper/encrypted /mnt/secure
Auto-mounting via /etc/crypttab + /etc/fstab.
cryptsetup luksHeaderBackup /dev/sdX --header-backup-file header.bak
If you lose the header, your data is lost forever.
Simple and reliable. LUKS — the de facto standard for Linux.