I have a machine where due to its history the grub partition sits between two large ext4 partitions, all seen in the picture below. I would like to merge the two partitions which currently sandwich the grub partition (as seen below, one of them is already empty and ready to be re-claimed). So that I'll effectively have one big continuous ext4 partition.
How would I most elegantly and safely move the grub partition and merge the two large partitions which currently surround it?
I found that GParted doesn't offer a way to move the grub partition, at least not when the system is live, and later I found that using GParted from a live USB stick won't allow moving the grub partition either, even though there is a very large unallocated partition (see in the picture again). So I am wondering how to safely and possibly also simply accomplish this in order to better utilize my drive.
Some additional technical details which hopefully do not matter
In case this ties in, this machine should always boot from one partition, all other detectable OS partitions other than its /dev/sda5
are either invalid or completely obsolete. I'd like to move the grub2 partition so that I then can make /dev/sda5
, my only boot partition, larger.
And in case it matters, /dev/sda2
is still shown as a boot option in my grub menu even though I've already un-allocated that partition altogether (it's that empty partition right before the grub2 partition in the picture).
Thanks!!
Boot from a live USB disk. Using gparted you should then be able to simply move the grub partition. Just make sure the disk isn't mounted. And of course: Make sure you have a backup before doing that.