lvextend -l 100%FREE isn't working
I had an old, small SSD, so I bought a new, bigger one. Ubuntu 20.04 LTS, LUKS.
With CloneZilla, I cloned it to an IMG file from the old SSD, then restored the IMG file to the new SSD.
Question: Everything is ok, only strange that the "lvextend -l 100%FREE" isn’t working, while the "lvextend -L +4.59G" works for the same LV! What? 100%FREE should extend it to max, why do I have to manually set the +GBytes to make lvextend work?
And why is there a "<" sign at the size of the VSize?
strange that the "lvextend -l 100%FREE" isn’t working
Without the +
the 100%FREE
is interpreted as absolute size. Which works if you have more free space than the current size of the volume, but it’s probably not what you intended to do.
In your case, it seems you have 1176 extents
free while the current size of the volume is 236731 extents
so naturally, it fails. If you had 236773 extents
free, the command would have worked, but the volume size would only have grown by 42 extents…
So, the +
sign is very important here.
And why is there a "<" sign at the size of the VSize?
It indicates that the value has been rounded, see also manpage on --units
.
we need to extended the Logical volume as follows:
sudo lvm lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
Your LVM Disk has now been successfully extended. One last command is needed so that the “df -h” output shows the correct size of your file system:
sudo resize2fs -p /dev/mapper/ubuntu--vg-ubuntu--lv