Cannot move partitions to create free space

Fedora update showed it cannot update system

installing package kernel-core-6.9.5-200.fc40.x86_64 needs 6MB more space on the /boot filesystem

installing package kernel-core-6.9.5-200.fc40.x86_64 needs 6MB more space on the /boot filesystem

installing package kernel-core-6.9.5-200.fc40.x86_64 needs 6MB more space on the /boot filesystem

/home btrfs (Fedora) partition has plenty of space.
So, I freed some at the end in order to move it to the back and free space to allow /boot to be expanded.
But neither of the latter can be done.


A couple of things:

  • You can’t move partitions that are mounted
  • You can only expand partitions to the right

If neither of those are your issue, please share some additional details about what exactly you are seeing.

2 Likes

I uploaded a GParted image.

Are you trying to make the changes from within your install? I don’t think you can move a partition you are actually using. Some filesystems allow online resizing but moving a partition usually requires you to boot off something else.

1 Like

Yes, from within.
I actually did it first from my user.
Then as root.
So, would I need to create a bootable USB with GParted?

Yes. Using a live CD for a Linux distro is one easy way.

1 Like

OK.
Following would I have to unmount the two partitions I want to work?
Unmount them, handle them and then mount them again?

It would be useful to check what takes up all the space in /boot.
Running

sudo du -ah /boot

might give the answer.

1 Like

Just for future reference, I cannot ever recommend using the GParted move partition option. Specifically when it moves the start of the partition rather than the end.

File system resize from the end of the partition is very safe and straightforward with Btrfs. Grow or shrink, this is done while the file system is mounted, all the code to do it is in the linux btrfs kernel driver.

But file system move, by changing the start of the partition is super risky. Every single block in the partition must be relocated. I am not aware that this is fail safe in case of a crash or a power failure because it would require some decently complex journaling somewhere else (some other drive or partition) to constantly track the progress, and this journaling mechanism would itself have to be crash and fail safe.

Anyway, with Btrfs this is rarely needed anyway. If you have a bunch of free space at lower LBA’s (i.e. before the Btrfs partition rather than after it), then you just make that free space its own partition, and then use btrfs device add to add that partition to the existing Btrfs file system. It’s similar to the concept of multiple PV’s in an VG yet you still have one LV with your file system on it - for those who grok LVM.

Btrfs and your drive do not care about having multiple partitions in a single Btrfs device. If all the used space can still fit on the original partition, you can remove the 2nd partition anytime. While testing, I inadvertently discovered I’d been running Fedora on a 2x partition Btrfs for nearly a year. There’s no real downside other than you might forget about it!

1 Like