在/usr/share/ 下有文件pci.ids文件,表示了设备的类别,厂商信息
C 01 Mass storage controller
00 SCSI storage controller
01 IDE interface
02 Floppy disk controller
03 IPI bus controller
04 RAID bus controller
05 ATA controller
c开头说明是class说明,01 Mass storage controller表示Mass storage controller的类号是01,设备子类为下面列举的
00 SCSI storage controller
01 IDE interface
02 Floppy disk controller
03 IPI bus controller
04 RAID bus controller
05 ATA controller
SCSI storage controller的设备类合起来就是0x0100了
*如何识别硬盘(SCSI disk devices)的主次设备号?
SCSI disk devices的主设备号范围为:
8;65;66;67;68;69;70;71;128;129;130;131;132;133;134;135;
如何识别是整个硬盘还是一个分区?
使用次设备号识别,如为整个硬盘则次设备号为16的整数倍(0;16;32;…;240);
如为分区则取值为1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;由此得一个盘的分区最多为15
在/sys/devices下有pci0000:00目录,说明挂在pci总线上的设备,里面0000:00:1c.0
2011.3.14在172.16.0.140上的/sys/devices/pci0000:00的内容
0000:00:00.0 class 0x060000(Host bridge)
0000:00:1a.0 class 0x0c0320(USB Controller EHCI)
0000:00:1c.6 class 0x060400(PCI bridge)
0000:04:00.0 class 0x030000(VGA compatible controller)
0000:00:1e.0 class 0x060401 (PCI bridge Subtractive decode)
0000:00:1f.3 class 0x0c0500(SMBus)
0000:00:01.0 class 0x060400(PCI bridge)
0000:01:00.0 class 0x020000(Network controller)
0000:01:00.1 class 0x020000(Network controller)
0000:00:1c.0 class 0x060400(PCI bridge)
0000:02:00.0 class 0x010000(SCSI storage controller)
0000:00:1c.7 class 0x060400(PCI bridge)
0000:00:1f.0 class 0x060100(ISA bridge)
0000:00:19.0 class 0x020000(Network controller)
0000:00:1c.4 class 0x060400(PCI bridge)
0000:03:00.0 class 0x020000(Network controller)
0000:00:1d.0 class 0x0c0320(USB Controller EHCI)
0000:00:1f.2 class 0x010601(SATA controller AHCI 1.0)
在/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/host6/scsi_host/host6下
board_assembly L3-00159-02A
board_name SAS3081E
board_tracer P
这3个在hba卡上有标识
/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/host6/port-6:1/expander-6:1/port-6:1:1/end_device-6:1:1/target6:0:5⁄6:0:5:0/block/sdf
/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/host6/port-6:1/expander-6:1/port-6:1:1/end_device-6:1:1/sas_device/end_device-6:1:1/sas_address
上两条一个最后为地址,一个最后为block,要有盘才有/block/sd
如何识别是sas盘得热插拔?
1、首先确定SCSI storage controller或Serial Attached SCSI controller的所在在位置
可以通过lspci的管道输出得到0000:02:00.0上的设备是SCSI storage controller(也有可能为Serial Attached SCSI controller),确认该总线下为阵列磁盘说在位置磁盘,在该总线下的事件既是整列的事件,忽略其他总线的事件
2、将在该总线上的磁盘归为一组
expander-6:1和expander-6:0有区别吗?
3、热插拔事件的过滤
首先根据(1)得到的总线号过滤掉其他总线上的信息,然后在热插拔事件中寻找主设备号为SCSI disk devices的那段信息,对该段信息进行解析得到进一步的数据
2025年linux设备识别
linux设备识别在 usr share 下有文件 pci ids 文件 表示了设备的类别 厂商信息 C 01 Mass storage controller 00 SCSI storage controller 01 IDE interface 02 Floppy disk controller 03 IPI bus controller 04 RAID bus controller 05 ATA
大家好,我是讯享网,很高兴认识大家。
PSD缩略图的设置方法
上一篇
2025-02-06 16:21
2025年Java实验(SWUST 实验一 复数类的设计)
下一篇
2025-01-13 13:06

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/128692.html