Linux redhat command to get WWN and/or serial number info
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Linux redhat command to get WWN and/or serial number info
Hi 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 and, presumably, virtual tape libraries which are showing up as /dev/sg devices, but I'm not sure how to interrogate those devices to match up their wwn's with what was supposed to be zoned to the box. It looks like it may be the lsscsi command, but that's not installed. Maybe I just need to ask my admin to get that utility installed?
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.
Some distros may not have that. The lsblk command is available in RHEL6/CentOS6 but not RHEL5/CentOS5. Even in RHEL6/CentOS6 it doesn't have WWN and SERIAL columns. RHEL7/CentOS7 do have those options.
Last edited by MensaWater; 02-20-2017 at 07:34 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.