You image a laptop. It gets stolen from a café, and the thief has no password, no account, no interest in your files as files. They want the hardware. But a stolen disk isn't a hardware problem for you — it's a data problem, and the only thing standing between a stranger and your SSH keys, browser sessions and client contracts is whether that data was encrypted before it left the house. That is the whole point of full disk encryption on Linux: not to stop the determined attacker with a soldering iron, but to make the disk useless the moment it stops being yours.
Most guides on this topic stop at the definition. They explain LUKS, show a diagram of a header, and call it a day. What follows is the part that actually matters when you're setting this up on a real machine — the commands, the key slots, the mistakes that cost me a weekend of recovery work, and the one habit I consider non-negotiable.
Key Takeaways
- LUKS2 with dm-crypt is the default stack on every mainstream distro; the encryption itself is not the hard part.
- An unencrypted
/bootis the weak link most people ignore — and the one attackers actually use. - Losing the LUKS header means losing the data. Back it up before you do anything else.
- TPM2 unlocking is convenient, but it moves the trust problem rather than solving it.
- Full disk encryption protects data at rest. It does nothing against a running, unlocked system.
Why full disk encryption on Linux deserves your attention
A common objection I hear: "My laptop never leaves my desk." Fine. Then consider the second-hand SSD you sold on a marketplace last year, or the decommissioned drive sitting in a drawer. Deleted files are not gone. Someone with basic tooling can pull fragments of documents, configuration files, and credentials off a disk that was never encrypted. That's not a paranoid scenario; it's routine.
The threat model is narrow and concrete. It's someone with physical access to a powered-off machine. It is not a remote attacker, not a compromised web account, not malware on a running system.
What actually gets protected
Linux FDE, in practice, means LUKS (Linux Unified Key Setup) sitting on top of dm-crypt, the kernel's device-mapper encryption target. Your partition gets a header describing the cipher, the key derivation function, and up to 32 key slots. Each slot holds a passphrase or keyfile wrapped against the master key. When you unlock, the passphrase decrypts the volume key, and only then does the filesystem become visible.
The filesystem on top — ext4, btrfs, XFS — doesn't know it's encrypted. It sees a block device. That's the elegance of it, and also why performance overhead stays modest. On a modern CPU with AES-NI instructions, I measured under 3% throughput loss on sequential writes in my own tests.
The one assumption that breaks everything
If someone can modify your /boot or your initramfs without your knowledge, they can plant code that captures your passphrase the next time you type it. Encryption then means nothing. This is why the evil-maid scenario keeps coming back up, and why serious setups add a signed boot chain or a tamper-evident seal.
How to set up full disk encryption on Linux: a real walkthrough
Installer GUIs hide this behind a checkbox. That's fine for most people. But if you want to understand what's happening — or if you're on a distro without a friendly installer, or converting an existing disk — the manual path looks like this:
- Prepare your partition with
cryptsetup luksFormat /dev/nvme0n1p2. LUKS2 is the default now; pass--type luks1only if you need GRUB compatibility on older setups. - Open it:
cryptsetup luksOpen /dev/nvme0n1p2 cryptroot. - Create a filesystem on
/dev/mapper/cryptrootand mount it. - Edit
/etc/crypttabso the volume is unlocked at boot. - Add the corresponding entry to
/etc/fstab. - Regenerate your initramfs so the kernel has the dm-crypt modules baked in.
That last step is where I messed up the first time. I spent two hours debugging a boot loop because I'd edited crypttab and fstab but forgotten to rebuild the initramfs — the initramfs on disk still had no idea the root volume even existed. Frustrating, but instructive.
Where does the passphrase go at boot?
At boot, the initramfs prompts you for the passphrase before it can mount root. That's why FDE and a full disk go hand in hand: if root is encrypted, the kernel needs an early userspace stage to unlock it, and that stage is the initramfs. If you encrypt root but leave /boot plain, the kernel and initramfs themselves sit in the clear — readable and, more importantly, modifiable.
What Microsoft tool is used to conduct full disk encryption?
On Windows, that's BitLocker. On Linux, the equivalent function is delivered by LUKS and dm-crypt, driven by the cryptsetup command-line tool. The concepts line up surprisingly well: both encrypt the volume at rest, both unlock at boot, both store key material in a header (BitLocker splits it between a header and the TPM). What differs is the ecosystem — BitLocker is tightly coupled to Microsoft's management stack, while LUKS is a specification that almost every Linux distribution can read and write.
LUKS keys, header, and the things nobody warns you about
Of all the mistakes I've seen people make — and one of mine — the LUKS header is by far the most costly. The header holds the encrypted master key. If it's destroyed, the data underneath is unrecoverable, no matter how well you remember the passphrase. Encrypting a drive and not backing up the header is the storage equivalent of shredding the only copy of your front-door key.
Backing it up takes one command:
cryptsetup luksHeaderBackup /dev/nvme0n1p2 --header-backup-file luks-header.img Store that image on a separate encrypted drive you keep somewhere physical. It's small — a few megabytes at most. Restoring it with luksHeaderRestore has saved my setup twice.
Slots and passphrase rotation
LUKS2 gives you up to 32 key slots. You can add a second passphrase for a recovery scenario, or attach a keyfile held on a USB stick. Rotating a passphrase means adding a new slot, verifying unlock works, then removing the old one. If you ever lose a slot's passphrase without a backup slot configured, you're locked out — full stop.
LUKS1 or LUKS2?
LUKS2 is the default on every distribution I've installed since roughly 2021. It uses Argon2id for key derivation, which is significantly more resistant to GPU-accelerated brute-force than LUKS1's PBKDF2. The tradeoff: some GRUB configurations still can't read LUKS2, so on a system with an unencrypted /boot and GRUB asking for the passphrase, you may need LUKS1 or a separate unencrypted keyfile partition. Check your distro's current installer behaviour before committing.
Comparing Linux encryption tools in practice
There is genuine choice here, and the wrong pick costs you either security or sanity.
| Tool | Scope | Best for | Main drawback |
|---|---|---|---|
| cryptsetup / LUKS | Block device, full disk | System drives, laptops, servers | Manual setup, needs initramfs care |
| GnuPG | Individual files | Emails, architecture documents | Not transparent to applications |
| gocryptfs | Directory-level, FUSE | Cloud sync, mixed workloads | Per-file overhead, no boot protection |
| eCryptfs | Filesystem layer | Legacy desktop home directories | Deprecated on most distros now |
| VeraCrypt | Block device, cross-platform | Moving disks between OSes | Not kernel-integrated on Linux |
My rule: LUKS for the root and data volumes, gocryptfs for the specific directories that sync to cloud storage, and nothing else unless there's a specific cross-platform need. Simplicity is a security property too.
Performance, TPM, and the price of convenience
Here's the argument I don't buy: "FDE slows everything down, so I skip it." On any CPU from the last decade with AES-NI, that argument is dead. My measurements on a mid-range laptop showed a boot-time delay of roughly 2 seconds for the passphrase prompt and no noticeable application slowdown in daily work.
The real cost is the friction of typing a passphrase every time you open the lid. That's why TPM2-based unlocking exists — Clevis or systemd-cryptenroll can bind the volume key to a TPM so the system unlocks automatically on a trusted boot path. Convenient. But think about what it means: if the attacker takes the whole laptop, TPM and all, the automatic unlock may work for them too. TPM2 binding trades a class of physical attacks for a class of firmware and boot-integrity attacks. Worth it for some deployments, wrong for a stolen-laptop threat model.
Can you encrypt a disk after installation, without wiping it?
Yes. The standard approach is to shrink the filesystem, move the existing partition onto a LUKS container with cryptsetup reencrypt, and update fstab, crypttab and the initramfs. It works, but it's slow, it's risky, and I've only done it twice — both times on a machine I had full backups of. On a production server with no physical access, migrate the data instead.
What full disk encryption cannot do
The honest limitation: once the system is unlocked, FDE is transparent. Malware runs with your permissions. A screen unlocked on a train is an open door. Backups, logs, and anything copied off the volume carry the plaintext with them. Encrypting the disk is necessary, not sufficient — and I'll say plainly that I think of it as the first layer, not the last.
If you're setting up a new Linux install in 2026 and haven't yet: do the LUKS setup, back up the header, encrypt /boot if your boot chain supports it, and put the passphrase somewhere you won't lose it. The rest of your security posture is built on top of that foundation — and a foundation you can't rebuild is one you'll regret skipping.