[Bug 1590740] Re: grub-pc, grub2 doesn't check /dev/disk/by-id or "by-path" for zfs zpool
brian mullan
1590740 at bugs.launchpad.net
Thu Jun 9 11:44:31 UTC 2016
added some updated info.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub in Ubuntu.
https://bugs.launchpad.net/bugs/1590740
Title:
grub-pc, grub2 doesn't check /dev/disk/by-id or "by-path" for zfs
zpool
Status in grub package in Ubuntu:
New
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 \
/dev/disk/by-id/ata-ST2000DM001-1CH164_W1E8JLV9
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E0713E
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E084AP
sgdisk -Z -n9:-8M:0 -t9:bf07 -c9:Reserved -n2:-8M:0 -t2:ef02 -c2:GRUB -n1:0:0 -t1:bf01 -c1:ZFS \
/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E06YPY
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/disk/by-id/ata-ST2000DM001-1CH164_W1E8JLV9-part1 \
/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E0713E-part1 \
mirror /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E084AP-part1 \
/dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E06YPY-part1 -f
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/by-id/ata-ST2000DM001-1CH164_W1E8JLV9
[ ] /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E0713E
[ ] /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E084AP
[ ] /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E06YPY
I did find a thread online where there is/was alot of discussion about this problem!
https://github.com/zfsonlinux/grub/issues/5
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://wiki.ubuntu.com/Kernel/Reference/ZFS
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://github.com/zfsonlinux/zfs/wiki/Ubuntu%2016.04%20Root%20on%20ZFS
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."
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub/+bug/1590740/+subscriptions
More information about the foundations-bugs
mailing list