lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 243M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 74.3G 0 part
├─MediaServer-root 253:0 0 58.4G 0 lvm /
└─MediaServer-swap_1 253:1 0 15.9G 0 lvm
disk was a 80G disk (when 14.04 was installed) and I moved to a 500G disk some time in 2018.
uname -r
5.4.0-215-generic
uname -a
Linux xxx 5.4.0-215-generic #235-Ubuntu SMP Fri Apr 11 21:55:32 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Problem:
I need to increase the size of my /boot as I cannot upgrade. I want to make this 5G.
What is the best way of doing this?
Create a new lvm partition after sda5 and copy the lvm to new lvm (cmd line) and then extend sda1 (gpart) ?
Simple create/copy new lvm/remove old lvm (any additional requirements?), remove sda5 and extend sda1? What about Grub?
And yes backup 1st. (Clonezilla - which I’m familiar with) step by step instructions would be good - thanks
Create a new PV sda6 big enough to contain all the current LVs in the VG, and add this new PV to the VG. Then use pvmove sda5 to move the LVs from PV sda5 to PV sda6. pvscan should now show PV sda5 is unused. After that, you can use vgreduce to remove unused PV sda5 out of the VG. Once removed, you can remove partition sda5, creating unallocated space where it was.
It appears you also have a tiny partition sda2 blocking expansion of the boot partition. It must be deleted or moved as well.
Is sda2 a bios_grub partition? It is unformatted space so not normally shown correctly in many partition tools and not backed up.
If so deleting it will break boot as it has part of grub.
But if you have a live installer, you can delete it & create a new one after expanding boot, so you can reinstall grub.
With MSDOS partitioning, those operations outlined in post #3 should still work for the lvm operations, but are not a solution. sda2 is not what it appears to be in lsblk output, so you cannot simply delete it. sda2 really is 465.5 GB in size, not the 1 KB shown by lsblk and sda5 really is not physically after sda2 - it’s part of it. That’s why you must not delete it. Look at the start and end sector numbers of sda2 and sda5.
Another idea:
Maybe gparted can shrink sda2 since there is a big block of unused sectors following the end of sda5. Then gparted might allow you move sda2 to the right giving you the space you want. You can fire up gparted, and see if this is within its powers. I don’t know. It looks risky, so back up what’s important.
If you have to start over with a new install, partition your disk as GPT, not msdos.
Then you’ll need to extend the volume group with some space. Then add it to the root logical volume.
Alternatively, you can uninstall old unused kernels to free space up. What is the output of: uname -a; echo; dpkg -l | grep linux-image | grep -v head
Thanks
Preformatted text$ uname -a; echo; dpkg -l | grep linux-image | grep -v head
Linux MediaServer 5.4.0-215-generic #235-Ubuntu SMP Fri Apr 11 21:55:32 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
rc linux-image-4.15.0-200-generic 4.15.0-200.211 amd64 Signed kernel image generic
rc linux-image-5.4.0-149-generic 5.4.0-149.166 amd64 Signed kernel image generic
ii linux-image-5.4.0-200-generic 5.4.0-200.220 amd64 Signed kernel image generic
ii linux-image-5.4.0-215-generic 5.4.0-215.235 amd64 Signed kernel image generic
rc linux-image-extra-4.4.0-124-generic 4.4.0-124.148 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-generic 5.4.0.215.208 amd64 Generic Linux kernel image
as can be seen the problem is the size of /boot which is 243M (outside of the lvm) , to upgrade more is required, with the lvm and ext partition looks like not as easy thing to achieve, (?!)
should remove one. Then your system should be upgradable.
As to increasing that boot partiton to 5 GB, try reducing sda2 by at least that amount, and then move it over with gparted to make space to enlarge sda1.
The rc lines are uninstalled packages but have lingering config. You can run:
sudo dpkg -P packagename
With the lines that start with ‘rc’ to clean up. I tried to give a one liner but this text editing system has a thing about backticks so I went with an explanation. Sorry