distinst icon indicating copy to clipboard operation
distinst copied to clipboard

LVM on LUKS - Installer erases externally created LVM logical volumes (+Vgroup and PV)

Open compiaffe opened this issue 7 years ago • 2 comments
trafficstars

Distribution (run cat /etc/os-release): NAME="Pop!_OS" VERSION="18.04 LTS" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Pop!_OS 18.04 LTS" VERSION_ID="18.04" HOME_URL="https://system76.com/pop" SUPPORT_URL="http://support.system76.com" BUG_REPORT_URL="https://github.com/pop-os/pop/issues" PRIVACY_POLICY_URL="https://system76.com/privacy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

Related Application and/or Package Version (run apt policy $PACKAGE NAME): Installer run from Pop!OS recovery partition

Issue/Bug Description: When re-installing Pop!OS 18.04 EFI from the recovery partition using an externally created LVM on LUKS partition setup, the installer silently deletes the LUKS partition and creates a single unencrypted ext4 partition during installation instead.

The LVM on LUKS is as such: A single LUKS partition is used as a LVM Physical Volume, it contains a Volume Group with multiple Logical Volumes inside. In the installer, the logical volumes are configured to be mounted as root, home and swap.

Steps to reproduce (if you know): Some steps might require sudo - add whenever necessary

  1. During boot hold down the SPACE bar to bring up the boot menu
  2. Select the recovery partition
  3. Once in the recovery Pop!OS close the installer
  4. Open gparted and create an unformatted partition of sufficient size for holding i.e. your root, home and swap partition. Close gparted
  5. Open a terminal
  6. Run lsblk and find the name of the partition you just created - let's assume it is called nvme0n1p3
  7. Create a LUKS partition using (replace the partition name to reflect the one above) cryptsetup luksFormat --hash=sha512 --key-size=512 --verify-passphrase /dev/nvme0n1p3
  8. Open the encrypted device and assign it a name (sda_crypt) cryptsetup luksOpen /dev/nvme0n1p3 sda_crypt
  9. Use the device as a LVM physical volume: lvm pvcreate /dev/nvme0n1p3
  10. Create a volume group: vgcreate myGroupName /dev/nvme0n1p3
  11. Create your partitions: lvcreate -n my_named_swap -L 16G myGroupName lvcreate -n my_named_root -L 100G myGroupName lvcreate -n my_named_home -l +100%FREE myGroupName
  12. Verify your partitions show up in Disks - you should see an encrypted volume and 3 mounted volumes with the names and rough sizes above
  13. Open the Pop!OS installer and click until the harddrive selection
  14. Select the nvme0 hard drive and click the custom partition button (can't remember the exact name)
  15. It takes a second to open, then unlock the nvme0n1p3 partition by clicking on it and typing in the password you used during step 7. The 3 partitions we created in step 11 should show up below.
  16. Select and assign these unlocked partitions to /root, /home and as swap by clicking on them and selecting the respective options.
  17. Select the existing boot partition (4.5GB sized or so) and mount it as boot (these already exist as we are in recovery)
  18. (Select the 500MB recovery partition and mount as custom at /recovery) - I hadn't done this - for future reference only...
  19. Go ahead with the installation until it is time to reboot. Don't do that yet.
  20. Open Disks - you will see that there is now a single unencrypted partition instead of what you saw in step 12.
  21. Reboot - You will notice that Pop!OS will boot into the OS without asking you to unlock the harddrive.
  22. Verify with Disks like in step 12 - it should be the single unencrypted partition.

Expected behaviour:

After installation (step 19) I would expect the partition scheme to be unchanged and Pop!OS to be installed. Alternatively, I would expect the installer to warn that it does not support my partition scheme.

Other Notes: Ideally, I would like to be able to do the partitioning inside the installer it self.

compiaffe avatar Aug 01 '18 07:08 compiaffe

Since I haven't heard anything:

@mmstick Are you the right person to look at this and is this the correct repo for this issue?

compiaffe avatar Aug 27 '18 10:08 compiaffe

@compiaffe I am, and yes, it is. The recovery partition support is a bit basic at the moment.

mmstick avatar Aug 27 '18 15:08 mmstick