Some of most popular Linux distributions including Ubuntu, Linux Mint and Fedora come with a disk and partition manager tool called GNOME Disks, a tool developed by the GNOME project. While it’s packed with features, one interesting capability that’s a bit tucked away is disk encryption; this can be used to create secure partitions on your hard drive or create an encrypted USB device.
In this short guide, I will show you how to create an encrypted USB stick. One of the drawbacks to encrypting the device using this method is that you"ll be limited to what file system you use. To get started, go to your application menu and search or look for GNOME Disks, it might just be called Disks. If you don’t see it anywhere, then you’ll have to head to your package manager and do a search for it.
Once you’ve opened GNOME Disks, you’ll need to plug in the USB device that you want to encrypt. The encryption process will wipe the device so be absolutely sure that you’ve backed up any important data.
When you plugged in your USB device, you should have seen it pop-up on the left-hand pane, if you didn’t, unplug the device and plug it in again. Once you see it, select it. At this point, you can keep the existing partitions intact and just format one of them or you can format the entire device, create a new partition, and encrypt everything.
If you want to format everything, just press the three-dot menu button in the top right of GNOME Disks and select ‘Format Disk’ and feel free to adjust the erasure and partitioning options as you see fit. Once you"re happy, hit ‘Format’ and then ‘Format’ again on the confirmation box. Once that’s done, you should see a plus button under the volumes, press that, select your partition size, and press ‘Next’.
The next set of options are the most important, give your disk volume a name, then select the EXT4 option and tick the ‘Password protect volume’. If you do not want to use EXT4, press ‘Other’ and then hit ‘Next’. Here you can select XFS, Linux Swap Partition, BTRFS and possibly several others. Be sure to tick the ‘Password protect volume’ box on this screen if you choose one of these alternatives and press ‘Next’, then enter your password twice and press ‘Create’.
If you decided to keep several volumes on your device and you just want to encrypt one of a few of the partitions, select the partition to encrypt and press the gear icon next to the play and minus icons. You should now see ‘Format Partition’, selecting this will open up the same dialog box as the one described earlier and the instructions to encrypt the selected partitions are the same. Be sure that you’ve backed up any data from the partition you’re about to format.
While I’ve only gone over the instructions for encrypting a USB device, the guide is pretty much the same for encrypting internal and external hard drives too. If you plan to alter partitions on a hard drive that’s actively being used, you will have to do this process from a LiveUSB or LiveCD environment, and be sure that you’ve backed up any data you want to keep.