grub-pc, grub2 doesn't check /dev/disk/by-id or "by-path" for zfs zpool
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Wishlist
|
Unassigned |
Bug Description
When creating an Ubuntu 16.04 root install on a zfs using disks & zfs pool created using "/dev/disk/by-id" and I get to the point of running:
apt install grub-pc
I select the 4 disks I am putting into the ZFS pool to have grub installed into but grub-pc fails (see attached screen shot):
Note: first problem is that "menu" presented by grub-pc lists them as
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd
I think they should be listed as their "by-id" or "by-path" ... if you created the zfs disks and pool with that!
In my case the disks were created/partitioned using:
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
later I use this command to created the ZFS Pool of 2 mirrors each with 2 HDs using "by-id".
zpool create -o ashift=12 -O atime=off -O canmount=off -O compression=lz4 \
-O normalization=formD -O mountpoint=/ -R /mnt rpool mirror \
/dev/
/dev/
mirror /dev/disk/
/dev/
And confirm the ZFS pool is created correctly by:
zpool status
which DOES and the above shows the disks "by-id" and NOT as sda, sdb, sdc, sdd
But later in the process when running "apt install grub-pc" the disks are listed as /dev/sda, /dev/sdb etc.
The grub-pc "form" where you select where to install should probably look something like if the disks were created "by-id":
[ ] /dev/disk/
[ ] /dev/disk/
[ ] /dev/disk/
[ ] /dev/disk/
I did find a thread online where there is/was alot of discussion about this problem!
https:/
Some work-arounds were suggested but also some where discussing the root cause.
I think in 16.04 this Grub problem still exists.
My reasoning is that despite how I created the disks & the pool when I ran "apt install grub-pc" it lists the choices as /dev/sda, /dev/sdb etc.
And if I just go ahead and select those disks (I figured why not try and see what happens right?) then I get the errors shown in the attached screen shot.
This "may" be a zfsonlinux BUG but since Ubuntu is now supporting ZFS I figured I'd report it here so others encountering it know what is going on.
Lastly...
I would suggest that the current Ubuntu Documentation on this is incorrect:
https:/
The Ubuntu ZFS documentation says:
ZFS Pools
A zpool is a pool of storage made from a collection of VDEVS. One or more ZFS file systems can be created from a ZFS pool.
In the following example, a pool named "pool-test" is created from 3 physical drives:
$ sudo zpool create pool-test /dev/sdb /dev/sdc /dev/sdd
Striping is performed dynamically, so this creates a zero redundancy RAID-0 pool.
Notice: If you are managing many devices, it can be easy to confuse them, so you should probably prefer /dev/disk/by-id/ names, which often use serial numbers of drives. The examples here should not suggest that 'sd_' names are preferred. They merely make examples herein easier to read.
THE ABOVE Notice I think is inaccurate in suggesting "you should probably prefer"... from all the documentation and examples I have found including the official example for installing
Ubuntu 16.04 Root on ZFS:
https:/
Where in "2.2 Partition your disk" it says:
"Always use the long /dev/disk/by-id/* aliases with ZFS. Using the /dev/sd* device nodes
directly can cause sporadic import failures, especially on systems that have more than one storage pool."
added some updated info.