Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
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.
My company was using EMC storage in the past. They provided a command called inq. This command would list each drive like /dev/sdb, the vendor, model of storage until, serial number, and drive size.
We have since switched to IBM storage, so I don't have access to the updated EMC commands anymore. I wanted to find a similar open source command or write a script to list out the same information.
Does anyone know of a similar command on RHEL linux?
I am also looking for a command in linux to list out the serial number of a scsi drive. If I can figure that out, I should be able to create a script to make the same output.
I have made some progress. I found a package in RHEL 3 called sg3_utils which can give me most of the information I need. I have ran into one problem. We are also using virtualized storage and the serial number is the same for all the drives that are virtualized. If I have multiple drives with that are the same size with the same partition tables, does anyone know how to determine which paths point to the same drives since there is no serial number to go by? You can see what I mean below:
Device Serial Vendor Model Size(kb)
----------------------------------------------------------------
/dev/sdb 020060a026f8XX02 IBM 2145 31457280
/dev/sdc 020060a026f8XX02 IBM 2145 31457280
/dev/sdd 020060a026f8XX02 IBM 2145 31457280
/dev/sde 020060a026f8XX02 IBM 2145 3145728
/dev/sdf 020060a026f8XX02 IBM 2145 3145728
/dev/sdg 020060a026f8XX02 IBM 2145 31457280
/dev/sdh 020060a026f8XX02 IBM 2145 31457280
/dev/sdi 020060a026f8XX02 IBM 2145 31457280
/dev/sdj 020060a026f8XX02 IBM 2145 3145728
/dev/sdk 020060a026f8XX02 IBM 2145 3145728
/dev/sdl 020060a026f8XX02 IBM 2145 31457280
/dev/sdm 020060a026f8XX02 IBM 2145 31457280
/dev/sdn 020060a026f8XX02 IBM 2145 31457280
/dev/sdo 020060a026f8XX02 IBM 2145 3145728
/dev/sdp 020060a026f8XX02 IBM 2145 3145728
/dev/sdq 020060a026f8XX02 IBM 2145 31457280
/dev/sdr 020060a026f8XX02 IBM 2145 31457280
/dev/sds 020060a026f8XX02 IBM 2145 31457280
/dev/sdt 020060a026f8XX02 IBM 2145 3145728
/dev/sdu 020060a026f8XX02 IBM 2145 3145728
In this case I know the following drives match:
sdb, sdl, sdq, sdg (these are all the same drive)
sdc, sdr, sdm, sdh (these are all the same drive)
sdd, sds, sdn, sdi (these are all the same drive)
sde, sdt, sdo, sdj (these are all the same drive)
sdf, sdu, sdp, sdk (these are all the same drive)
Veritas Foundation Suite helped me determine which drives are the same but I want a solution for servers that are also not running Veritas. Any help on how to determine that sdb, sdl, sdq, and sdg are the same drive is what I am looking for.
The commands I used to get the information above are
sginfo -l (list all scsi devices)
sginfo -s /dev/sdX (list serial number of drive)
sginfo /dev/sdX (get vendor information)
fdisk -s /dev/sdX (get drive size)
I did find another command to identy the drives, incase anyone else wants to do the same thing. There is a command called scsi_unique_id that did the trick. I now have a script that can list out all the drives, sizes, serial numbers and the paths each drive can use.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.