Linux Comm Hdparm π
2026-06-19 | π Linux
# Linux hdparm Command
[ Linux Command Manual](#)
The Linux hdparm command is used to display and set hard disk parameters.
hdparm can detect, display, and set parameters for IDE or SCSI hard disks.
### Syntax
hdparm [-c ][-S ]
**Parameter Description**:
* -a Set the number of sectors to pre-read into the cache when reading files. If the option is not specified, the current setting is displayed.
* -A Enable or disable the read-ahead cache function when reading files.
* -c Set the IDE 32-bit I/O mode.
* -C Detect the power management mode of the IDE hard disk.
* -d Set the disk's DMA mode.
* -f Write data from the memory buffer to the hard disk and clear the buffer.
* -g Display the hard disk's tracks, heads, sectors, and other parameters.
* -h Display help.
* -i Display the hardware specification information of the hard disk, which is provided by the hard disk itself during boot.
* -I Directly read the hardware specification information provided by the hard disk.
* -k When resetting the hard disk, preserve the settings of the -dmu parameters.
* -K When resetting the hard disk, preserve the settings of the -APSWXZ parameters.
* -m Set the number of sectors for multiple partition access on the hard disk.
* -n Ignore errors that occur during hard disk writes.
* -p Set the hard disk's PIO mode.
* -P Set the number of sectors for the hard disk's internal cache.
* -q Do not display any information on the screen when executing subsequent parameters.
* -r Set the hard disk's read/write mode.
* -S Set the waiting time before the hard disk enters power-saving mode.
* -t Evaluate the hard disk's read efficiency.
* -T Evaluate the hard disk cache's read efficiency.
* -u Allow other interrupt requests to execute simultaneously during hard disk access.
* -v Display the hard disk's related settings.
* -W Disable/Enable the disk's write cache. Each disk has read cache and write cache. Sometimes, disabling the disk write cache is more efficient than enabling it, so the former is chosen.
* -X Set the hard disk's transfer mode.
* -y Make the IDE hard disk enter power-saving mode.
* -Y Make the IDE hard disk enter sleep mode.
* -Z Disable the automatic power-saving function of certain Seagate hard disks.
### Examples
Display the hard disk's related settings:
# hdparm /dev/sda /dev/sda: IO_support = 0 (default 16-bit) readonly = 0 (off) readahead = 256 (on) geometry = 19929 / 255 / 63 , sectors = 320173056 , start = 0
Display the hard disk's cylinders, heads, and sectors
# hdparm -g /dev/sda /dev/sda: geometry = 19929 / 255 / 63 , sectors = 320173056 , start = 0
Evaluate the hard disk's read efficiency
hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 166 MB in 3.03 seconds = 54.85 MB/sec [root@linuxso.com ~]# hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 160 MB in 3.01 seconds = 53.11 MB/sec [root@linuxso.com ~]# hdparm -t /dev/sda /dev/sda: Timing buffered disk reads: 166 MB in 3.00 seconds = 55.31 MB/sec
[ Linux Command Manual](#)