The use of Hdparm HDD Detection tool in Linux system

Source: Internet
Author: User
Tags ide hard drive

Linux can use the Hdparm tool to view the relevant information on the hard disk or the hard drive to speed, optimize, modify the relevant parameters of the hard disk settings. I mainly use this tool to test the speed of the hard disk.

Hdparm (hard disk parameters)

Function Description: Display and set the parameters of the hard disk.

Grammar:

The code is as follows:

Hdparm [-cfghiiqttvyyz][-a < cache >][-a <0 or 1>][-c][-d <0 or 1>][-k <0 or 1>][-k <0 or 1>][-m < Number of partitions >][-n <0 or

1>][-p][-p < partition number >][-r <0 or 1>][-s < time >][-u <0 or 1>][-w <0 or 1>][-x < transmission mode >][device]

Parameter description:

-a< Cache partition > Set the number of blocks that are stored in advance, and if you do not add the < cache partition > option, the current setting is displayed.

-a<0 or 1> to start or turn off the cache when reading files.

-C Sets the IDE32 bit I/O mode.

-C detects the power management mode of the IDE hard disk.

-d<0 or 1> to set the DMA mode for the disk.

-F writes the data of the memory buffer to the hard disk and knows the buffer.

-G shows the magnetic track, head, magnetic area and other parameters of the hard disk.

-h displays Help.

-I displays hardware specification information for the hard drive, which is provided by the hard disk itself at boot time.

-I directly read the hardware specification information provided by the hard disk.

When-k<0 or 1> reset the hard drive, keep the-DMU parameter set.

When-k<0 or 1> reset the hard drive, keep the-APSWXZ parameter set.

-m< number > Set the number of partitions accessed by the hard disk multiple partitions.

-n<0 or 1> ignores errors that occur when the hard disk is written.

-P Sets the hard drive's PIO mode.

-p< number of zones > set the number of partitions within the hard drive cache.

-Q does not display any information on the screen when performing subsequent parameters.

-r<0 or 1> set the read/write mode of the hard disk.

-s< time > Set the wait time before the hard drive enters power-saving mode.

-T evaluates the drive's read efficiency.

-T-Pinggu read efficiency for fast drive fetches.

-u<0 or 1> allow other interrupt requests to be executed simultaneously when hard disk access.

-V displays related settings for the hard drive.

-w<0 or 1> sets the write cache for the hard drive.

-x< Transfer Mode > set the transmission mode of the hard drive.

-y enables IDE hard drive into power saving mode.

-y enables IDE hard drive into sleep mode.

-Z turns off the automatic power-saving features of some Seagate hard drives.

Hdparm Common Parameter Use example:

1, display the relevant settings of the hard disk:

The code is as follows:

[Root@oracle ~]# HDPARM/DEV/SDA

/DEV/SDA:

Io_support = 0 (default 16-bit)

readonly = 0 (OFF)

ReadAhead = 256 (ON)

Geometry = 19929[Cylinder number]/255[head number]/63[sector number], sectors = 320173056[total Sector number], start = 0[starting sector number]

2, display the hard disk's cylinder, head, sector number:

The code is as follows:

[Root@oracle ~]# hdparm-g/DEV/SDA

/DEV/SDA:

Geometry = 19929[Cylinder number]/255[head number]/63[sector number], sectors = 320173056[total Sector number], start = 0[starting sector number]

3, test the drive read speed:

The code is as follows:

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing buffered disk reads:422 MB in 3.01 seconds = 140.20 mb/sec

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing buffered disk reads:408 MB in 3.01 seconds = 135.59 mb/sec

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing buffered disk reads:416 MB in 3.01 seconds = 138.24 mb/sec

4, test the disk cache read Speed:

The code is as follows:

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing cached reads:11154 MB in 1.98 seconds = 5633.44 mb/sec

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing cached reads:10064 MB in 1.98 seconds = 5077.92 mb/sec

[Root@oracle ~]# hdparm-t/dev/xvda

/dev/xvda:

Timing cached reads:10600 MB in 1.98 seconds = 5351.73 mb/sec

5, detection of hard disk power management mode:

The code is as follows:

[Root@oracle ~]# hdparm-c/DEV/SDA

/DEV/SDA:

Drive state Is:standby [power-saving mode]

6, query and set the hard disk multiple sector access to the number of sectors to enhance the hard disk access efficiency:

The code is as follows:

[Root@oracle ~]# hdparm-m/DEV/SDA

[root@oracle ~]# hdparm-m parameter values are integer values such as 8/dev/sda

Attached: HDD Bad Track repair method

Check:

The code is as follows:

Smartctl-l SELFTEST/DEV/SDA

Unloading:

The code is as follows:

umount/dev/sda*

Repair:

The code is as follows:

Badblocks/dev/sda

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.