support root pools on EFI/GPT partitioned disks
With the change for #5560 our grub can use EFI/GPT partitioned disks, so there is no reason why we shouldn't allow root pools to use that partitioning. In particular that allows root pools to use whole disk vdevs and large disks (>2TB).
This needs the following changes in our tools and libraries:
- installgrub(1M) needs to learn about EFI/GPT disk labels. Two things need to change: we need to find a suitable place to store grub stage2, and we must not set the SMI slice number in stage2 as that doesn't exist in this case.
In fdisk-partitioned disks stage2 is stored in the boot slice (first cylinder of the illumos fdisk partition), but there is no such thing on EFI labeled disks. As it happens ZFS has a 3.5MB reserved-for-future-use space just following the first two vdev labels, which according to the on-disk format description is even intended for boot loaders. Therefore this is the perfect spot to store stage2, which in turn means that installgrub(1M) needs to check that the filesystem in use is really ZFS.
- libbe needs to installgrub(1M) with the -m -f flags for vdevs in EFI/GPT partitions. It is necessary to install grub stage1 in the MBR of the disk as a standard MBR would not be able to load it from a EFI/GPT partition. To reduce the risk of overwriting other boot loaders we do not do that if any partition is found that has a GUID not used by illumos.
- bootadm(1M) needs to be changed to write the grub findroot command without the specification of a slice letter into menu.lst for vdevs in EFI/GPT partitions.
- libgrubmgmt needs to accept the new findroot format.
- ZFS and libzfs/zpool need all checks removed that prevent root pool functionality when vdevs in EFI/GPT partitions exist. (see #5125 and #5120)
Updated by Electric Monk about 6 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 1a902ef8628b0dffd6df5442354ab59bb8530962 Author: Hans Rosenfeld <email@example.com> Date: 2015-02-20T23:00:32.000Z 5561 support root pools on EFI/GPT partitioned disks 5125 update zpool/libzfs to manage bootable whole disk pools (EFI/GPT labeled disks) Reviewed by: Jean McCormack <firstname.lastname@example.org> Reviewed by: Josef 'Jeff' Sipek <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>