# find /sys/devices |egrep ‘nvme[0-9][0-9]?$’
This commands returns output similar to the following:
/sys/devices/pci0000:80/0000:80:03.0/0000:b0:00.0/0000:b1:04.0/0000:b2:00.0/misc/nvme0 /sys/devices/pci0000:80/0000:80:03.0/0000:b0:00.0/0000:b1:05.0/0000:b4:00.0/misc/nvme1
In the above listing, the PCIe addresses are highlighted in bold text.
# egrep –H ‘.*’ /sys/bus/pci/slots/*/address
This commands returns output similar to the following:
/sys/bus/pci/slots/10/address:0000:b8:00 /sys/bus/pci/slots/11/address:0000:b6:00 /sys/bus/pci/slots/12/address:0000:b2:00 (instance nvme0, pcie slot 12, drive label nvme2) /sys/bus/pci/slots/13/address:0000:b4:00 (instance nvme1, pcie slot 13, drive label nvme3)
In the above output, the bus addresses for the corresponding NVMe instances are highlighted in bold text.
If the device is a member of an LVM Volume group, then it might be necessary to move data off the device using the pvmove command, then use the vgreduce command to remove the physical volume, and (optionally) pvremove to remove the LVM metadata from the disk.
# echo 0 > /sys/bus/pci/slots/$slot/power
Where $slot is the slot number obtained in step Step 2.b above.