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.
1
  • Take a look at... ls -l /sys/block/nvme0 which ought to tell you something interesting. Sep 24 '15 at 1:06
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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.