hdparm command provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem. Some options may work correctly only with the latest kernels.

Getting hard disk information
You can safely use hdparm to get hard disk information. For example, try out following command to get information about SCSI hard disk (login as the root user):

# hdparm /dev/sda

OR get detailed information:

# hdparm –I /dev/hda



ATA device, with non-removable media
Model Number:       SAMSUNG SP0822N                      
Serial Number:      S06QJ10Y123456   
Firmware Revision:  WA100-31
Used: ATA/ATAPI-6 T13 1410D revision 1
Supported: 7 6 5 4 & some of 7
Logical  max current
cylinders 16383 65535
heads  16 1
sectors/track 63 63
CHS current addressable sectors:    4128705
LBA    user addressable sectors:  156368016
LBA48  user addressable sectors:  156368016
device size with M = 1024*1024:       76351 MBytes
device size with M = 1000*1000:       80060 MBytes (80 GB)
LBA, IORDY(can be disabled)
Queue depth: 1
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = ?
Recommended acoustic management value: 254, 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
Enabled Supported:
NOP cmd
  * Host Protected Area feature set
  * Look-ahead
  * Write cache
  * Power Management feature set
Security Mode feature set
SMART feature set
  * FLUSH CACHE EXT command
  * Mandatory FLUSH CACHE command
  * Device Configuration Overlay feature set
  * 48-bit Address feature set
Automatic Acoustic Management feature set
SET MAX security extension
  * SMART self-test
  * SMART error logging
Master password revision code = 65534
not enabled
not locked
not frozen
not expired: security count
supported: enhanced erase
HW reset results:
CBLID- below Vih
Device num = 1 determined by the jumper
Checksum: correct

You can also find out how fast your hard disk can read or write (cache) data. Run following command 2-3 times to get meaningful results:

# hdparm –tT /dev/hda


Timing cached reads:   1008 MB in  2.00 seconds = 502.96 MB/sec
Timing buffered disk reads:   54 MB in  3.09 seconds =  17.46 MB/sec

Setting hard disk parameters
Setting parameter can be dangerous. Your OS/Linux kernel is optimized to autodetect the correct settings for most hard drives. Do not try to set new values using hdparm command. Wrong parameter may result into loss and/or corruption of data. Read man page of hdparm for all options. You can configure your hard disk using /etc/hdparm.conf under Debian Linux. Under RedHat Linux try /etc/sysconfig/harddisk file.

Caution: Do not modify above files, leave files, as it is unless you know exactly what you are doing.

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

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
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 jobs killall kill pidof pstree pwdx time
Searchinggrep 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
0 comments… add one

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