/dev/disk/by-id isn't the only answer. Other people use other things, at
least in some cases. And I don't think that using /dev/disk/by-id as a
hard-coded default is acceptable. I'm pretty sure it's possible (though
rare) to have drives that show up in /dev, but not /dev/disk/by-id.

Richard Yao (ryao), from upstream, pointed me to his code in Gentoo:
https://gitweb.gentoo.org/proj/genkernel.git/commit/?h=zfs&id=69d703093a5a6560988d077e57ddf69303d08906

The technique there is to copy the zpool.cache file out of the pool at
boot-time. An alternative would be to specify that /etc/zfs/zpool.cache
should be copied into the initramfs at build-time, but then it wouldn't
be regularly updated (e.g. if a disk is swapped).

I ported ryao's approach into the Ubuntu init script (patch attached for
/usr/share/initramfs-tools/scripts/zfs). Coincidentally, we're already
doing a read-only import anyway, but only if the rootdelay feature is
being used. It's pretty straightforward to always try a read-only
import.

I'm not sure that this patch should be accepted and shipped, though.
Upstream seems to be generally deprecating the cache file. I feel like
the correct answer is that `zpool import` should Just Work. The upstream
bug 3043 seems to agree; it talks of a search path. I think the issue
here is that the search path isn't work. If upstream fixes that, no
changes are necessary in Ubuntu, and we get as close as possible to
perfection, and it would be regression free (as it falls back to /dev if
/dev/disk/by-id didn't work).

** Patch added: "A patch (but note the design question here)."
   
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1571241/+attachment/4639642/+files/zfs-honor-cachefile.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1571241

Title:
  ZFS initrd script does not import zpool using /dev/disk/by-id device
  paths

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1571241/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to