Hdparm can be detected to display and set the parameters of the IDE or SCSI hard disk.
Syntax
Hdparm [-partition hiiqttvyyz] [-a <cache partition>] [-A <0 or 1>] [-c <I/O mode>] [-d <0 or 1>] [-k <0 or 1>]
[-K <0 or 1>] [-m <number of partitions>] [-n <0 or 1>] [-p <PIO Mode>] [-P <number of partitions >] [-r <0 or 1>] [-S <time>]
[-U <0 or 1>] [-W <0 or 1>] [-X <transmission mode>] [device]
Parameter description:
- -A <cache partition> sets the number of partitions that are pre-stored in the block area when the file is read. If the <cache partition> option is not added, the current setting is displayed.
- -A <0 or 1> enables or disables the cache function when reading files.
- -C <I/O mode> sets the IDE32-bit I/O mode.
- -C: detects the power management mode of the IDE hard disk.
- -D <0 or 1> sets the DMA mode of the disk.
- -F writes the data in the memory buffer to the hard disk and clarifies the buffer.
- -G: displays the disk's magnetic track, head, magnetic area, and other parameters.
- -H: displays help.
- -I displays the hardware specification information of the hard disk, which is provided by the hard disk itself at startup.
- -I directly reads the hardware specification information provided by the hard disk.
- -K <0 or 1> to reset the hard disk, retain the-dmu parameter settings.
- -K <0 or 1> to reset the hard disk, retain the-APSWXZ parameter settings.
- -M <number of magnetic partitions> sets the number of partitions accessed by multiple hard disk partitions.
- -N <0 or 1> indicates an error that occurs when the hard disk is written.
- -P <PIO Mode> sets the PIO Mode of the hard disk.
- -P <number of magnetic partitions> sets the number of partitions in the cache of the hard disk.
- -When executing subsequent parameters, q does not display any information on the screen.
- -R <0 or 1> sets the read/write mode of the hard disk.
- -S <time> sets the waiting time before the hard disk enters power-saving mode.
- -T to evaluate the read efficiency of the hard disk.
- -T the reading efficiency of the flat hard disk cache.
- -U <0 or 1> allows other interruption requests to be executed simultaneously during hard disk access.
- -V displays the hard disk settings.
- -W <0 or 1> sets the hard disk write cache.
- -X <transmission mode> sets the transmission mode of the hard disk.
- -Y enables the IDE hard drive to power-saving mode.
- -Y: enable the IDE hard drive to sleep.
- -Z disables automatic power saving for some Seagate hard disks.
Instance
Display hard disk settings:
# Hdparm/dev/sda
/Dev/sda:
IO_support = 0 (default 16-bit)
Readonly = 0 (off)
Readahead = 256 (on)
Geometry = 19929 [number of cylinders]/255 [number of magnetic heads]/63 [number of sectors], sectors = 320173056 [total number of sectors], start = 0 [number of starting sectors]
Displays the number of hard disk cylinders, heads, and sectors.
# Hdparm-g/dev/sda
/Dev/sda:
Geometry = 19929 [number of cylinders]/255 [number of magnetic heads]/63 [number of sectors], sectors = 320173056 [total number of sectors], start = 0 [number of starting sectors]
Evaluate the read efficiency of a hard disk
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