Skip to content

What LUKS Is

You have a disk — a laptop drive, a desktop's second disk, a USB stick — full of files you would not hand to a stranger. Disks leave your control in ordinary ways: a laptop forgotten in a car, a machine sold or recycled, a drive sent back under warranty, a bag stolen from a hotel room. On an ordinary disk, whoever holds it can read everything on it, whatever your login password says — they just attach it to their own computer, or boot yours from a USB stick, and your files open like a book.

LUKS is the Linux answer to that. The name is short for Linux Unified Key Setup. It is a standard way of arranging an encrypted disk: a small header at the start of the device that holds the keys, and the rest of the device encrypted with a strong cipher under a master key that never leaves the header except in unlocked memory. The tool that creates and manages it is called cryptsetup, and it is part of every major Linux distribution. When you tick "encrypt this disk" in an Ubuntu or Fedora installer, LUKS is what you get.

The arrangement buys one thing above all: the passphrase is not the key. Your passphrase unlocks a copy of the master key, wrapped (encrypted) with a key derived from your passphrase. That sounds like a detail; it is actually the design. It means you can change your passphrase without re-encrypting a terabyte of data — the master key stays, the wrapping changes. It means several passphrases can unlock the same disk, each in its own key slot. And it means destroying a slot is instant and total: overwrite one small wrapped copy and that passphrase will never open the disk again, even though the data itself is untouched. Chapters 2, 6 and 8 build on this one idea, so it is worth having before any command appears.

The threat model, honestly

Disk encryption has a precise promise, and it is smaller than most people assume:

What LUKS protects: your data while the machine is off (or the volume is closed). A thief with your powered-off laptop gets ciphertext. A buyer of your old drive gets ciphertext. Someone who images the disk in a lab gets ciphertext. Getting anything else requires your passphrase, and the header is built to make guessing it expensive — chapter 6 shows the deliberately slow key derivation that stretches each guess to about two seconds of hard work.

What LUKS does not protect:

  • A running, unlocked machine. Once you have typed the passphrase, the data is readable by the system — and by anything running on it, including malware, and including someone who walks up to it while you are logged in. Encryption at rest is not a lock screen and not an antivirus.
  • A passphrase that is given up. Coercion, a sticky note, a password manager breach, the same passphrase reused from a leaked account — the cryptography does not care how the right passphrase arrived.
  • Copies that live elsewhere. The backup drive you forgot to encrypt, the cloud sync, the email attachment. LUKS encrypts one device, not your habits.
  • Destruction. LUKS makes data unreadable to strangers; it does not keep it existing. A smashed or overwritten disk loses the data for you too — only backups answer that, and chapter 8 explains the header's own special version of this rule.

Hold onto the shape of that promise: off is safe, on is open, and lost passphrases lose data. Every design choice in the rest of the guide follows from one of those three.

What it is not

LUKS is not a file encryptor: it works on a whole device or partition at once, below the filesystem, and cannot pick out individual files — that is the job of tools like age (which has its own guide in this series). It is not a plausible-deniability tool: the header announces itself plainly, and anyone can see that a device is LUKS-encrypted and how its slots are occupied — the secret is the key, never the existence of the lock. It is not VeraCrypt, the cross-platform cousin chapter 14 compares it with, and it does not run on Windows or macOS at all: a LUKS device plugged into either is simply unreadable. And it is not a backup: encryption and backups solve different problems, and each makes the other slightly more necessary.

Who it is for

Anyone whose Linux machine might leave the house, whose old drives pile up in a drawer, or whose USB sticks carry work between places. The home user with tax documents on a laptop. The maker whose field laptop lives in a van. The careful person who sells old hardware and would rather sell ciphertext. The common thread is data that travels, and an owner who has decided that losing the hardware should not also mean losing the information.

The honest catch, up front

Two catches, and this guide will not let you forget either. First: the protection is only as good as the passphrase and the moment. A weak passphrase on a stolen disk can be ground down by a patient attacker with graphics cards, because the slow key derivation raises the price of guessing without making it infinite. Second: there is no back door, for anyone. Forget every passphrase and lose every key file, and the master key is unreachable and the data is noise — not "hard to recover", not "support can help", gone. The lab demonstrated a small version of this on purpose, destroying a header and showing what survives (chapter 8). LUKS is a tool that takes your instructions literally, including the ones you come to regret, and using it well mostly means arranging — spare keys, a header backup, a passphrase you will still know in five years — to have no regrets available.