LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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
-g
Display drive geometry (cylinders, heads, sectors, size)
-M [value]
Get or set Automatic Acoustic Management (0=off, 128=quiet, 254=fast)
-W [value]
Get or set write-caching (0=off, 1=on)
-F
Flush drive write cache
--security-erase password
Secure erase the drive (WARNING: destroys all data)

CAVEATS

Some features require kernel and hardware support. APM values 1-127 allow spindown while 128-254 keep the drive spinning. Sleep mode (-Y) may require power cycling to recover. When no options are given, -acdgkmur is assumed.

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)

Copied to clipboard
Kai