LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   How to list hard drive information. (https://www.linuxquestions.org/questions/linux-enterprise-47/how-to-list-hard-drive-information-407874/)

tells 01-25-2006 12:01 PM

How to list hard drive information.
 
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.

Defi 01-25-2006 01:08 PM

hdparm -i /dev/...
df -h

tells 01-25-2006 04:04 PM

hdparm does not work on scsi drives

tells 01-25-2006 04:17 PM

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)

Thanks,

tells 01-26-2006 03:37 PM

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.


All times are GMT -5. The time now is 01:05 PM.