trio.so
Explained

Linux Full Disk Encryption: Why It Matters and How to Set It Up With LUKS

How full disk encryption works on Linux with LUKS, how to turn it on at install or on an existing Ubuntu system, TPM unlock, recovery keys and performance.

Mountain landscape representing leadership perspective and vision
Written by
Atena Ladchartabi

Content writer, trio.so

Published on
Modified on

Full disk encryption on Linux means the disk (or the partition that holds the system and your files) is encrypted with LUKS, the standard Linux disk encryption format, and unlocked at boot with a passphrase or, on recent Ubuntu releases, the computer's TPM. The easiest way to turn it on is when you install: Ubuntu and Fedora both offer an encryption option in the installer. Encrypting a system that is already installed is possible but riskier, so back up first or reinstall. Keep a second passphrase or recovery key somewhere safe, because a lost LUKS passphrase cannot be reset.

If you are about to install Linux on a laptop, start with the installer steps below; if your laptops are already running unencrypted, read the section on existing systems before you touch anything.

What full disk encryption on Linux means

Linux disk encryption has two layers. dm-crypt is the kernel feature that encrypts and decrypts a block device on the fly. LUKS (Linux Unified Key Setup) is the on-disk format that sits on top: a header that stores the encrypted volume key in several key slots, so one disk can be opened with more than one passphrase or key. The cryptsetup tool manages both. Current distributions create LUKS2 volumes by default.

"Full disk" usually means everything except a small unencrypted boot partition: the root file system, your home folders and swap sit inside the encrypted volume, often with LVM on top so they can be separate logical volumes. When the computer starts, you enter the passphrase (or the TPM releases the key), the volume is unlocked, and everything after that reads and writes normally.

That is different from encrypting a single folder or a container file. Full disk encryption covers the temporary files, swap, browser caches and configuration files that folder-level tools miss.

Why every Linux laptop should be encrypted

The original version of this post listed five reasons. They come down to these:

  • Lost and stolen laptops. Without encryption, anyone can take the drive out, or boot a live USB, and read every file. With LUKS, they get unreadable data.
  • Repairs, returns and disposal. A drive sent for repair or a laptop sold on keeps its data readable unless it is encrypted.
  • Compliance. Security frameworks and customer questionnaires routinely ask for encryption of data at rest on laptops. Encryption is usually how you meet that requirement for portable devices.
  • Little performance cost. Modern processors accelerate AES, so for everyday work the overhead is small (see the performance section).
  • It is built in. LUKS ships with every major distribution. There is nothing to buy.

What encryption does not do: it protects data at rest, when the device is off or locked at the passphrase prompt. Once the volume is unlocked and you are signed in, malware and remote attackers see your files as you do. Patching, a screen lock and good account practices still matter. See endpoint hardening.

How to enable full disk encryption at install

Encrypting at install is the safest path: the installer partitions the disk, creates the LUKS volume and sets up booting for you.

Ubuntu

  1. Start the Ubuntu installer and choose to erase the disk and install Ubuntu.
  2. Open the advanced options for the disk and pick the encryption option. The passphrase-based option uses LVM with encryption; on Ubuntu releases that offer it, hardware-backed encryption uses the TPM instead (see the next section).
  3. Set a strong passphrase. If the installer offers a recovery key, save it somewhere other than the laptop.
  4. Finish the installation. From now on Ubuntu asks for the passphrase at each boot, before the login screen.

Labels differ slightly between releases, so read each screen, but the option is always in the disk setup step.

Fedora

In the Fedora installer, the disk setup step has an option to encrypt the data. Tick it, set a passphrase, and the installer creates a LUKS2 volume for the system. Fedora asks for the passphrase at boot.

Check that it worked

lsblk -f
# look for a partition with FSTYPE crypto_LUKS and the system mounted inside it

sudo cryptsetup luksDump /dev/nvme0n1p3
# shows the LUKS version, cipher and which key slots are in use

Replace /dev/nvme0n1p3 with the partition lsblk shows as crypto_LUKS.

TPM-backed unlock on Ubuntu

A passphrase at every boot is secure but some teams find it awkward. Ubuntu's hardware-backed encryption stores the key in the TPM, which releases it only if the boot chain has not been tampered with, so the laptop starts without a passphrase prompt. Canonical introduced it behind an experimental flag in earlier releases and says it reaches general availability with Ubuntu 26.04 LTS. Canonical also says the Security Center in 26.04 shows the TPM-backed encryption state and the recovery options.

Two practical points. First, it depends on firmware: Secure Boot and a working TPM 2.0 are needed, and the installer declines when it cannot use them. Second, firmware updates and some hardware changes can trigger the recovery prompt, so the recovery key has to be stored somewhere you can reach when the laptop cannot boot. If your fleet runs an earlier Ubuntu LTS, use the passphrase option.

Can you encrypt an existing Linux installation?

The honest answer: yes, but reinstalling with encryption is usually faster and safer.

Recent versions of cryptsetup can convert an existing partition to LUKS2 in place with cryptsetup reencrypt --encrypt. For a data partition, that can be reasonable: back it up, unmount it, shrink the file system to leave room for the LUKS header, run the conversion, then add the volume to /etc/crypttab. For the root file system it is much harder, because the system cannot be running from the partition you are converting and the boot setup (initramfs, crypttab, GRUB) has to be changed to unlock it. A mistake, or a power cut during the conversion, can cost you the data.

For a laptop, the usual plan is:

  1. Back up home folders and anything else you need, and test the backup.
  2. Reinstall with the installer's encryption option.
  3. Restore the data and reinstall your applications.

Avoid third-party tools that claim one-click conversion of a running Linux system unless you have tested them on a spare machine.

LUKS basics: the cryptsetup commands you will use

# Is this partition LUKS, and which key slots are used?
sudo cryptsetup luksDump /dev/nvme0n1p3

# Add a second passphrase (a backup or recovery passphrase)
sudo cryptsetup luksAddKey /dev/nvme0n1p3

# Change a passphrase
sudo cryptsetup luksChangeKey /dev/nvme0n1p3

# Remove a passphrase you no longer want
sudo cryptsetup luksRemoveKey /dev/nvme0n1p3

# Back up the LUKS header to a file (store it off the laptop)
sudo cryptsetup luksHeaderBackup /dev/nvme0n1p3 --header-backup-file luks-header.img

To encrypt an empty extra drive, such as an external disk, format it with cryptsetup luksFormat, open it with cryptsetup open, then create a file system on the opened device. luksFormat destroys everything on the target, so check the device name twice.

Recovery keys and passphrase management

LUKS has no "forgot passphrase" button. If every passphrase and key for a volume is lost, the data is gone. Plan for that before anyone needs it:

  • Use a long passphrase, several words, not a short password.
  • Add a second key slot with a recovery passphrase that only IT holds, or keep the recovery key the installer created.
  • Store recovery passphrases outside the laptop, in a password manager or a key escrow system, never in a text file on the same disk.
  • Keep a header backup for important volumes. A damaged LUKS header makes the volume unopenable even with the right passphrase. The header backup contains the key slots, so protect it like a passphrase.
  • When someone leaves, change or remove their passphrase with luksChangeKey or luksRemoveKey.

Does full disk encryption slow Linux down?

On current hardware, rarely enough to notice. LUKS2 uses AES in XTS mode by default, and processors with AES instructions (AES-NI on Intel and AMD, the cryptography extensions on Arm) do that work in hardware. You can measure your own machine:

cryptsetup benchmark

Look at the aes-xts lines: if they show speeds well above your SSD's speed, encryption will not be the bottleneck. Older processors without AES instructions, and very fast NVMe drives under heavy write loads, are where the cost shows. Unlocking at boot takes a moment longer because LUKS2 uses a memory-hard key derivation function (Argon2) on purpose, to slow down passphrase guessing.

For a wider look at the trade-offs, see hardware vs software encryption, and for the equivalents on other systems, BitLocker vs VeraCrypt and FileVault.

Managing this across many devices

Encrypting one laptop at install is easy; proving that fifty are encrypted, and finding the recovery passphrase for one that will not boot, is the work. trio.so shows the disk encryption status of enrolled Linux devices, its Linux policy includes LUKS disk encryption, and the LUKS passphrase for a device is escrowed in the console, where revealing it needs a fresh sign-in check. See Linux device management.

A Linux laptop's Security tab in trio.so, showing disk encryption on, recovery key escrow yes, and an escrowed LUKS passphrase with a Reveal button.
In trio.so, a Linux laptop's Security tab shows disk encryption and its escrowed LUKS passphrase.

Related reading: Linux user management best practices and what full disk encryption is.

Ready-to-use Templates

Must-have Template Toolkit for IT Admins

Explore All
Template Toolkit

See which Linux laptops are encrypted

trio.so shows disk encryption status for enrolled Linux devices and keeps their recovery keys.

Start free trial

Manage Every Device From One Console

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

14-day free trial. No credit card required.

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

Smiling womanAbstract geometric patternAbstract geometric patternSmiling womanSmiling woman

Frequently Asked Questions (FAQ)

Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.

Choose the encryption option in the installer's disk setup step. Ubuntu and Fedora both create a LUKS volume and ask for a passphrase at boot.

It is possible with cryptsetup reencrypt, but converting the root file system in place is risky. The safer route is to back up, reinstall with encryption, and restore your data.

LUKS (Linux Unified Key Setup) is the standard format for encrypted disks on Linux. It works with the kernel's dm-crypt and stores the volume key in key slots, so a disk can have more than one passphrase.

Usually not noticeably on processors with AES instructions. Run cryptsetup benchmark to compare encryption speed with your disk speed.

Without another passphrase, a recovery key or a key held by your IT team, the data cannot be recovered. Add a backup key slot and store it safely before you need it.

Related

From the blog

The related industry news, interviews, technologies, and resources.