← emerge.st

Disk Encryption on Linux

2026-02-19 · linux security

Quick guide to disk encryption using LUKS on Linux. No fluff, just commands.

Creating an encrypted partition

cryptsetup luksFormat /dev/sdX
cryptsetup open /dev/sdX encrypted
mkfs.ext4 /dev/mapper/encrypted

Mounting

mount /dev/mapper/encrypted /mnt/secure

Auto-mounting via /etc/crypttab + /etc/fstab.

Header backup (essential!)

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.