LVM can be enlarged for attached disk drives with Ubuntu installed[1] but they can not be shrunken:
gparted 1.3.1 (tested with Ubuntu 23.04 as host OS)[1] status:
* Attached a disk drive with Ubuntu Server 22.04 installed: CAN shrink LVM2 PV
Bug attachment references:
* Ubuntu-server_22.04-LVM-screenshot_1.png
* Ubuntu-server_22.04-LVM-screenshot_2.png
* Ubuntu-server_22.04-LVM-screenshot_3.png
* Attached a disk drive with Ubuntu 22.04 installed: Can not shrink LVM2 PV
Bug attachment references:
* Ubuntu_22.04_with_LVM-screenshot_1.png
* Ubuntu_22.04_with_LVM-screenshot_2.png
* Attached a disk drive with Ubuntu 23.04 installed: Can not shrink LVM2 PV
Bug attachment references:
* Ubuntu_23.04_with_LVM-screenshot_1.png
* Ubuntu_23.04_with_LVM-screenshot_2.png
This bug prevents people to make default partition installations of Ubuntu with LVM, and then shrink the file system, which is useful if you want to save disk image (.img) files. To circumvent the issue, one could
* Buy small SSD drives (16-32 GB), and fill them
* Or 1) perform installation on typical large SSD drives. 2) Create partition images of only the used space, to shrink the disk image size in the next step. 3) Create a disk image.
1: LVM can be enlarged:
Bug attachment references:
* Ubuntu_22.04_with_LVM (disk image restored to a much larger disk than the disk image to demonstrate that the LVM can be enlarged) -screenshot_1.png
* Ubuntu_22.04_with_LVM (disk image restored to a much larger disk than the disk image to demonstrate that the LVM can be enlarged) -screenshot_2.png
* Ubuntu_22.04_with_LVM (disk image restored to a much larger disk than the disk image to demonstrate that the LVM can be enlarged) -screenshot_3.png
* Ubuntu_22.04_with_LVM (disk image restored to a much larger disk than the disk image to demonstrate that the LVM can be enlarged) -screenshot_4.png
* Ubuntu_22.04_with_LVM (disk image restored to a much larger disk than the disk image to demonstrate that the LVM can be enlarged) -screenshot_5.png
2: Note that you'll not be able to mount the LVMs from the attached disk drives due to duplicated VG names, but that is not needed to demostrate this bug. However, ff you need to mount them, you can run Trisquel instead, that is using "vgtrisquel" as VG name. Or vote for "Add unique VG name to avoid activating multiple VGs with the same name from multiple disk" - https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/2023970 that I submitted.
Related: GParted fails to shrink an LVM PV with lvm2 >= 2.02.171 https:/ /bugs.launchpad .net/ubuntu/ +source/ gparted/ +bug/1779292