Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654680 - sys-kernel/genkernel create /dev/disk/by-id entries for nvme devices
Summary: sys-kernel/genkernel create /dev/disk/by-id entries for nvme devices
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-03 04:46 UTC by Georgy Yakovlev
Modified: 2018-06-05 18:02 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
path to add nvme mdev helper (genkernel-nvme-by-id.patch.txt,3.37 KB, patch)
2018-06-05 17:43 UTC, Georgy Yakovlev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Yakovlev archtester gentoo-dev 2018-05-03 04:46:53 UTC
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
Comment 1 Georgy Yakovlev archtester gentoo-dev 2018-05-03 04:55:17 UTC
here is similar systemd issue, we can check what sysfs attributes they use to generate those entries
https://github.com/systemd/systemd/issues/1453
Comment 2 Georgy Yakovlev archtester gentoo-dev 2018-06-05 17:43:52 UTC
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
Comment 3 Larry the Git Cow gentoo-dev 2018-06-05 18:02:04 UTC
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(-)