LinuxCommandLibrary

hdparm

gets and sets SATA/IDE hard drive parameters

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 SATA/IDE hard drive parameters. It can display device information, configure power management settings, test performance, and enable or disable drive features.

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

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

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community