openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.52k stars 1.74k forks source link

ZFS root: Grub (and bpool) not needed on UEFI systems #9521

Closed heini closed 4 years ago

heini commented 4 years ago

@rlaager

Feature Request

Most distribution kernels nowadays include EFI stub support, which enables them to be booted directly by UEFI, eliminating the need for Grub and thus the bpool on UEFI systems. I've tested this on an Ubuntu system and it works.

For an example of how to use it see https://wiki.debian.org/EFIStub.

Would be nice if this could be incorporated into the various "Root on ZFS" howtos as an option for UEFI systems.

rlaager commented 4 years ago

A major goal of mine for the HOWTOs is to stay as close as possible to the distro defaults, except for the ZFS bits. This is for a couple of reasons. First off, people shouldn't have to accept radical/extraneous changes to their setup just because they want ZFS. Every change is another thing to learn how to troubleshoot, etc. Second, I want this to eventually be merged into the distro installer, which we are now seeing with Ubuntu 19.10. Eventually, if the installer gains support for other things (like encryption and other pool layouts e.g. raidz pools) the Ubuntu HOWTO should go away completely.

Additionally, while the HOWTOs don't currently support it, it has been a long-time goal of mine to eventually have some sort of beadm-like functionality, where you could choose from multiple system snapshots/clones in GRUB. Again, we finally have this in Ubuntu 19.10, so that's great! But direct EFI booting means you don't have a bootloader to allow you to pick the snapshot/clone.

I'm not interested in including that in the HOWTOs at this time. That said, just because I don't want to support it doesn't mean you or others can't. If you're interested in maintaining a fork of the HOWTO, feel free. If you want to host that elsewhere, then nothing from me or the ZoL project is required. If you would like it to be one of the official choices, then I would suggest proceeding as follows: 1) Clone the wiki repository to your local system using git. 2) Copy the existing HOWTO file (e.g. the Ubuntu 18.04 one) to a new name. 3) Edit that new file, removing all the GRUB bits, adding in the new steps required for EFI stub booting, and add some text at the top explaining the difference (and maybe linking to the stock HOWTO). 4) Once you think you have something production ready, send me the file (e.g. email rlaager@wiktel.com). I can post it for you. At some point, we can discuss wiki access permissions for you with Brian. If you keep the EFI stub HOWTO in the official wiki and keep its contents close to the stock one I maintain, I'm happy to merge changes I make to the stock one into the EFI stub one as much as possible.

heini commented 4 years ago

Hmm, what about the people - like me - who started using this back when it didn't use a bpool? Latest when upgrading their Ubuntu systems to 19.10 they will get an unbootable system, because the new /etc/grub.d/10_linux_zfs script says it wouldn't find a valid kernel and initrd.

rlaager commented 4 years ago

My advice, especially given the big changes in 19.10, would be to do a backup, full reinstall, and restore. I do all my upgrades that way anyway, but under normal circumstances that's just personal preference. In this case, you really a bpool moving forward.

rlaager commented 4 years ago

That is correct.