Installing Seven Linux OS As Multi-Boot – Troubleshooting 1: How to resize disk or partition on which Ubuntu is installed with Terminal even though live Ubuntu installer does not provide this option?

“Do not trouble trouble, unless trouble troubles you, because if you trouble trouble, trouble will surely trouble you” — Proverb, Tongue Twister

The current Ubuntu version 24 LTS, does not allow installation with another Linux OS, when LUKS disk encryption is used. The Ubuntu versions upto 22 LTS, and Ubuntu based laterst LinuxMint version 22 LTS, all allow for installation with another Linux OS, when LUKS disk encryption is used by allowing user to create a ‘free space’ along with LUKS encrypted partition in Manual or ‘Something Else’ installer option. For detail about how this is done please refer to LinuxMint installation as primary system [ref 1]. Thus, for users interested in installation of Ubuntu 24 LTS or higher versions, with LUKS disk encryption, their only option is to install it as a solo system on the whole disk, which is not advisable as a multiboot system is more robust to cyberattacks as if one boot fails, another OS can boot in a multiboot system and using Terminal/Commandline tools, namely ‘chroot’, ‘grub-install’, ‘update-grub’ and ‘efibootmgr’, one linux OS in a computer can repair boot issues of another linux OS on the computer. In other words, multiple linux OS in a multiboot system, not only provide alternate boot options but can repair each others boot issues creating a symbiotic ergo sustainable relationship. Ubuntu is an advanced and user friendly linux OS and if only it could be booted with along linux OS, while still being LUKS encrypted it could be used as a primary linux OS in a multiboot system, similar to how LinuxMint is used as a primary linux OS in a multiboot computer [ref 1]. To achieve this goal presently, a code is shared that can be typed on Terminal to shrink LUKS disk or partition where Ubuntu 24 LTS was installed on full disk using ‘Erase’ disk option. This code is developed with help of Ubuntu’s manpages recommendations and solution provided by Michael Kropat on askubuntu.com [ref 2, ref 3]. After shrinking, the free space generated may be used to create a multiboot linux OS computer system where Ubuntu is used as a primary system instead of LinuxMint as discussed before [ref 1].

Reducing LVM-LUKS Disk Size: Description Of Code

  1. Please backup your data on the disk (here /dev/sdc) before using the following protocol as mistakes can potentially result in data loss.
  2. First, list all block devices on your system with lsblk. Look for the device name of your target disk.
  3. Open the LUKS container using sudo cryptsetup luksOpen /dev/sdc3 devluksopen. Replace “/dev/sdc3” with the actual device name of your target disk.
  4. List all logical volumes (LV) on your system with sudo lvs. Look for the volume group and logical volume names associated with your LUKS container.
  5. List all physical volumes (PV) on your system with sudo pvs. Look for the PV that is associated with the LV of your LUKS container.
  6. Reduce the size of the LV by 100GB using sudo lvreduce -r -L -100G ubuntu-vg/ubuntu-lv. Replace “ubuntu-vg” and “ubuntu-lv” with your actual volume group and logical volume names. This reduces size by 100GB for a disk that has atleast 100GB free space i.e. if you boot Ubuntu and find the disk has less than 100GB free space, then ‘lvreduce’ cannot reduce the disk by 100GB to create free space.
  7. List all LV again to confirm the reduction in size.
  8. Close the LUKS container using sudo cryptsetup luksClose devluksopen.
  9. Exit the terminal.
#Reducing Linux OS installation target LVM-LUKS disk size
lsblk
sudo cryptsetup luksOpen /dev/sdc3 devluksopen
sudo lvs
sudo pvs
sudo lvreduce -r -L -100G ubuntu-vg/ubuntu-lv
sudo lvs
sudo cryptsetup luksClose devluksopen
exit

Increasing LVM-LUKS Disk Size: Description Of Code

  1. Please backup your data on the disk (here /dev/sdc) before using the following protocol as mistakes can potentially result in data loss.
  2. First, list all block devices on your system with lsblk -f. Look for the device name of your target disk.
  3. Open a new LUKS container using sudo cryptsetup luksOpen /dev/sdc3 devluksopen. Replace “/dev/sdc3” with the actual device name of your target disk.
  4. Change to the directory /dev/mapper and list all LVs using ls. Look for the LV associated with your new LUKS container.
  5. List all PVs on your system with sudo pvs. Look for the PV that is associated with the LV of your new LUKS container.
  6. List all block devices again to confirm the size increase.
  7. Resize the LV by adding 100GB using sudo lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv. Replace “ubuntu–vg” and “ubuntu–lv” with your actual volume group and logical volume names.
  8. Run the e2fsck -fy command to check for any errors on the filesystem.
  9. Resize the filesystem using sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv.
  10. Close the LUKS container using sudo cryptsetup luksClose devluksopen. Here if you get message, ‘Disk busy’, just power-off computer and you can remove disk.
  11. Exit the terminal.
lsblk -f
sudo cryptsetup luksOpen /dev/sdc3 devluksopen
cd /dev/mapper
ls
sudo lvs
sudo pvs
lsblk -f
sudo cryptsetup resize devluksopen
sudo pvresize /dev/mapper/devluksopen
sudo lvresize -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo e2fsck -fy /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
sudo cryptsetup luksClose devluksopen
cd
exit

References

ref 1: https://fairwissenschaft.eu/2026/03/installing-seven-linuxos-as-multi-boot/

ref 2: https://manpages.ubuntu.com/manpages/noble/en/man8/lvreduce.8.html

ref 3: https://askubuntu.com/questions/124465/how-do-i-shrink-the-root-logical-volume-lv-on-lvm