Opened 8 weeks ago

Last modified 7 weeks ago

#1837 new enhancement

Add NVMe "by-id" symlinks to "-d by-id" device scanning

Reported by: Rypi Owned by:
Priority: minor Milestone: undecided
Component: all Version:
Keywords: nvme linux Cc:

Description (last modified by Rypi)

Symlinks from /dev/disk/by-id works well in smartd and smartctl for SATA drives (/dev/sdX), but not for NVME devices. It would be useful if the same behavior could be used for all drives.

Related: ticket #1390, changeset 4847

root@nas:~# smartctl -d by-id --scan
/dev/disk/by-id/ata-ST4000NE001-3CR101_WX10EGSJ -d scsi # /dev/disk/by-id/ata-ST4000NE001-3CR101_WX10EGSJ, SCSI device
/dev/nvme0 -d nvme # /dev/nvme0, NVMe device
root@nas:~# ls -l /dev/nvme*
crw------- 1 root root 241,   0 čen  1 15:19 /dev/nvme0
brw-rw---- 1 root disk 259,   0 čen  1 15:19 /dev/nvme0n1
brw-rw---- 1 root disk 259,   2 čen  1 15:19 /dev/nvme0n1p1
brw-rw---- 1 root disk 259,   3 čen  1 15:19 /dev/nvme0n1p2
brw-rw---- 1 root disk 259,   4 čen  1 15:19 /dev/nvme0n1p3
root@nas:~# ls -l /dev/disk/by-id/nvme*
lrwxrwxrwx 1 root root 13 čen  1 15:19 /dev/disk/by-id/nvme-TS1TMTE220S_G514071565 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 čen  1 15:19 /dev/disk/by-id/nvme-TS1TMTE220S_G514071565-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 čen  1 15:19 /dev/disk/by-id/nvme-TS1TMTE220S_G514071565-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 čen  1 15:19 /dev/disk/by-id/nvme-TS1TMTE220S_G514071565-part3 -> ../../nvme0n1p3

Change History (4)

comment:1 by Christian Franke, 7 weeks ago

Keywords: nvme linux added
Milestone: undecided

Symblinks from /dev/disk/by-id works well in smartd and smartctl for SATA drives (/dev/sdX), but not for NVME.

Using such symlinks should also work for NVMe, please try:
smartctl -x /dev/disk/by-id/nvme-TS1TMTE220S_G514071565

Do you possibly mean this instead:
NVMe '"by-id" symlinks should appear in device scan output if -d by-id is specified ?

If yes, please note that this has been omitted intentionally because such symlinks never point to a /dev/nvme[0-9] node. Using the "by-id" symlinks which point to /dev/nvme[0-9]n[1-9] may result in monitoring the same device multiple times. This only makes sense for devices which support namespace specific Smart/Health Information.

Some duplicate detection heuristics would be required. Thanks for any suggestion?

comment:2 by Rypi, 7 weeks ago

Description: modified (diff)

comment:3 by Rypi, 7 weeks ago

Yes, I meant symlinks in device scan output, so I can for example ignore one specific drive using /dev/disk/by-id/nvme* symlink.

I have no idea about NVMe namespaces and it does not apply to my drives, so I'm unable to suggest any solution here.

Last edited 7 weeks ago by Rypi (previous) (diff)

comment:4 by Christian Franke, 7 weeks ago

Summary: Allow usage of "by-id" symbolic links for nvme devicesAdd NVMe "by-id" symlinks to "-d by-id" device scanning

Adjust summary accordingly.

Note: See TracTickets for help on using tickets.