Easy Tutorial
❮ Linux Comm Sfdisk Linux Comm Ln ❯

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 [-CfghiIqtTvyYZ][-a &lt;cache partition>][-A &lt;0 or 1>][-c &lt;I/O mode>][-d &lt;0 or 1>][-k &lt;0 or 1>][-K &lt;0 or 1>][-m &lt;partition count>][-n &lt;0 or 1>][-p &lt;PIO mode>][-P &lt;partition count>][-r &lt;0 or 1>][-S <time>][-u &lt;0 or 1>][-W &lt;0 or 1>][-X &lt;transfer mode>][device]

Parameter Description:

Examples

Display the related settings of the hard disk:

# hdparm /dev/sda
 /dev/sda:
 IO_support = 0 (default 16-bit)
 readonly = 0 (off)
 readahead = 256 (on)
 geometry = 19929 [cylinders] / 255 [heads] / 63 [sectors], sectors = 320173056 [total sectors], start = 0 [starting sector]

Display the cylinders, heads, and sectors of the hard disk:

# hdparm -g /dev/sda
 /dev/sda:
 geometry = 19929 [cylinders] / 255 [heads] / 63 [sectors], sectors = 320173056 [total sectors], start = 0 [starting sector]

Evaluate the read efficiency of the hard disk:

hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 166 MB in 3.03 seconds = 54.85 MB/sec
 [[email protected] ~]# hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 160 MB in 3.01 seconds = 53.11 MB/sec
 [[email protected] ~]# hdparm -t /dev/sda
 /dev/sda:
 Timing buffered disk reads: 166 MB in 3.00 seconds = 55.31 MB/sec

Linux Command Manual

❮ Linux Comm Sfdisk Linux Comm Ln ❯