Skip to content

Commit 427a28e

Browse files
minggrpoettering
authored andcommitted
rules: add NVMe rules (systemd#3136)
Add NVMe rules using the "wwid" attribute. root@target:~# cat /sys/block/nvme0n1/wwid eui.3825004235000591 root@target:~# ls /dev/disk/by-id/ -l |grep nvme lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1 lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1 lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2
1 parent 3650073 commit 427a28e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rules/60-persistent-storage.rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ TEST=="whole_disk", GOTO="persistent_storage_end"
1414
# for partitions import parent information
1515
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
1616

17+
# NVMe
18+
KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"
19+
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"
20+
1721
# virtio-blk
1822
KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
1923
KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"

0 commit comments

Comments
 (0)