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