HowTo: Find Out Hard Disk Specs / Details on Linux

HowTo: Find Out Hard Disk Specs / Details on Linux

last updated in Categories , , , , , ,

 

Can you tell me a Linux command to find out information about my hard disk such as description, product name, bus type, size, and cache memory size under Linux operating systems using command line options?

Linux comes with various commands to find out information about your hard drive. I recommend hdparm command which provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. This command read / request identification information such as disk size, description and much more directly from the drive, which is displayed in a new expanded format.

 

 

 

hdparm Command

Open the terminal and type the following command to find information about /dev/sda:
# hdparm -I /dev/sda
OR
$ sudo hdparm -I /dev/sda
Sample outputs:

/dev/sda:

ATA device, with non-removable media
        Model Number:       ST3500630AS                             
        Serial Number:      9XXYZ845YZ
        Firmware Revision:  3.AAK   
Standards:
        Supported: 7 6 5 4 
        Likely used: 7
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors:  976773168
        device size with M = 1024*1024:      476940 MBytes
        device size with M = 1000*1000:      500107 MBytes (500 GB)
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        Recommended acoustic management value: 254, current value: 0
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
             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
           *    DOWNLOAD_MICROCODE
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    SATA-I signaling speed (1.5Gb/s)
           *    SATA-II signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
                Device-initiated interface power management
           *    Software settings preservation
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
                frozen
        not     expired: security count
        not     supported: enhanced erase
Checksum: correct

lshw Command

You need to install lshw command using apt-get or yum command. To display all disks and storage controllers in the system, enter:
# lshw -class disk -class storage
Sample outputs:

  *-storage               
       description: Mass storage controller
       product: 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)
       vendor: Texas Instruments
       physical id: 1.2
       bus info: pci@0000:03:01.2
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: storage pm bus_master cap_list
       configuration: driver=tifm_7xx1 latency=64 maxlatency=4 mingnt=7
       resources: irq:19 memory:f19fa000-f19fafff
  *-storage
       description: SATA controller
       product: 5 Series/3400 Series Chipset 6 port SATA AHCI Controller
       vendor: Intel Corporation
       physical id: 1f.2
       bus info: pci@0000:00:1f.2
       logical name: scsi0
       logical name: scsi1
       logical name: scsi2
       version: 05
       width: 32 bits
       clock: 66MHz
       capabilities: storage msi pm ahci_1.0 bus_master cap_list emulated
       configuration: driver=ahci latency=0
       resources: irq:32 ioport:6e70(size=8) ioport:6e78(size=4) ioport:6e80(size=8) ioport:6e88(size=4) ioport:6ea0(size=32) memory:fed1e000-fed1e7ff
     *-disk:0
          description: ATA Disk
          product: TOSHIBA MK5061GS
          vendor: Toshiba
          physical id: 0
          bus info: scsi@0:0.0.0
          logical name: /dev/sda
          version: MF00
          serial: 71XYZYYYY
          size: 465GiB (500GB)
          capabilities: partitioned partitioned:dos
          configuration: ansiversion=5 signature=00025d42
     *-cdrom
          description: DVD-RAM writer
          product: BD-RE UJ232A
          vendor: MATSHITA
          physical id: 1
          bus info: scsi@1:0.0.0
          logical name: /dev/cdrom
          logical name: /dev/cdrw
          logical name: /dev/dvd
          logical name: /dev/dvdrw
          logical name: /dev/scd0
          logical name: /dev/sr0
          logical name: /media/cdrom0
          version: 1.10
          capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
          configuration: ansiversion=5 mount.fstype=udf mount.options=ro,nosuid,nodev,noexec,relatime,utf8 state=mounted status=ready
        *-medium
             physical id: 0
             logical name: /dev/cdrom
             logical name: /media/cdrom0
             configuration: mount.fstype=udf mount.options=ro,nosuid,nodev,noexec,relatime,utf8 state=mounted
     *-disk:1
          description: ATA Disk
          product: ST9500420ASG
          vendor: Seagate
          physical id: 0.0.0
          bus info: scsi@2:0.0.0
          logical name: /dev/sdb
          version: 0004
          serial: 5VXYZYYYY
          size: 465GiB (500GB)
          capabilities: gpt-1.00 partitioned partitioned:gpt
          configuration: ansiversion=5 guid=8795c9fc-5238-11e1-84e2-00216aca9b10

Find Out Disks Name Only

The following command will quickly list installed disks including CD/DVD/BD drivers:
# lshw -short -C disk
Sample outputs:

H/W path             Device      Class       Description
========================================================
/0/100/1f.2/0        /dev/sda    disk        500GB TOSHIBA MK5061GS
/0/100/1f.2/1        /dev/cdrom  disk        BD-RE UJ232A
/0/100/1f.2/1/0      /dev/cdrom  disk        
/0/100/1f.2/0.0.0    /dev/sdb    disk        500GB ST9500420ASG

Linux GUI Disk Utility

Gnome users can use the gnome-disk-utility for the following purposes:

  • Get information about installed disks and its current health.
  • Manage and configure disk drives.
  • Manage and configure media.
  • Manage and configure software RAID devices.

Type the following command or start Disk utility by visiting Applications > System Tools > Disk Utility :
$ palimpsest
Sample outputs:

Linux List Hard Drives GUI Tool & Command
Fig.01: Linux List Hard Drives GUI Tool & Command - Click to enlarge

You can view disk health by clicking on the “Smart data” button (see smartd for more information):

 

How to determine the storage type in linux
Fig.02: Samrtdata about hard disk

smartctl Command

The smartctl command act as a control and monitor Utility for SMART disks under Linux and Unix like operating systems. Type the following command to get information about /dev/sda (SATA disk):
# smartctl -d ata -a -i /dev/sda
Sample outputs:

smartctl 5.40 2010-07-12 r3124 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     TOSHIBA MK5061GSYF
Serial Number:    71XXXYYZ
Firmware Version: MF000D
User Capacity:    500,107,862,016 bytes
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Fri Feb 24 05:27:29 2012 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (  36)	The self-test routine was interrupted
					by the host with a hard or soft reset.
Total time to complete Offline 
data collection: 		 ( 120) seconds.
Offline data collection
capabilities: 			 (0x5b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					No Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 136) minutes.
SCT capabilities: 	       (0x003d)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 128
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   050    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   100   100   001    Pre-fail  Always       -       1650
  5 Reallocated_Sector_Ct   0x0033   100   100   050    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       34237
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       120
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       42
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       23
193 Load_Cycle_Count        0x0032   099   099   000    Old_age   Always       -       13971
194 Temperature_Celsius     0x0022   100   100   000    Old_age   Always       -       39 (Lifetime Min/Max 21/48)
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       3536073
200 Multi_Zone_Error_Rate   0x0032   100   100   000    Old_age   Always       -       9143982
240 Head_Flying_Hours       0x0032   099   099   000    Old_age   Always       -       28415
241 Total_LBAs_Written      0x0032   100   100   000    Old_age   Always       -       741418060
242 Total_LBAs_Read         0x0032   100   100   000    Old_age   Always       -       450708673
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Interrupted (host reset)      40%       343         -
# 2  Short offline       Completed without error       00%       186         -
# 3  Short offline       Completed without error       00%        71         -
# 4  Short offline       Completed without error       00%         0         -
# 5  Short offline       Completed without error       00%         0         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
How do I add ethtool settings to a network device permanently?
Viewed 6250 times since Mon, May 21, 2018
Top 20 OpenSSH Server Best Security Practices - good article
Viewed 10139 times since Mon, Oct 1, 2018
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 10514 times since Mon, Feb 17, 2020
RHEL: Crash kernel dumps configuration and analysis on RHEL 6
Viewed 4315 times since Sat, Jun 2, 2018
18 Quick ‘lsof’ command examples for Linux Geeks
Viewed 10933 times since Sun, Jun 30, 2019
tcpdump usage examples
Viewed 2045 times since Fri, Jul 27, 2018
How log rotation works with logrotate
Viewed 4485 times since Fri, Nov 30, 2018
How To Find Largest Top 10 Files and Directories On Linux / UNIX / BSD find
Viewed 3389 times since Mon, Oct 29, 2018
How to use yum command on CentOS/RHEL
Viewed 10391 times since Wed, Oct 17, 2018
Do you Know These 5 Use of V$session View ?
Viewed 98453 times since Thu, Jun 21, 2018