RR 关于NVME硬盘

通过 ls -ld /sys/block/nvme* 可以查看 nvme 的 PCI 路径,一般会有以下2种结果,

# pci0000 和 nvme 之间只有一层,这种适用于所有 DT 的型号. 
# 每个控制只可识别一个磁盘, 即 nvme0 下 只识别 nvme0n1
# DT 型号至多识别 15 个 nvme 磁盘
root@test:~# ls -ld /sys/block/nvme*
lrwxrwxrwx 1 root root 0 May 14 07:14 /sys/block/nvme0n1 -> ../devices/pci0000:00/0000:00:03.0/nvme/nvme0/nvme0n1
lrwxrwxrwx 1 root root 0 May 14 07:14 /sys/block/nvme1n1 -> ../devices/pci0000:00/0000:00:04.0/nvme/nvme1/nvme1n1

# pci0000 和 nvme 之间有多个层,这种适用于 DS918+ RS1619xs+ DS419+ DS1019+ DS719+ DS1621xs+ 型号.
# 每个控制只可识别一个磁盘, 即 nvme0 下 只识别 nvme0n1
# 这几个型号至多识别 2 个 nvme  磁盘
root@test:~# ls -ld /sys/block/nvme*
lrwxrwxrwx 1 root root 0 May 14 20:37 /sys/block/nvme0n1 -> ../devices/pci0000:00/0000:00:16.0/0000:0b:00.0/nvme/nvme0/nvme0n1
lrwxrwxrwx 1 root root 0 May 14 20:37 /sys/block/nvme1n1 -> ../devices/pci0000:00/0000:00:17.0/0000:13:00.0/nvme/nvme1/nvme1n1

# 如果 不是 pci0000,则所有型号均不可见,
root@test:~# ls -ld /sys/block/nvme*
lrwxrwxrwx 1 root root 0 May 14 07:14 /sys/block/nvme0n1 -> ../devices/pci0001:00/0000:00:03.0/nvme/nvme0/nvme0n1
lrwxrwxrwx 1 root root 0 May 14 07:14 /sys/block/nvme1n1 -> ../devices/pci0001:00/0000:00:04.0/nvme/nvme1/nvme1n1