LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 02-17-2017, 01:17 PM   #1
cjhund1969
LQ Newbie
 
Registered: Feb 2017
Posts: 6

Rep: Reputation: Disabled
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?

Best regards,
C.J.
 
Old 02-17-2017, 02:07 PM   #2
brightrif
LQ Newbie
 
Registered: Feb 2017
Posts: 2

Rep: Reputation: Disabled
systool will help you to find the wwn numbers.

the other way to find is

ls -lrt /sys/class/fc_host/host[0-9]*/port_name

the cat the outputs.
 
1 members found this post helpful.
Old 02-17-2017, 02:08 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 02-17-2017, 02:13 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by brightrif View Post
systool will help you to find the wwn numbers.
To get systool you need to install sysfsutils package.
 
Old 02-17-2017, 05:27 PM   #5
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
lsblk -o +WWN,SERIAL works for me
 
1 members found this post helpful.
Old 02-18-2017, 09:49 AM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by Doug G View Post
lsblk -o +WWN,SERIAL works for me
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get HDD and SSD serial number in linux using command line sundanat Linux - Hardware 13 03-09-2018 04:20 PM
what is the command to find wwn in linux? sujithspillai90 Linux - Newbie 2 10-09-2012 02:19 AM
LXer: How To Easily Find The WWN's Of A QLogic HBA On RedHat Linux LXer Syndicated Linux News 0 10-01-2008 03:00 PM
command to get the serial number of linux box bhatpp Linux - Newbie 4 09-19-2007 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration