I have some SAS devices in a server, I would like to find out what their SAS addresses are. How can I do that in Linux? I'm using CentOS 6.
kdtkdtHi all, I'm looking for the command equivalent in Linux for the lsattr, lsdev, and lscfg commands in AIX. I have a group of scsi tape devices.
68522 gold badges1717 silver badges3131 bronze badges
2 Answers
They should be available in /dev/disk/by-id, on your machine it should look something like this:
quanta43.8k1515 gold badges116116 silver badges197197 bronze badges
polynomialpolynomial
The Linux utility lsscsi written by Doug Gilbert will provide the information you are looking for. It is in the Base repository of CentOS 5, 6, and 7, but YMMV with other distros. The output of lsscsi on my CentOS 7 system with the argument required to display WWNs:
I realize this is an old question, but I came across it and thought I'd offer another solution.
LazLongLazLong
Not the answer you're looking for? Browse other questions tagged linuxsascentos6 or ask your own question.
Yes - you should install both lsscsi and sg3_utils when you're dealing with fibre stuff. You can get a wealth of information from the packages associated.
lsscsi --generic will equate your sd (scsi disk) devices with the sg devices and st (scsi tape) devices with sg devices.
Sample output extract:
lsscsi --generic
[0:2:0:0] disk DELL PERC H710 3.13 /dev/sda /dev/sg0
[5:0:0:0] cd/dvd HL-DT-ST DVD-ROM DU60N D301 /dev/sr0 /dev/sg1
[7:0:0:0] disk HITACHI OPEN-V-CM 7006 /dev/sdb /dev/sg2
[7:0:0:1] disk HITACHI OPEN-V-CM 7006 /dev/sdc /dev/sg3
[7:0:0:6] disk HITACHI OPEN-V 7006 /dev/sdd /dev/sg4
[7:0:1:10] disk PURE FlashArray 476 /dev/sdcv /dev/sg110
[7:0:1:11] disk PURE FlashArray 476 /dev/sdcw /dev/sg111
[7:0:1:12] disk PURE FlashArray 476 /dev/sdcx /dev/sg112
[7:0:1:13] disk PURE FlashArray 476 /dev/sdcy /dev/sg113
[8:0:0:0] storage QUANTUM Scalar i2000 5C1o - /dev/sg69
[8:0:0:1] tape HP Ultrium 3-SCSI M69Z /dev/st0 /dev/sg70
[8:0:0:2] tape HP Ultrium 3-SCSI M69Z /dev/st1 /dev/sg72
[8:0:0:3] tape HP Ultrium 5-SCSI I6PZ /dev/st2 /dev/sg73
[8:0:0:4] tape HP Ultrium 5-SCSI I6PZ /dev/st3 /dev/sg74
In the above we can see Hitachi VSP storage array disks (OPEN-V*), Pure Flasharray disks, A Quantum i6000 tape library's robotic control (as i2000 - it is same family) and 4 tape drives in that library.
Note in Linux you typically write to /dev/st* rather than /dev/sg* for tape operations. Or more usually /dev/nst* the no rewind devices (e.g. /dev/nst3 = no rewind associated with /dev/st3).
You can see a lot of information for your Fiber controllers under /sys/class/fc_host. Each host# seen there is a different fiber port on the server. If you do 'cat host#/port_name it shows you the WWN of that port.
You can also get tools from the makers of the cards. For Qlogic you can download their bundle that contains qaucli which lets you examine a lot of this.
Note that much of this requires root access. You mentioned a separate System Admin which makes me suspect you don't have root so you may need him to run commands for you or give you sudo access to specific commands.
lsscsi --generic will equate your sd (scsi disk) devices with the sg devices and st (scsi tape) devices with sg devices.
Sample output extract:
lsscsi --generic
[0:2:0:0] disk DELL PERC H710 3.13 /dev/sda /dev/sg0
[5:0:0:0] cd/dvd HL-DT-ST DVD-ROM DU60N D301 /dev/sr0 /dev/sg1
[7:0:0:0] disk HITACHI OPEN-V-CM 7006 /dev/sdb /dev/sg2
[7:0:0:1] disk HITACHI OPEN-V-CM 7006 /dev/sdc /dev/sg3
[7:0:0:6] disk HITACHI OPEN-V 7006 /dev/sdd /dev/sg4
[7:0:1:10] disk PURE FlashArray 476 /dev/sdcv /dev/sg110
[7:0:1:11] disk PURE FlashArray 476 /dev/sdcw /dev/sg111
[7:0:1:12] disk PURE FlashArray 476 /dev/sdcx /dev/sg112
[7:0:1:13] disk PURE FlashArray 476 /dev/sdcy /dev/sg113
[8:0:0:0] storage QUANTUM Scalar i2000 5C1o - /dev/sg69
[8:0:0:1] tape HP Ultrium 3-SCSI M69Z /dev/st0 /dev/sg70
[8:0:0:2] tape HP Ultrium 3-SCSI M69Z /dev/st1 /dev/sg72
[8:0:0:3] tape HP Ultrium 5-SCSI I6PZ /dev/st2 /dev/sg73
[8:0:0:4] tape HP Ultrium 5-SCSI I6PZ /dev/st3 /dev/sg74
In the above we can see Hitachi VSP storage array disks (OPEN-V*), Pure Flasharray disks, A Quantum i6000 tape library's robotic control (as i2000 - it is same family) and 4 tape drives in that library.
Note in Linux you typically write to /dev/st* rather than /dev/sg* for tape operations. Or more usually /dev/nst* the no rewind devices (e.g. /dev/nst3 = no rewind associated with /dev/st3).
You can see a lot of information for your Fiber controllers under /sys/class/fc_host. Each host# seen there is a different fiber port on the server. If you do 'cat host#/port_name it shows you the WWN of that port.
You can also get tools from the makers of the cards. For Qlogic you can download their bundle that contains qaucli which lets you examine a lot of this.
Note that much of this requires root access. You mentioned a separate System Admin which makes me suspect you don't have root so you may need him to run commands for you or give you sudo access to specific commands.