4

Is there any way to know the drive number from BDF or slot number of a PCIe or vice versa?

Suppose I have four PCIe drives attached to my system. And I know their BDF's, I want to know each of the drives corresponding drive number in OS.

Example:

  • /dev/nvme0 for BDF 68:00.0 in Linux, or;
  • /physicalDrive2 for BDF 68:0.0 in Windows.
Greenonline
  • 215
  • 2
  • 5
  • 13
kate
  • 41
  • 2

2 Answers2

1

There is a way in Linux. Try

readlink -f /sys/class/nvme/nvme*

This should show you the BDF number with associated nvme device name.

0

There is no generic method to do so, this actually depends on the physical setup of the board and the chassis and is something that you can only find in the server manuals (if they bothered documenting it, usually they don't).

It is however a stable setup so if you know the server you can create a mapping once and use that mapping for all servers of that model.

Baruch Even
  • 1,043
  • 6
  • 18