1

Topic: Can't shrink an LVM PV

I am trying to shrink an LVM PV but it will not work.
===
GParted 0.19.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2

Shrink /dev/sda3 from 930.77 GiB to 770.77 GiB  00:00:01    ( ERROR )
       
calibrate /dev/sda3  00:00:00    ( SUCCESS )
       
path: /dev/sda3
start: 1550336
end: 1953523711
size: 1951973376 (930.77 GiB)
check file system on /dev/sda3 for errors and (if possible) fix them  00:00:01    ( SUCCESS )
       
lvm pvck -v /dev/sda3
       
Found label on /dev/sda3, sector 1, type=LVM2 001
Found text metadata area: offset=4096, size=1044480
DEGRADED MODE. Incomplete RAID LVs will be processed.
Scanning /dev/sda3
Found LVM2 metadata record at offset=11264, size=1536, offset2=0 size2=0
Found LVM2 metadata record at offset=9728, size=1536, offset2=0 size2=0
shrink file system  00:00:00    ( ERROR )
       
lvm pvresize -v --setphysicalvolumesize 808214528K /dev/sda3
       
0 physical volume(s) resized / 1 physical volume(s) not resized
DEGRADED MODE. Incomplete RAID LVs will be processed.
Using physical volume(s) on command line
Archiving volume group "xubuntu-vg" metadata (seqno 7).
/dev/sda3: Pretending size is 1616429056 not 1951971328 sectors.
Resizing volume "/dev/sda3" to 1951971328 sectors.
Resizing physical volume /dev/sda3 from 0 to 197317 extents.
/dev/sda3: cannot resize to 197317 extents as later ones are allocated.
========================================

2

Re: Can't shrink an LVM PV

In the log file I see the following line:

DEGRADED MODE. Incomplete RAID LVs will be processed.

This leads me to believe that something is not right with the setup.

Do you have RAID in addition to LVM?

I recommend investigating why LVM is reporting DEGRADED MODE and resolving the issue before trying to resize the LVM PV.

You might try the following commands to learn more:

sudo vgscan
sudo vgdisplay -v