How to Quickly Encrypt Removable Storage Devices with Ubuntu


Ubuntu can quickly encrypt USB flash drives and external hard drives. You’ll be prompted for your passphrase each time you connect the drive to your computer – your private data will be secure, even if you misplace the drive.

Ubuntu’s Disk Utility uses LUKS (Linux Unified Key Setup) encryption, which may not be compatible with other operating systems. However, the drive will be plug-and-play with any Linux system running the GNOME desktop.

Getting Started

You’ll have to install the cryptsetup package before you can use the Disk Utility’s encryption feature. Do so with the following command:

sudo apt-get install cryptsetup

You should also back up any files on the removable storage device before encrypting it. The encryption process will format the drive, deleting all data on it.

Encrypting a Drive

To encrypt a drive, launch the Disk Utility from the Dash. This utility is installed by default – if you don’t have it installed for some reason, install the gnome-disk-utility package.

Connect the removable storage device – for example, a USB flash drive or external hard drive – and select it from the Peripheral Devices section. Ensure you select the correct device so you don’t accidentally wipe important files.

After selecting the drive, click the Unmount Volume button in the right pane — you can’t format the device’s partition while it’s mounted. A removable storage device normally has a single partition on it, but you can create additional partitions here – for example, you could have one unencrypted partition and one encrypted partition on a USB stick.

Click the Format Volume button and enable the Encrypt underlying device check box.

The confirmation dialog doesn’t say so, but the formatting process will erase all files on the drive. Ensure you’re formatting the correct drive and you’ve backed up its files before continuing.

You’ll be prompted to create a passphrase – ensure you use a strong one. You can have Ubuntu remember the passphrase forever, if you like – this decreases security, but allows the drive to work on your current system without any prompts. If you take the drive to another system, you’ll be prompted to enter the appropriate password before using it.

Using an Encrypted Drive

Connect the removable storage device to any Ubuntu system – or any system running the GNOME desktop – and you’ll be prompted to enter your password. After you enter the password, the device will be usable.

A padlock icon identifies encrypted drives in the file manager.

If you ever want to change your passphrase in the future, you can use the Change Passphrase option in the Disk Utility. You can also format the volume again to remove the encryption.