I am getting tired of cleaning /boot in order to free up enough space every time a new kernel is released. I have been following the instructions below to shrink /dev/ubuntu-vg to free up space to increase the size of /boot.
How can I resize an LVM partition? (i.e: physical volume)
Running sudo pvs -v --segments /dev/sda5
yields:
PV VG Fmt Attr PSize PFree Start SSize LV Start Type PE Ranges
/dev/sda5 ubuntu-vg lvm2 a-- 111.55g 8.55g 0 26368 root 0 linear /dev/sda5:0-26367
/dev/sda5 ubuntu-vg lvm2 a-- 111.55g 8.55g 26368 2188 0 free
Everything appears to work until I get to:
sudo pvmove --alloc anywhere /dev/sda5:yyyy-end
I would like to free up ~500 MB to add to /boot
. (I deleted my swap partition when I ran into issues thinking it would provide more memory to enable the move (which I plan to add back later)). Since the higher memory address are all free (right hand side is empty), I attempted to increase the size of /dev/sda1
(i.e., ext2 /root). However, GParted, KDE Partition Manager, nor Logical Volume Management will allow me to do so (cannot specify larger size).
Questions:
If
/dev/sda1
(/boot
) is listed first and Ubuntu-vg (/dev/sda2
, i.e.,/root
) is listed second, does the free space need to be on the left or right hand side of Ubuntu-vg to permit/dev/sda1
(/boot
) to be extended? I.e., since all the unused space is already on the right hand side, why can't I simply extend/dev/sda1
(/boot
)?Does ubuntu-vg need to be resized to not include the unused space?
In my case, Ubuntu-vg has unused space on the right hand side. Do I need to shrink Ubuntu-vg so that “Unused Space” is not included in Ubuntu-vg?
If the free space must be on the left side (rather than right), since I only have one data volume remaining (
/dev/sda5:0-26367
), I would expect to be able to move it anywhere within the volume. I have tried various versions ofsudo pvmove -v --alloc anywhere
, but keep getting “Insufficient free space: aaa extents needed, but only bbb available”.E.g.,
sudo pvmove -v --alloc anywhere /dev/sda5:0+26368 /dev/sda5:128+26368
Why am I getting “insufficient space” when I am just shifting a range of memory to another range of available memory?