T hdparm hard disk parameter settings/Detection

Source: Internet
Author: User
Signature method:

[Root @ test/root] # hdparm [-cdmxtt] [Register by name]

Data Description:

-C: provides an Access Mode of 32 bits. The supported regions include:

-C0: 32-bit Access Mode

-C1: Enable the 32-bit metadata access mode.

-C3: Enable the 32-bit meta access mode in sync mode (recommended value)

-D: whether to enable the DMA mode of the drive. The value 0 indicates the drive mode and the value 1 indicates the drive mode.

-M: Set the multiple sector I/O mode. Generally, the recommended value is 16.

-X: sets the IDE/ATA mode. The following settings are supported:

-X34: Enable memory DMA mode 2 (ATA)

-X66: Enable ultra DMA mode 2 (ata66)

-T: the access efficiency of the zookeeper region Cache

-T: indicates the Real-time access efficiency of a hard drive (correct !)

Example:

[Root @ test/root] # hdparm-Tt/dev/hda <= cached hda

Real-world performance
[Root @ test/root] # hdparm-D0/dev/hda <= DMA mode!

[Root @ test/root] # hdparm-D1-C3-x66/dev/hda <= enable or disable the DMA mode in

DMA 66 with a 32-bit Access Mode Enabled

Description:

This command must be run as root! In addition, note that-x

This metric is very dangerous, unless you have a good understanding of your hard drive architecture, otherwise it is not recommended to set it by yourself, because manual

The page indicates this point ~~ However, no matter what, it is currently larger than 2 GB

At least all the hard disks above have supported DMA 33! Because? Using objective a-x66 should be feasible! The usual hard drive DMA activation function is available

Table of contents:

Hdparm-D1-x66-M16-C3/dev/hda. In addition, the current Linux operating system is usually enabled.

The DMA mode, so the importance of this command function is reduced! However, it is still quite important that the-C

It is related, that is, the access mode of-C0, so you can add-C3 above to open the access mode of 32-bit RMB!

Of course, if your hard drive is really very old, don't open it!

Okay! So how to activate the dynamic DMA mode ?! You can merge the preceding command

/Etc/rc. d/rc. Local!

1. Enable hard drive DMA support.

After the system is installed, the hard drive DMA is not enabled.
/Etc/rc. d/RC. add a line/sbin/hdparm-D1-C3-M16/dev/hda at the end of the local disk. In this way, the DMA of the hard disk will be enabled after the machine is started, you do not have to set the parameters for each manual operation.

If your hard drive supports ata33, you can add the-x66 value. The value of ata66 is-x68, if my hard drive is ata66, then the complete data volume is/sbin/hdparm-D1-x68-C3-M16/dev/hda over my hard drive, before the DMA function is enabled, the actual failover efficiency is about 4.10 MB per second. After the DMA function is enabled, the average fetch efficiency per second is increased to 20 MB, which is about 5 times higher than the average.

§ Zookeeper when DMA is not enabled

[Root @ firefly/root] # hdparm-D0/dev/hda

/Dev/hda:

Setting using_dma to 0 (off)
Using_dma = 0 (off)

[Root @ firefly/root] # hdparm-Tt/dev/hda

/Dev/hda:

Timing buffer-Cache reads: 128 MB in 2.75 seconds = 46.55 MB/sec
Timing buffered disk reads: 64 MB in 15.58 seconds = 4.11 MB/sec

§ Result of dynamic sequence after DMA Activation

[Root @ firefly/root] # hdparm-D1-x68-C3-M16/dev/hda

/Dev/hda:

Setting 32-bit I/O support flag to 3
Setting multcount to 16
Setting using_dma to 1 (on)
Setting xfermode to 68 (ultradma mode4)
Multcount = 16 (on)
I/O support = 3 (32-bit w/Sync)
Using_dma = 1 (on)

[Root @ firefly/root] # hdparm-Tt/dev/hda:

Timing buffer-Cache reads: 128 MB in 2.75 seconds = 46.55 MB/sec
Timing buffered disk reads: 64 MB in 3.20 seconds = 20.00 MB/sec

From the above data records, we can see whether or not the hard disk DMA is enabled, which has a great impact on the bandwidth efficiency.

Follow up !!

There is a point in this site, but it does not seem quite easy.
Http://www.chinaunix.net/bbsjh/1/11932.html
Http://chinaunix.net/forum/viewtopic.php? T = 8576 & START = 0 & postdays = 0 & postorder = ASC & Highlight =

Hdparm or setcdProgramTo reduce the speed of the optical drive.

Hdparm-E [speed] [CDROM device]

Setcd-X [speed] [CDROM device]

Echo current_speed: 4>;/proc/IDE/[CDROM device]/settings

However, you need the root permission. The following command is also useful:

Echo file_readahead: 2000000>;/proc/IDE/[CDROM device]/settings

This sets the file pre-read to 2 MB, which is good for Scratch CD-ROM. If you set this value too large, your optical drive will keep switching, significantly reducing efficiency. We recommend that you also use hdparm to adjust your CD-ROM drive:

Hdparm-D1-A8-U1 (CDROM device)

Enable DMA access, pre-read, and IRQ unmasking (read the man page of hdparm for details ).

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.