Ubuntu – How to install Ubuntu with full disk encryption without having to “erase everything”

dual-bootencryptionlukspartitioningsystem-installation

I want to install Ubuntu with full disk encryption using LVM. I already have Windows 10 installed on my hard drive.

For full disk encryption, the installer only gives me the option to wipe everything to install it on an encrypted LVM. Is there a way to install Ubuntu manually using full disk encryption with LVM?

I saw this option in the Ubuntu Server installer but I don't want to have to manually install GNOME after installing Ubuntu Server.

Best Answer

Yes! You can use the Ubiquity installer to manually install Ubuntu inside an encrypted LVM volume. And you can do it on the same drive as a Windows 10 installation.

Disclaimer: There is a heightened risk of data loss when installing Operating Systems or making changes to partition tables. It is easy to make mistakes, so you should have sufficient backups before doing any of this.

Prepare for Installation

First, boot up your Ubuntu installation media as LiveUSB ("Try Ubuntu").

Open the Disks application and navigate to the disk that contains Windows, where you would also like to install Ubuntu. You can also see the partition with your Windows install, as well as an EFI partition and Windows system and recovery partitions. Leave these alone. Take a note of the /dev/sdx# identifiers. In this example, /dev/sda is the disk we are going to work on.

Verify that you have un-partitioned "Free Space" available. Ubuntu cannot shrink a partition with a Windows install leaving it intact. If you can't free up space here by deleting non-essential partitions, you will need to consult with Windows' documentation on how to shrink your Windows partition before going any further.

Disks Application

Begin the Installer

Click "Install Ubuntu" on the desktop, or reboot back to the USB and select "Install Ubuntu".

Proceed through the installation prompts until you get to Installation type.

Here you will click "Something Else" and Continue.

Set up Encryption and boot partitions

Here you will see another representation of the partitions of your drives.

1) Set the Device for boot loader installation as the same physical disk as your Windows install. In our example it is /dev/sda.

partitions

2) Create the /boot partition: Select your free space partition that we verified/created earlier, and click the + button. Set the mount point as /boot and set the size. In our example we have set 500MB. (If you like to keep lots of old kernels you might want to increase this amount) Click OK.

partitions

3) Create your encrypted root partition: In the remaining free space, again click the + button. Change Use as: to "physical volume for encryption" and set up your password. This will be the password that you need to enter after selecting Ubuntu in GRUB. You will not be able to decrypt your OS without it so don't forget this password.

partitions

4) Set / mount point: Double click on the newly created volume. In this example, it is the ext4 partition labeled dev/mapper/sda6_crypt. Change the "Mount point" to / and click OK.

partitions

5) Verify EFI partition: Just to be sure, let's also double-click on the EFI partition with Windows Boot Manager. Make sure Use As is set to EFI System Partition and click OK.

partitions

Final Check & Install

Make sure your /boot and / and EFI partitions are where they are supposed to be, and double check that the device for bootloader installation is correct. If everything is in order, you are ready to Install Now.

This concludes the setup of your encryption/LVM and partitions. Once the installation is complete, your system should boot to GRUB with Ubuntu and Windows as options. When you select Ubuntu, you will be required to enter a password to unlock sdx#_crypt to continue booting.

Related Question