How to find out a hard disk model and serial number on Linux?

Here are few quick ways

Info in /proc/scsi/scsi

Use any one of the following command from shell prompt to find out hard disk model number:

 # cat /proc/scsi/scsi | grep -A 3 "scsi5 Channel: 00 Id: 03"
Host: scsi5 Channel: 00 Id: 03 Lun: 00
  Vendor: ATA      Model: SEAGATE ST31000N Rev: SU0E
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi5 Channel: 00 Id: 04 Lun: 00

scsi_id

Use scsi_id command to querys a SCSI device via the SCSI INQUIRY vital product data (VPD) page 0x80 or 0x83 and uses the resulting data to generate a value that is unique across all SCSI devices that properly support page 0x80 or page 0x83.

$ /sbin/scsi_id -g -p 0x80 -s /block/sda 

OR on RHEL7

# /usr/lib/udev/scsi_id -p 0x80 --whitelist /dev/sda
SATA     SEAGATE ST31000N9QJ53PCC

lsscsi command

lsscsi gets information from /proc/scsi/scsi

# lsscsi
[0:0:0:0]    disk    ATA      HITACHI H7210CA3 A3CB  /dev/sda
[0:0:1:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdb
[0:0:2:0]    disk    ATA      HITACHI H7210CA3 A3CB  /dev/sdc
...
[1:0:0:0]    disk    ATA      SEAGATE ST31000N SU0E  /dev/sdi
...

lsblk command

lsblk '-S' option shows scsi info about SCSI devices

# lsblk -S
NAME HCTL       TYPE VENDOR   MODEL             REV TRAN
sda  0:0:0:0    disk ATA      SEAGATE ST31000N SU0E sas
sdb  0:0:1:0    disk ATA      SEAGATE ST31000N SU0E sas
sdc  0:0:2:0    disk ATA      SEAGATE ST31000N SU0E sas
sdd  0:0:3:0    disk ATA      Hitachi HUA72101 AB0A sas
...

sginfo command

'-M' option Access manufacturer defaults instead of current values

'-m' option Access modifiable fields instead of current values

# sginfo -M /dev/sda
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
Vendor:                    ATA     
Product:                   SEAGATE ST31000N
Revision level:            SU0E

'-i' option, Display information from INQUIRY command

# sginfo -i /dev/sda
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
...
Command Queueing                   1
Vendor:                    ATA     
Product:                   SEAGATE ST31000N
Revision level:            SU0E

'-s' option, Display serial number (from INQUIRY VPD page)

# sginfo -s /dev/sda
Serial Number '9QJ53A27

'-a' option, Display inquiry info, serial # and all mode pages

 

# sginfo -a /dev/sda
INQUIRY response (cmd: 0x12)
----------------------------
Device Type                        0
Vendor:                    ATA     
Product:                   SEAGATE ST31000N
Revision level:            SU0E

Serial Number '9QJ53A27            '
...