linux-optimize-performance-of-hard-drive-with-hdparm
WHY HDPARM?
You may not believe it but your hard drive is most likely a bottle neck to your computer performance. Of course processors are where all the action is at and when you're buying, get the fastest you can afford... 64 bit is becoming the standard in new PC's and new OS's so you should always get a 64 bit processor. Multiple cores and especially multiple processors will require applications that can make use of all of that.
RAM is the easiest to upgrade and it makes a significant difference if you have many apps runing at once...
BUT your hard drive, often in laptops at a measly 5400 rpm's and the larger it is the harder it will be to get to data (even with all of the fancy caching and controllers) - so your 20GB at 5400rpm might actually feel faster than your 250GB at 5400rpm.
Not only do you want 10,000 or 15,000 rpm's but you'd probably like to optimize how your OS uses your hard drive... or most especially for all of us stuck with old IDE's, you want to get the most out of what you've got...
linux will by default use conservative settings for IDE so we will use the utility "hdparm" to improve...
HDPARM INSTALL
apt-cache search hdparm apt-get install hdparm
TEST YOUR HARDDRIVE WITH HDPARM
fdisk -l //list what disks are available hdparm -i /dev/hda //information about the drive
hdparm -tT /dev/hda //test the drive for cache & buffer speeds
/dev/hda: Timing cached reads: 274 MB in 2.00 seconds = 136.73 MB/sec Timing buffered disk reads: 60 MB in 3.02 seconds = 19.84 MB/sec
This was on an ibm r31 laptop (5400 rpm)
OPTIMIZE YOUR HARD DRIVE WITH HDPARM
according to "man hdparm":
hdparm -i /dev/hda
m = get sector count , the -i flag can be used to find the maximum setting supported MaxMultSect=16 d= DMA mode allows hard drives direct access to system memory, BEWARE that if you have faulty hardware, poorly written drivers, etc. this may cause problems u= Get/set interrupt-unmask flag for the drive (allows the OS to process other interrupts while working with a disk interrupt) c= enable 32bit I/O support (pretty standard stuff now that we're in 2010)
hdparm -m16 -d1 -u1 -c1 /dev/hda
/dev/hda: setting 32-bit IO_support flag to 1 setting multcount to 16 setting unmaskirq to 1 (on) setting using_dma to 1 (on) multcount = 16 (on) IO_support = 1 (32-bit) unmaskirq = 1 (on) using_dma = 1 (on)
hdparm -tT /dev/hda //test again after "optimizing" = exactly the same because my kernel was already using!
"since the kernel configuration selected already attempts to optimize the drives, it might be that little can be gained through tweaking"