LinuxCommandLibrary

hdparm

SATA/IDE drive parameter control

TLDR

Get device identification

$ sudo hdparm -I /dev/sda
copy
Get APM level
$ sudo hdparm -B /dev/sda
copy
Set APM value
$ sudo hdparm -B 127 /dev/sda
copy
Show power mode
$ sudo hdparm -C /dev/sda
copy
Enter standby mode
$ sudo hdparm -y /dev/sda
copy
Set idle timeout
$ sudo hdparm -S 60 /dev/sda
copy
Test read speed
$ sudo hdparm -tT /dev/sda
copy

SYNOPSIS

hdparm [OPTIONS] device

DESCRIPTION

hdparm gets and sets parameters for SATA and IDE hard disk drives. It can display detailed device identification, configure power management settings including APM levels and standby timeouts, test read performance, and enable or disable various drive features.
The tool is essential for tuning disk power management on Linux systems. It can configure Advanced Power Management (APM) levels where values 1-127 allow spin-down and 128-254 keep the drive spinning, set standby idle timeouts, force drives into standby or sleep mode, and perform cached and buffered read speed benchmarks.

PARAMETERS

-I

Display detailed device identification
-i
Display kernel's cached identification info
-B [value]
Get or set Advanced Power Management (1-254)
-C
Display current power mode status
-S value
Set standby timeout (0=off, 1-240=5s increments, 241-251=30m increments)
-y
Force drive into standby mode
-Y
Force drive into sleep mode (may require hard reset)
-t
Test buffered read speed
-T
Test cache read speed
--security-erase password
Secure erase the drive

CONFIGURATION

/etc/hdparm.conf

Persistent configuration file for drive parameters on Debian-based systems. Settings defined here are applied at boot time, ensuring APM levels, DMA modes, and other parameters survive reboots.

CAVEATS

Some features require kernel and hardware support. APM values 1-127 allow spindown while 128-254 keep the drive spinning. Sleep mode may require power cycling to recover.

HISTORY

hdparm has been the standard Linux tool for drive parameter control since the early days of IDE drives.

SEE ALSO

smartctl(8), blkid(8), lsblk(8)

> TERMINAL_GEAR

Curated for the Linux community

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00