Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a mapping from the /dev major minor device number to the output of lspci (domain:bus:slot number)? I would like to determine the closest CPU to a specific hardware device.

share|improve this question

I assume you're talking about a x86 platform with a BIOS. I don't think there is a direct correlation, it's just the way numbered it is detected, depending on a lot of factors, esp. the BIOS.

Maybe you can invent your own scheme by using udev-rules. Here is a tutorial. The KERNELS variable seems to be relevant indicator here.

share|improve this answer

What kind of device? Some (i.e. network interfaces) don't have a device node - but for things like block devices, you can grab bits out of sysfs:

$ readlink /sys/block/sda/device/scsi_device*/device 
share|improve this answer

It turns out that this character device actually had a device show capability with a command line switch in one of its control programs. The mapping turned out to follow the mapping of lspci (devices displayed in order of discovery) so I assume the PCI discovery method must walk forward in a similar manner.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.