Can shrink LVM2 PV file system in Ubuntu Server 22.04 but not in Ubuntu 22.04/23.04

Bug #2023637 reported by David Hedlund
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu
New
Undecided
Unassigned

Bug Description

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.

Tags: jammy mantic
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
description: updated
description: updated
summary: - Cannot shrink LVM2 PV file system in Ubuntu 22.04 but not in Ubuntu
- Server 22.04
+ Cannot shrink LVM2 PV file system in Ubuntu 22.04/23.10 but not in
+ Ubuntu Server 22.04
tags: added: jammy
David Hedlund (g-public)
tags: added: mantic
David Hedlund (g-public)
description: updated
Revision history for this message
David Hedlund (g-public) wrote : Re: Cannot shrink LVM2 PV file system in Ubuntu 22.04/23.04 but not in Ubuntu Server 22.04
summary: - Cannot shrink LVM2 PV file system in Ubuntu 22.04/23.10 but not in
+ Cannot shrink LVM2 PV file system in Ubuntu 22.04/23.04 but not in
Ubuntu Server 22.04
description: updated
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :

Related: GParted fails to shrink an LVM PV with lvm2 >= 2.02.171 https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/1779292

description: updated
description: updated
description: updated
David Hedlund (g-public)
description: updated
David Hedlund (g-public)
description: updated
description: updated
description: updated
David Hedlund (g-public)
description: updated
description: updated
description: updated
description: updated
description: updated
summary: - Cannot shrink LVM2 PV file system in Ubuntu 22.04/23.04 but not in
- Ubuntu Server 22.04
+ Can shrink LVM2 PV file system in Ubuntu Server 22.04 but not in Ubuntu
+ 22.04/23.04
description: updated
David Hedlund (g-public)
description: updated
David Hedlund (g-public)
description: updated
description: updated
David Hedlund (g-public)
description: updated
David Hedlund (g-public)
affects: gparted (Ubuntu) → ubuntu
David Hedlund (g-public)
description: updated
description: updated
David Hedlund (g-public)
description: updated
description: updated
David Hedlund (g-public)
description: updated
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
Revision history for this message
David Hedlund (g-public) wrote :
description: updated
description: updated
description: updated
David Hedlund (g-public)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.