How do I find out the make, model and serial number for my SCSI or IDE hard disks under CentOS Linux server? How do I get vendor information about my disk storage w/o opening my Intel / AMD server chassis?

You need to use the hdparm command. It provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE/SATA device driver subsystem i.e. get BIOS information from hard disk.

Getting hard disk model and number under Linux

Try command as follows for /dev/sda (SATA). You need to pass -i or -I option which request identification info directly from the drive, which is displayed in a new expanded format:
# hdparm -I /dev/sda
# hdparm -I /dev/sda | grep Serial

OR for IDE /dev/hda
# hdparm -i /dev/hda
OR
# hdparm -I /dev/hda
Sample outputs:

/dev/sda:

ATA device, with non-removable media
        Model Number:       SAMSUNG SV2002H                         
        Serial Number:      0395J1FR904324
        Firmware Revision:  RA100-04
Standards:
        Used: ATA/ATAPI-6 T13 1410D revision 1 
        Supported: 6 5 4 
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:   39180960
        device size with M = 1024*1024:       19131 MBytes
        device size with M = 1000*1000:       20060 MBytes (20 GB)
Capabilities:
        LBA, IORDY(cannot be disabled)
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Recommended acoustic management value: 128, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 udma5 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
                SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
                Automatic Acoustic Management feature set
           *    Mandatory FLUSH_CACHE
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        20min for SECURITY ERASE UNIT. 20min for ENHANCED SECURITY ERASE UNIT.
HW reset results:
        CBLID- below Vih
        Device num = 0 determined by the jumper
Checksum: correct

scsi_id command examples

For SCSI attached disk use scsi_id command which queries 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.
# scsi_id -s /block/sda
# scsi_id -a -s /block/sda
# scsi_id -gus /block/sda

Where,

  • -s : Generate an id for the sysfs-device
  • -a : Always print information (model, vendor strings) about the device even if it does not support VPD pages.
  • -g : Treat the device as white listed. The -g option must be specified on the command line or in the scsi_id configuration file for scsi_id to gener ate any output
  • -u : Reformat the output : replace all whitespaces by underscores.

sdparm command

The sdparm command can be used to access SCSI modes pages; read VPD pages; send simple SCSI commands. It can provide all information:
# sdparm -a /dev/sda
# sdparm --vendor sea /dev/sda


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 9 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
9 comments… add one
  • Chris May 14, 2008 @ 21:23

    Thanks! – In CentOS, the command for SCSI info is, appropriately enough, scsi-info

  • Valter Espindola Oct 1, 2008 @ 20:54

    Debian systems

    ls /dev/disk/by-id

  • reini Jan 15, 2009 @ 16:04

    for suse 9.x 10.x and other linux 2.6.x producing hdparm errors with s-ata disks

    HDIO_GET_IDENTITY failed: Operation not supported

    use sdparm from freshmeat instead:

    sdparm -p sn /dev/sda

    cheers

  • Anuradha May 3, 2010 @ 14:53

    Can this be achieved using C++ or C program?
    please reply….

  • jayaram Prasad Aug 31, 2011 @ 10:09

    On-Cent-OS

    System–>Administration–>Hardware

    This is like devmgmt.msc that is device manager in windows which will show all the required information about the hardware

    also you can try with

    dmesg|grep vol

  • chandra Jul 10, 2013 @ 11:00

    Hi Guys,

    Need help here

    How to get serial number of Hard drive in linux on HP blade 460c?

    thanks!!!

  • chandra Jul 10, 2013 @ 11:01

    i also tried with hdparm but no luck..

  • Ahmed Oct 20, 2013 @ 23:23

    What if i want to get data of an array of disks. I use multiple disks with RAID-5.

  • Raja Jul 31, 2015 @ 5:32

    with hdparm the error is improper ioctl..:(

    it will work with smartctl -a -i -d

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum