【转】Get device name from PCIE slot number [closed]

https://stackoverflow.com/questions/52153889/get-device-name-from-pcie-slot-number

I have 4 SSD cards plugged into my system. They show up as /dev/nvme[0-3]n1.

Using lspci -vvv I can get the PCIE slot numbers of these 4 cards. But how to match the PCIE slot number with the device name? For example one of the cards has the slot number 3b:00:0. What is the corresponding /dev/nvme[0-3]n1?

I have gone through /sys/bus/pci/devices but not found what I'm looking for. Google has not thrown up any answers either.

TIA cheers

linux pci-e

shareimprove this question

asked Sep 3 '18 at 17:06

Mia Dawson

33

closed as off-topic by Ben VoigtrsjaffePerracoLabsphuclvNarendra Jadhav Sep 4 '18 at 4:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – Ben Voigt, rsjaffe, PerracoLabs, phuclv, Narendra Jadhav

If this question can be reworded to fit the rules in the help center, please edit the question.

 

  • For a one time shot, try looking at the resulting file from sudo lshw -html > ~/Desktop/hardware_file.html – ivanivan Sep 3 '18 at 17:09

add a comment

1 Answer

activeoldestvotes

0

 

You may try searching for device name somewhat like this:

grep "3b:00.0" /sys/class/nvme/*/device/uevent

Then you will need to extract device name from the output:

/sys/class/nvme/nvme0n1/device/uevent:PCI_SLOT_NAME=0000:3b:00.0

This will be the string in place of the asterisk.

shareimprove this answer

answered Sep 3 '18 at 21:01

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值