In Linux, is there a way to find out which PCI card is plugged into which PCI slot?

magmabyte picture magmabyte · Sep 18, 2014 · Viewed 50.9k times · Source

In Linux, is there a way to find out which PCI card is plugged into which PCI slot?

/sys/bus/pci/devices/ contains many devices (bridges, CPU channels, etc.) that are not cards and I was not able to find any information about slot-card mappings in the device directories.

Answer

Nebojsa Susic picture Nebojsa Susic · Sep 18, 2014

You can use

dmidecode –t slot

to find all available pci slots than you can run

lspci -s <slot number>

command to list device connected to specified slot. You must take bus address from first command and use this address as parameter in second command.