How to Encrypt USB Drive on Ubuntu 18.04 LTS

On this page

Encryption is the best way to protect your important documents personal info and other credentials. Suppose, you have a USB pen drive and your all important data stored on it. In case you will lose your USB pen drive, all data stored on it will be lost. It will be in hands of some other person which will access your personal information and misuse it. So, the best solution to protect your data is to encrypt your USB pen drive with password.

In this tutorial, we will learn how to encrypt your USB drive on Ubuntu 18.04 LTS.

Requirements

Ubuntu 18.04 desktop installed on your system.

A non-root user with sudo privileges.

Install Required Tools

First, you will need to install gnome-disk-utility and cryptsetup to your system. Cryptsetup is a utility for setting up encrypted filesystems with the help of Device Mapper and dm-crypt. You can install both tools with the following command:

sudo apt-get install gnome-disk-utility cryptsetup -y

Encrypt USB Drive

IMPORTANT: Before you proceed, back up all data that is on the USB Media as the data on the USB Media gets erased when the partition type is changed to an encrypted partition.

First, plug in your USB flash drive to the system. Next, launch the Disks utility from the Unity Dash. You should see USB drive in the left pane:

Next, umount the filesystem as shown below:

Next, click on the Format button as shown below:

Next, select encryption type, partition name and set your password as shown below:

Now, click on the Format button to encrypt the USB drive.

Access USB Drive

Your USB pen drive is now secure with a password. To test it, unplug and plug in USB drive again. You should be asked to input password to get access the partition as shown below:

Now, provide the password and click on the Connect button. You can access your USB pen drive.

Suggested articles

2 Comment(s)

Comments

My only concern is that such encryption is only useable under Linux. a Windows user, or someone with multiple OSes will have problems getting access to those encrypted files, if not using Linux. Do you have some solution to such problem ?

a) your mobile photo sucks. 8 years a Linux user and you never heared of time-delayed-screenshots?

Let me help you out:

gnome-screenshot -p -w -d 5

-d 5 => 5 SECONDS... adjustable timeframe ;)b) @JFM

1) there is a windows version of a luks-mounter, but it is not a wise idee to use old betaware. from the principle side, luks is OSS and you can use and build it on Windows too. be creative ;)

2) working solution : VeraCrypt

You can use VeraCrypt to make a disk-encryption that it compatible with linux, windows and mac, if you format the resulting partition with NTFS.

BUT, of course, if you carry your VeraCrypt-Drive to a stock windows without VeraCrypt installed, you can't decode it.

Admin hint: Make a small not-encrypted partition on the usb-drive to store your encryption software. That way, if a computer does not have VC installed, you can install it when needed ;) Don't forget to update it from time to time.