如何在 Linux 下列出 scsi 设备 ID?
答案1
我的系统上没有 /proc/scsi/scsi 内核为 2.6.39.1。我会使用“lsscsi”命令:
~> lsscsi -v
[0:0:0:0] disk ATA ST3500418AS CC38 /dev/sda
dir: /sys/bus/scsi/devices/0:0:0:0 [/sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0]
[1:0:0:0] disk ATA WDC WD2500KS-00M 02.0 /dev/sdb
dir: /sys/bus/scsi/devices/1:0:0:0 [/sys/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0]
答案2
cat /proc/scsi/scsi
答案3
您可以使用以下链接/dev/disk/by-id
:
[root@krxl02cn05 by-id]# pwd
/dev/disk/by-id
[root@krxl02cn05 by-id]# ls -rtl
total 0
lrwxrwxrwx 1 root root 9 Feb 12 01:40 scsi-3600605b005d8655019aa31faf0812bae -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 12 01:40 scsi-3600605b005d8655019aa31faf0812bae-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Feb 12 01:40 scsi-3600605b005d8655019aa31faf0812bae-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Feb 12 01:50 scsi-3600144f09a214698000054db88550008 -> ../../sdd
lrwxrwxrwx 1 root root 9 Feb 12 01:50 scsi-3600144f09a214698000054db88460007 -> ../../sdc
lrwxrwxrwx 1 root root 9 Feb 12 01:50 scsi-3600144f09a214698000054db88260006 -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 12 01:54 scsi-3600144f09a214698000054db88260006-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 15 Feb 12 04:56 scsi-3600144f09a214698000054db88460007-part1 -> ../../asm-disk1
lrwxrwxrwx 1 root root 15 Feb 12 04:59 scsi-3600144f09a214698000054db88550008-part1 -> ../../asm-disk2
所以,scsi id/dev/sdc
是3600144f09a214698000054db88460007