Boot partition on Btrfs subvolume in Silverblue

I’ve been wanting to move /boot onto a Btrfs subvolume for fun and profit (?) for a long time…
And since I’ve done it, finally, I want to share my experience and leave note to myself.

/boot on a Btrfs subvolume is not a big deal, but there is one important distinction with ostree:
When writing a BLS entry, ostree ‘hardcodes’ path to initramfs and kernel image to be absolute (i.e. /ostree/<bootcsumdir>/<kernel_name>) on what it this is a boot partition.

And so, it is not enough to just change the path to a grub config file to include a name of your subvolume - you also have to make the subvolume a root (/) for grub.
This is achievable with few RH-specific patches for GRUB that introduce btrfs_subvol and btrfs_relative_path.

set btrfs_subvol=/boot
set btrfs_relative_path=y

is what you have to include in your grub.cfg residing on EFI system partition.

Please note that there are drawbacks to having /boot on Btrfs, one of them is that grubenv will not get updated.
I am also not posting any instruction, since doing this involves quite a bit of risk.

Any feedback or comments is welcome of course!

1 Like