How did I get here?

I have been using KDE Neon for quite a while now, following my several years of using KDE: First via Redhat, then Mandrake, then Kubuntu. Neon provides much more up-to-date packages than using Kubuntu while still not being so far on the bleeding edge that you often cut yourself. Bug fixes often come more quickly as well, since the developers are “dog fooding” the distro. That said, if you want stability, stick with Kubuntu.

Neon uses the Calamares installer, as does Kubuntu. The installer has had a long-standing crash bug when trying to create a disk with LVM. This is a major blocker for me as I install LUKS2+LVM on any system I set up. My usual route involved installing Ubuntu Server Minimal, adding KDE Neon sources, and then installing the “neon-desktop” meta-package. Thanks to an interaction with Carlos de Maine, we were able to come up with a way to use the offical installer, but still do a full LUKS2+LVM setup.

Disclaimer: This works on KDE Neon. It may work on other distributions (inluding Kubuntu) as well, but your mileage may vary.

What’s first?

This guide assumes you’ve created your CD or USB stick to boot up the installer. If not, ISO Image Writer is a great utility to create bootable USB sticks.

Let’s get going

Once booted, you’ll be sitting on the desktop, with an icon for the installer in the top-left corner. Don’t click on that yet! We’ll get there. You can close the welcome screen as well.

Open a shell by running Konsole. Install the partition manager by typing

sudo apt-get install -y partitionmanager

You can also use the Discover utility to install this. Open Discover and search for “partition,” and you’ll see KDE Partition Manager, probably as the second option.

Partition the Disk

Start Partition Manger. You’ll see a window similar to the following:

Right-click on the hard drive, and select “New Partition Table,” make sure “GPT” is selected, and click “Create New Parition.”

Neon gives a message about allocating 8MB of unformatted space at the beginning of the drive if you’re doing GPT installs, so let’s do that. Right-click on the “unallocated” line, then click “New.” Select “unformatted” for the File System; set the Size to 8MB. All the other values are fine. Click OK.

Once again, right-click on “unallocated,” and click “New.” We’ll create a 1 gigabyte partition for /boot that is unencrypted. File System is ext4, and size is 1024MB. Click OK.

For the last time, right-click on “unallocated” and click “New.” File System should be “lvm2 pv,” and the Free Space should be the rest of the drive. Below the “File System” entry, click “Encrypt with LUKS,” click “Enable LUKS2,” and then enter the password you want to use.

The partitioner should look similar to this:

Now, click “Apply” in the top-left corner of the partitioner, and click “Apply Pending Operations.” Once done, click OK.

Now, when we do LUKS2 on LVM, Partition Manager, for some reason, does not pick it up automatically like it would if we simply did LVM. So, back to Konsole we go. Execute this command:

sudo vgcreate vg_system /dev/mapper/luks-*

We use luks-* because the ID is a random UUID. Instead of typing *, you could also hit the tab key after luks- and it will auto-fill the device. This assumes you’ve only created one LUKS device. If you have created more than one, make sure you put the correct path there.

If all goes well, you should see the output:

  Volume group "vg_system" successfully created

Go back to the partition manager. Click “Refresh Devices.” You should now see vg_system in the device pane on the left side. Click on it.

Create your Logical Volumes

Right click on “unallocated” in the right-hand pane, and click “New.” Select the desired File System and size, and fill in the “Logical Volume Name.” Then click OK. Repeat as many times as you want. Remember to allocate your swap partition (With File System type “linuxswap”). I usually create Logical Volumes for root, /usr, /var, /home, /tmp and a few other special purpose ones. Make sure /usr has at least 5.7 GB, (at least for Neon) or else the install will fail.

When you’re done, your pane will look something like this:

Sadly, Partition Manager does not show the names of the logical volumes, but it does show the names in the graphical bar once the pending operations are applied.

Click “Apply” in the top-left corner, and click “Apply Pending Operations,” then click OK once done.

Now, close Partition Manager, as we’re done with it. Leave the Volume Group and LUKS device active.

Install the System

Start the installer by double-clicking on the “Install System” icon in the top-left corner of the screen. Click “Next” and make the appropriate configurations changes until you get to the partitioning page. Click “Manual partitioning” and click next. You will presented with this:

Double-click on the 8MB partition, click the “bios-grub” flag, and click OK.

Double-click on the 1GB partition, click the “Format” radio button, select /boot as the mount point, and click OK.

Open up the drop-down item next to “Storage device,” and select the volume group you created earlier:

That will present you with something similar to this:

Double-click on each logical volume and select “Format” and select the appropriate mount point. For example, lv_home would have a mount point of /home. The swap logical volume, of course, has no mount point.

When done, it might look like this:

Click “Next,” click OK to acknowledge the “bios-grub” partition message, fill in your user name and password information, and click “Install.”

After copying files over to the new hard drive, it will be done. When it reboots, it should prompt you for the LUKS password, and then continue booting once entered.

A word of warning: LUKS is strong encryption! If you forget your password, there’s nobody in the world (probably) that can recover that data for you.

I hope this helped! I’d love to read your feedback and experiences, so feel free to comment.

Appendix

Direct links to Calamares bugs. These have been open since 2019 and 2021, respectively.

LVM manual partitioning segfault

lvm2 pv + encryption = seg fault, core dumped


Comments

comments powered by Disqus