I haven't had a chance to write and test the zpool.cache copying. I keep meaning to get to it every day, but pushing it back for lack of time.
The zfs-initramfs script in 16.04 (always) and in 18.04 (by default) runs a plain `zpool import`. ZoL 0.7.5 has a default search order for imports that prefers /dev/disk/by-id: https://github.com/zfsonlinux/zfs/blob/zfs-0.7.5/lib/libzfs/libzfs_import.c#L1835 That said, so did ZoL on Xenial (0.6.5.6). On my bionic test VM, non-root pools import using whatever name I created them with. If I use /dev, they import later with /dev. If I use /dev/disk/by-id, they import later with /dev/disk/by-id. This is true immediately, and true across reboots. Root pools seem to behave the same way. My root pool was created using /dev/disk/by-id per the HOWTO (which I maintain) and is being imported with /dev/disk/by-id. This is with no zpool.cache, either on the live system or in the initramfs (which I unpacked to verify). In other words, I cannot reproduce this on bionic. I'm pretty confident this is an issue on Xenial, though I haven't re-tested just now to absolutely confirm. But I will say that on my Xenial laptop at the moment, my root pool is imported with a /dev name. In short, I think this is fixed in Bionic, but I'm not 100% sure which code changed to fix it. -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to zfs-linux in Ubuntu. https://bugs.launchpad.net/bugs/1688890 Title: initramfs-zfs should support misc /dev dirs Status in zfs-linux package in Ubuntu: Confirmed Bug description: Right now 'zfs-initramfs', i.e. /usr/share/initramfs-tools/scripts/zfs does not support any other directory than /dev for "zpool import ...". Therefore even if a pool gets created from a different directory like /dev, say /dev/disk/by-id or /dev/chassis/SYS on next reboot /dev will be used and thus zpool status will show the /dev/sd* etc. on successful import. Beside that now a user does not see the original names used in "zpool create ..." the unstable names like "/dev/sd*" are shown, which is explicitly NOT recommended. The following patch introduces the "pseudo" kernel param named "zdirs" - a comma separated list of dev dirs to scan on import - which gets used by /usr/share/initramfs-tools/scripts/zfs to honor it. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1688890/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp