命令行:
lsscsi 列出scsi设备 或 hosts,
Usage: lsscsi [--classic] [--device] [--generic] [--help] [--hosts] [--kname] [--list] [--long] [--protection] [--sysfsroot=PATH] [--transport] [--verbose] [--version] [<h:c:t:l>] where: --classic|-c alternate output similar to 'cat /proc/scsi/scsi' --device|-d show device node's major + minor numbers --generic|-g show scsi generic device name --help|-h this usage information --hosts|-H lists scsi hosts rather than scsi devices --kname|-k show kernel name instead of device node name --list|-L additional information output one attribute=value per line --long|-l additional information output --protection|-p show data integrity (protection) information --sysfsroot=PATH|-y PATH set sysfs mount point to PATH (def: /sys) --transport|-t transport information for target or, if '--hosts' given, for initiator --verbose|-v output path names where data is found --version|-V output version string and exit <h:c:t:l> filter output list (def: '- - - -' (all)) List SCSI devices or hosts, optionally with additional information
[root@vClass-w47o0 init.d]# lsscsi [0:0:0:0] disk ATA ST2000DM001-1ER1 CC26 /dev/sda [1:0:0:0] disk ATA KINGSTON SV300S3 505A /dev/sdb
[root@vClass-w47o0 scsi]# cat scsi Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: ST2000DM001-1ER1 Rev: CC26 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: KINGSTON SV300S3 Rev: 505A Type: Direct-Access ANSI SCSI revision: 05 [root@vClass-w47o0 scsi]# lsscsi -c Attached devices: Host: scsi0 Channel: 00 Target: 00 Lun: 00 Vendor: ATA Model: ST2000DM001-1ER1 Rev: CC26 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Target: 00 Lun: 00 Vendor: ATA Model: KINGSTON SV300S3 Rev: 505A Type: Direct-Access ANSI SCSI revision: 05
[root@vClass-w47o0 scsi]# lsscsi -d
[0:0:0:0] disk ATA ST2000DM001-1ER1 CC26 /dev/sda [8:0]
[1:0:0:0] disk ATA KINGSTON SV300S3 505A /dev/sdb [8:16]
[root@vClass-w47o0 scsi]# lsscsi -g
[0:0:0:0] disk ATA ST2000DM001-1ER1 CC26 /dev/sda /dev/sg0
[1:0:0:0] disk ATA KINGSTON SV300S3 505A /dev/sdb /dev/sg1
[root@vClass-w47o0 scsi]# lsscsi -dg
[0:0:0:0] disk ATA ST2000DM001-1ER1 CC26 /dev/sda [8:0] /dev/sg0[21:0]
[1:0:0:0] disk ATA KINGSTON SV300S3 505A /dev/sdb [8:16] /dev/sg1[21:1]
[root@vClass-w47o0 scsi]# lsscsi -H [0] ahci [1] ahci [2] ahci [3] ahci [4] pata_atiixp [5] pata_atiixp
show kernel name instead of device node name
显示 kernel name, 不是设备节点名称
[root@vClass-w47o0 ~]# lsscsi -k [0:0:0:0] disk ATA ST2000DM001-1ER1 CC26 /dev/sda [1:0:0:0] disk ATA KINGSTON SV300S3 505A /dev/sdb