Tag Archives: How to find disk serial number

Howto get Disk serial number in HPUX

Howto tutorial to get a hard disk serial number from the HPUX server. Learn to obtain disk information using the CSTM command prompt.

Disk serial number is a unique number which is a key identification of disk on the system. While disks are plugged in and online it’s hard to trace their serial numbers physically. Normally serial numbers can be identified on disk which is printed on sticker physically. But if the disk is plugged into the system and currently online it’s hard to observe it physically from all sides and get the serial numbers. In such a condition, we can get serial numbers from OS by running commands. Commands read disk information from disks and extract it for us.

How to get a serial number

Here we are going to see how to get a serial number of the disk which is attached to a server running HPUX. Normally everyone knows diskinfo command to get basic disk information.

# diskinfo  /dev/rdsk/c1t1d0
SCSI describe of /dev/rdsk/c1t1d0:
             vendor: HP 36.4G
         product id: ST336754LC
               type: direct access
               size: 35566480 Kbytes
   bytes per sector: 512

In diskinfo output we get basic information on disk like its vendor, size, product ID, etc. Note that you need to use the raw device in command argument i.e. disk name with rdsk not dsk.

But we are not getting a serial number of the disk here. We will use CSTM to get this information. CSTM is Command-line Support Tool Manager. Its a part of the Online Diagnostic tool which is used for real-time hardware monitoring on HP platforms.

Running cstm will take you to cstm prompt where different commands can be run.

# cstm
Running Command File (https://z5.kerneltalks.com/usr/sbin/stm/ui/config/.stmrc).

-- Information --
Support Tools Manager


Version A.59.05

Product Number B4708AA

(C) Copyright Hewlett Packard Co. 1995-2007
All Rights Reserved

Use of this program is subject to the licensing restrictions described
in "Help-->On Version".  HP shall not be liable for any damages resulting
from misuse or unauthorized use of this program.

cstm>

At cstm prompt run below command to get serial number info.

cstm>selclass qualifier hard;info;wait;infolog
-- Updating Map --
Updating Map...
-- Converting multiple raw log files to text. --
Preparing the Information Tool Log for each selected device...

.... server1  :  10.10.1.5 ....

-- Information Tool Log for SCSI Disk on path 0/0/1/1.0.0 --

Log creation time: Mon Oct 31 09:56:06 2016

Hardware path: 0/0/1/1.0.0


Product Id:       ST373455LC#36     Vendor:           HP 36.4G
Device Type:      SCSI Disk         Firmware Rev:     HPC8
Device Qualifier: HP36.4GST373455LC#36  Logical Unit:     0
Serial Number:    3LQ3VVTS000099075C5W
Capacity (M Byte):          34732.89
   Block Size:              512
   Max Block Address:       71132959
Smart Enabled:    TRUE
Error Logs
   Read Errors:                0    Buffer Overruns:        N/A
   Read Reverse Errors:      N/A    Buffer Underruns:       N/A
   Write Errors:               0    Non-Medium Errors:        2
   Verify Errors:              0

=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=-+-=

CSTM prompt can be exited using quit command.

cstm>quit
-- Exit the Support Tool Manager --
Are you sure you want to exit the Support Tool Manager?

Enter Cancel, Help, or OK: [OK] ok
#

If you do not wish to enter prompt / do interactive stuff then the above tasks can be accomplished in a single one-liner too.

# echo "selclass qualifier hard;info;wait;infolog"|cstm
Running Command File (https://z5.kerneltalks.com/usr/sbin/stm/ui/config/.stmrc).

-- Information --
Support Tools Manager


Version A.59.05

Product Number B4708AA

(C) Copyright Hewlett Packard Co. 1995-2007
All Rights Reserved

Use of this program is subject to the licensing restrictions described
in "Help-->On Version".  HP shall not be liable for any damages resulting
from misuse or unauthorized use of this program.

cstm>selclass qualifier hard;info;wait;infolog
-- Updating Map --
Updating Map...
-- Converting multiple raw log files to text. --
Preparing the Information Tool Log for each selected device...

.... server1  :  10.10.1.5 ....

-- Information Tool Log for SCSI Disk on path 0/0/1/1.0.0 --

Log creation time: Sat Oct 29 23:33:37 2016

Hardware path: 0/0/1/1.0.0


Product Id:       ST373455LC#36     Vendor:           HP 36.4G
Device Type:      SCSI Disk         Firmware Rev:     HPC8
Device Qualifier: HP36.4GST373455LC#36  Logical Unit:     0
Serial Number:    3LQ3VVTS000099075C5W
Capacity (M Byte):          34732.89
   Block Size:              512
   Max Block Address:       71132959
Smart Enabled:    TRUE
Error Logs
   Read Errors:                0    Buffer Overruns:        N/A
   Read Reverse Errors:      N/A    Buffer Underruns:       N/A
   Write Errors:               0    Non-Medium Errors:        2
   Verify Errors:              0