[zfs-discuss] Grub2 on Gentoo: ZFS root with no /boot mirror required
pendorbound at gmail.com
Mon Jul 25 16:33:55 EDT 2011
At long last (and with some helpful direction from dajhorn), I've got Gentoo booting from a ZFS mirror with no /boot MD mirror required. This is using the Grub 1.99 release along with patches ported over from Darik's Ubuntu work.
Using GPT disks, I have Grub installed to EFI utility partitions on each device and no need for MDADM at all. There are still "partitions" on each device for Grub; but since the contents of them are installed once by Grub and never edited, there's no need to put them in mirrored storage. This is in contrast to a traditional /boot partition where the kernel & initramfs are periodically updated and thus must be mirrored across all devices.
I've also moved swap onto a ZVOL instead of in mdadm which may not be the most performant of options; but if you're hitting swap, performance is probably out the window anyways. I *have* run a full Gentoo stage1 on a VM that was so-configured and assigned a too-small amount of physical RAM. The compile took ages (likely due in part to the cranked down ARC size) and was heavily into swap for most of it, but it completed successfully without any panics or other problems. Swap on ZVOL doesn't appear to cause any issues.
As far as how to do it, my Layman overlay has a patched ebuild for grub (I've called it 1.99_rc99 just to avoid invoking the Bazaar logic inherent to using -9999 version). The GentooInstall and GentooMigration documents have been updated to match.
If anyone has a few hours to burn and could test out either of those tutorials, I'd welcome feedback on them. Note that they both assume this isn't your first Gentoo install, so they'll likely need to be consumed in combination with the standard Gentoo install handbook.
The patches to both grub and the Gentoo ebuilds aren't final at this point as I had to sledgehammer a few things a bit more than I'd like. They are functional, but (for example) the man pages for Grub aren't building… I'll be trying to clean those things up a bit before I submit patches to upstream. That said, I have a number of VM's and one physical server running fine with these changes and no drama to report on any of them.
More information about the zfs-discuss