Grub and a btrfs /boot?

I have been trying to get grub to load the kernel from a btrfs filesystem, so far no luck. I can load from an ext4 filesystem but I thought grub should also read btrfs. I have tried adding ‘insmod btrfs’ to grub.cfg. No error, but no joy either. Am I missing something or maybe I lack understanding?

Hello @0n0w1c :wink:

My whole system is on a btrfs filesystem and it works. Grub works perfectly. Try to explain more what you have tried… :wink:

Thank you for the reply, good to at least get confirmation it should and does work.

Unfortunately, I am not in front of my test system at the moment. In a couple of hours I can give specific examples. So I am working on memory, so take it for what little this is worth.

If boot to a grub prompt and perform a “ls”, I see (hd0,gpt1) … (hd0,gpt5). So grub sees the partitions:

gpt1 = fat32
gpt2 = swap
gpt3 = ext4
gpt4 = ext4 - unused at the moment
gpt5 = btrfs with multiple subvolumes, maybe that is the issue?

If I place the kernel and initramfs in gpt1 or gpt3, it loads the kernel and boots. However, I have not yet been able to boot with the files in (hd0,gpt5):/boot

I have tried:

(hd0,gpt5)/boot/kernel.img rw root=/dev/sda5
initrd (hd0,gpt5)/boot/initramfs-linux.img

If I change the above to (hd0,gpt1) or (hd0,gpt3) it boots.

I have also tried set root=(hd0,gpt5) and insmod btrfs with part_gpt

So far, no joy with gpt5. I am hoping to be able to get rid of the need for an ext4 volume.

When using btrfs, then grub can do all the work for you, but this way you will need to point to the root subvolume , which is normally “@” (because of compatibility with timeshift). No idea if grub supports a boot subvolume.

When you mount “gpt5” directly, then grub just see the subvolumes, but you need to mount the subvolume.

However. the easiest way is just boot a live session, chroot into the btrfs subvolume and reinstall and update grub.

1 Like

I’ll bet you are correct… I will try adding @ to the path.

It was indeed the @. After I added it to the paths, bingo! Thank you

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.