Hdparm - Linux Disk Utility for Performance and Information

Learn how to use hdparm, a powerful Linux command-line utility, to get detailed information about hard disks and benchmark their performance.

Hdparm

Hdparm is a powerful command-line utility for Linux systems used to configure and test hard disk drives (HDDs) and solid-state drives (SSDs). It allows system administrators and advanced users to retrieve detailed information about drive parameters, optimize performance settings, and perform various diagnostic tests.

Get Drive Information

One of the primary uses of hdparm is to retrieve detailed information about a connected storage device. This can include identifying the drive model, serial number, supported modes, and advanced features.

# Get detailed information about the hard disk /dev/sda
hdparm -I /dev/sda

Benchmark Disk Performance

hdparm can also be used to benchmark the read performance of your storage devices. This is useful for identifying potential performance bottlenecks or verifying the speed of new hardware.

# Perform timings of device reads and cache reads for benchmark and comparison purposes
hdparm -tT /dev/sda

Optimize Drive Settings

Beyond information gathering and benchmarking, hdparm allows for the modification of various drive parameters, such as enabling or disabling DMA (Direct Memory Access) for IDE drives, setting read-ahead values, and managing power-saving features. It's crucial to understand the implications of changing these settings, as incorrect configurations can lead to data loss or performance degradation.

Further Resources