Document Scope
This article will provide a few basic commands for gathering hard drive serial numbers from the command line. This can be a useful diagnostic tool for locating a specific drive that may be railed out of a RAID or displaying signs of failure and in need of replacement.
Note about Drive Type
The specific command will vary a bit based on the specific type of drive you have installed in your system. You may also need to install these tools if they are not already present.
For SATA/SAS devices
sudo hdparm -i <device name>
Example of usage and expected output (serial in bold text)
[root@localhost ~]# hdparm -i /dev/sda
/dev/sda:
Model=SAMSUNG MZ7LH1T9HMLT-00005, FwRev=HXT7904Q, SerialNo=S455NC0T106220 Config={ Fixed }RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=offCurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=3750748848IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}PIO modes: pio0 pio1 pio2 pio3 pio4DMA modes: mdma0 mdma1 mdma2UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6AdvancedPM=no WriteCache=enabledDrive conforms to: unknown: ATA/ATAPI-2,3,4,5,6,7
* signifies the current active mode
If this command needs to be installed you can do so with the following:
CentOS
sudo yum install hdparm
Ubuntu
sudo apt-get install hdparm
NVMe device
sudo nvme list
Example of usage and expected output (serial in bold text)
[root@localhost ~]# nvme listNode SN Model Namespace Usage Format FW Rev
/dev/nvme0n1 20382D4E556E Micron_7300_MTFDHBE960TDF 1 960.20 GB / 960.20 GB 512 B + 0 B 95420100
If this command needs to be installed you can do so with the following:
CentOS
sudo yum install nvme-cli
Ubuntu
sudo apt-get install nvme-cli
Comments
0 comments
Please sign in to leave a comment.