Setting HDD Parameter

August 8th, 2006 liewsheng Posted in Hardware, hdparm | Hits: 25309 | No Comments »

When I execute apt-get for some updates, it took very long period of time to finish. Lately, I realized that cause is from my HDD setting. Therefore I discover a command for hard disk parameter configuration.

To test the speed of your hard disk :

/sbin/hdparm -tT /dev/hda

where hda is the 1st IDE HDD, hdb is the 2nd, etc.

The sample output:

Timing cached reads:   968 MB in  2.00 seconds = 483.35 MB/sec
Timing buffered disk reads:  168 MB in  3.02 seconds =  55.67 MB/sec

Furthermore, you can use this command to check for more details:

/sbin/hdparm -i -v /dev/hda

To configure the HDD parameter:

/sbin/hdparm -cx -dx -ux -mxx -Xxx /dev/hda

where -c is the (E)IDE 32-bit I/O support (x can be 0 to disable, 1/2/3 is to enable 32-bit tranfer), -d indicates using dma (x : 1 to enable, 0 to disable), -u stand for interrupt-unmask flag (x :1 to enable, 0 to disable), -m is for multisector I/O (xx can be 2,4, 8 and 16 or any maximum number support by HDD, can check using -i) and finally -X is to set the transfer mode of HDD.

For example :

/sbin/hdparm -c2 -d1 -u1 -m16 -X70 /dev/hda

For more detail on this command, just use the man page:

man hdparm

Unfortunately, to fully utilize this command needs some more details of HDD, even manual is not enough. Therefore,

Further readings

  • Speeding up Linux Using hdparm, it covers the topic of hdparm’s usage, well written article.
  • HOWTO Use hdparm to improve IDE device performance, Gentoo Documentation is always well written, it gives more details examples on hdparm’s usage.
  • Leave a Reply