会有很多硬盘插进来处理,处理完之后拿走。有专人负责插拔硬盘,但是这个人不知道硬盘里的数据有没有处理完。
现在想做的事是在硬盘处理完的时候,通知插硬盘的人”插槽X的盘已经处理完了,可以拔出来换下一块盘了“.
机器上一共是8个槽位,下面是udev拿到的path,想知道每个盘对应的是哪个槽位。。
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:315/end_device-0:315/target0:0:315/0:0:315:0/block/sdb
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:316/end_device-0:316/target0:0:316/0:0:316:0/block/sdf
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:317/end_device-0:317/target0:0:317/0:0:317:0/block/sdg
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:318/end_device-0:318/target0:0:318/0:0:318:0/block/sdh
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:319/end_device-0:319/target0:0:319/0:0:319:0/block/sdi
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:320/end_device-0:320/target0:0:320/0:0:320:0/block/sdj
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:321/end_device-0:321/target0:0:321/0:0:321:0/block/sdj
/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/host0/port-0:322/end_device-0:322/target0:0:322/0:0:322:0/block/sdj
【 在 Dazzy 的大作中提到: 】
: 硬盘是你插的,物理口是哪个你知道的。如果不知道,用ledctl或者ledmon看,前提是
: 你的主机有各磁盘独立的led。
: 软件就简单了,插入磁盘,dmesg里必有条目。
: ...................
--
FROM 220.194.45.*