You are not logged in.

#1 2021-07-11 09:37:37

karcher
Member
Registered: 2018-01-09
Posts: 140

How to setup ESP and /boot in BTRFS RAID 1?

Hi all,

I'm trying to setup BTRFS RAID 1 with GPT for the first time. The idea is to use snapper for snapshots and something like snap-pac-grub for GRUB, but it's not clear to me how to setup ESP and /boot. In a resource I have seen that ESP is mounted as /boot (FAT32) and then a hook is being used as described in the Arch wiki:

Backup non-Btrfs boot partition on pacman transactions

If your /boot partition is on a non Btrfs filesystem (e.g. an ESP) you are not able to do snapper backups with it. You can copy the boot partition automatically on a kernel update to your Btrfs root with a hook. This also plays nice together with snap-pac.


On the other hand I would like to use the BTRFS partitioning scheme that OpenSUSE uses as described here:
Creating openSUSE-style btrfs root partition & subvolumes

Here the boot is on BTRFS and there are 2 boot subvolumes boot/grub2/x86_64-efi and boot/grub2/i386-pc.

So If I understand correctly in the first case GRUB will be installed on the FAT32 partition in the beginning of the disk and in the second case somewhere in the BTRFS RAID. Will it work in both cases? Shouldn't GRUB reside in the beginning of the disk? What's the best way of setting ESP and /boot up to have GRUB snapshots?


EDIT
--------------
Just found this post: EFI partition vs /boot partition

An answer:

The EFI System Partition is the partition the EFI firmware (in ROM on the motherboard) knows of and from which the firmware can load EFI applications like boot loaders. So the ESP is the place where you put GRUB2 for the firmware to load and run. The /boot directory/partition is the place for GRUB to find files it needs, like you said. However, there is no reason the ESP and /boot can't be the same partition.

and in the comments:

Unless you are running Debian, which has a policy that /boot cannot be a FAT32 file system (which the ESP must be), because FAT32 does not support symlinks.

What is meant by "The /boot directory/partition is the place for GRUB to find files it needs". What kind of files? How can tell GRUB where it can find these files?
Assuming I want to install other distros including Debian and multiboot, how do setup ESP and /boot then?

Last edited by karcher (2021-07-11 11:01:21)

Offline

Board footer

Powered by FluxBB