GRUB2 has long had Btrfs read only support. This is reliable. And GRUB2 has long supported LVM. The gotcha is that the on-disk format can change in seemingly innocuous ways that a non-kernel fs driver (i.e. GRUB’s fs modules are not derived from kernel fs code). But these events get caught in testing and they get fixed.
But it is true that changing anything can have knock on effects. And eliminating separate /boot
will be a puzzle. It’s an open question if all the knock on effects can be adequately addressed.
One of which, immediately, is that not all distribution kernels or GRUB core.img (which is the basis of the grub.efi OSloader) have Btrfs support. Pretty much all of them do support ext234 though.
Next difficulty, LUKS/dm-crypt for root. GRUB supports LUKS, not all instances of GRUB have it built.
If a distro GRUB or kernel lacks support for Btrfs, then that means dual-boot (distribution hopping or sharing) becomes different. And difficult. Do we care? Maybe some will care and others won’t, but it needs to be assessed.
Next difficulty, Anaconda doesn’t support configuring GRUB to support LUKS. It’s a mostly manual process to write the grub.cfg to present the interface for the user to interact with GRUB, provide the key to unlock the LUKS volume, and then for GRUB to locate and load kernel and initramfs on the encrypted volume.
Likewise if the paradigm will be to use measured boot, to unseal the LUKS key from a TPM, that’s not something Anaconda currently does.
Btrfs is getting fscrypt support. Patches are in review upstream.
fscrypt permits per directory encryption policy. So we can simply not encrypt /boot
at a directory or subvolume level. So this makes things easier. Except…
This initial implementation on Btrfs does not encrypt all metadata, just file and directory names, and file data. All the other metadata is plaintext. Since certain software installations existing can be inferred from this metadata, it’s possible some use cases will continue to call for Btrfs on dm-crypt.
Therefore it’s not certain we can ever really get rid of the idea of a separate /boot file system until we’re willing to put in the effort into the installer to configure it for encrypted boot.
Configuring the bootloader for encrypted boot has its own drawbacks in UI and UX, what sorts of burdens are placed on the user - significantly altering their workflow and troubleshooting abilities.
Another gotcha with Btrfs for /boot
is that it cannot be written to by GRUB for the successful boot test we use, to conditionally reveal the GRUB menu. By default the menu is hidden. If boot fails, it’s revealed. The way this works is GRUB in the pre-boot environment writes to a single disk block, changing a single value for a boot counter field. If boot succeeds, a user space program changes this field. This way GRUB knows if the prior boot was a success or failure and therefore whether to reveal the menu or not. Whew! OK so the problem is that GRUB is disallowed from writes to Btrfs because? This would be indistinguishable from corruption. The way GRUB writes to this single block is literally like dd
- it reads the block, modifies one byte, writes the block back into place. On Btrfs this looks like corruption because csums weren’t updated. So it’s disallowed. Which means if /boot
is on Btrfs, no more hidden GRUB menu feature.
OK, so could we move this grubenv
file from /boot
to the special bootloader region created for this exact purpose on Btrfs? Yes! But then we have to get upstream GRUB to agree to the change and that’s been years long disinterest. No one so far wants to do the work and get upstream to sign off on it. We should be able get upstream to agree by a simultaneous effort by (open)SUSE and Fedora.
So…therefore there’s inertia. As you can see one tiny change ends up having a lot of knock on effects.
At present I’m using 3 partitions: EFI/FAT, Boot/unencrypted Btrfs, and everything else/Btrfs on dm-crypt. And I’m find living without the GRUB hidden menu feature, but I’m not super comfortable taking that away from everyone else.