there is a helper mdev/helpers/storage-device, that creates /dev/disk/by-id symlinks for sd and vd devices it should also create similar symlinks for /dev/nvmeXnX devices Reproducible: Always Steps to Reproduce: 1. have nvme device 2. reference root=/dev/disk/by-id/nvmestring or use zfs with by-id devices 3. try booting Actual Results: initrd fails to find root device Expected Results: initrd finds root device referenced by-id and boots
here is similar systemd issue, we can check what sysfs attributes they use to generate those entries https://github.com/systemd/systemd/issues/1453
Created attachment 534982 [details, diff] path to add nvme mdev helper Here is proposed patch to address this. Up to date branch with the fix is available here, in case patch will get outdated. https://github.com/gyakovlev/genkernel/tree/nvme-by-id
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=84b25046315593897e9a57b73b2e80410b5be35a commit 84b25046315593897e9a57b73b2e80410b5be35a Author: Georgy Yakovlev <ya@sysdump.net> AuthorDate: 2018-06-05 01:00:32 +0000 Commit: Robin H. Johnson <robbat2@gentoo.org> CommitDate: 2018-06-05 18:01:24 +0000 Add mdev nvme handler for by-id synlinks Creates required entries in /dev/disk/by-id for nvme drives and partitions. This is mainly needed by zfs nvme rootfs, because upstream recommends using by-id to import pools. System fails to boot If genkernel uses zpool cache which has by-id entries and there are no symlinks in /dev/disk/by-id Here is an example how it looks with 2 nvme drives nvme-eui.0123456789876543 -> ../../nvme0n1 nvme-eui.0123456789876543-part1 -> ../../nvme0n1p1 nvme-eui.0123456789876543-part2 -> ../../nvme0n1p2 nvme-eui.0123456789876543 -> ../../nvme1n1 nvme-eui.0123456789876543-part1 -> ../../nvme1n1p1 nvme-eui.0123456789876543-part2 -> ../../nvme1n1p2 nvme-Samsung_SSD_960_PRO_512GB_SN0123456789876 -> ../../nvme0n1 nvme-Samsung_SSD_960_PRO_512GB_SN0123456789876-part1 -> ../../nvme0n1p1 nvme-Samsung_SSD_960_PRO_512GB_SN0123456789876-part2 -> ../../nvme0n1p2 nvme-Samsung_SSD_960_PRO_512GB_SB9876543210123 -> ../../nvme1n1 nvme-Samsung_SSD_960_PRO_512GB_SB9876543210123-part1 -> ../../nvme1n1p1 nvme-Samsung_SSD_960_PRO_512GB_SB9876543210123-part2 -> ../../nvme1n1p2 Closes: https://bugs.gentoo.org/654680 Signed-off-by: Georgy Yakovlev <ya@sysdump.net> (cherry picked from commit e21fec6b87ca2ada59728f7db6961bf97ee22fff) Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> gen_initramfs.sh | 1 + mdev/helpers/nvme | 21 +++++++++++++++++++++ mdev/mdev.conf | 7 ++++--- 3 files changed, 26 insertions(+), 3 deletions(-)