|
|
MAKE SURE YOU READ THE MAN PAGES FIRST.
So, you installed LINUX and the speed is not what you heard it was. Am I correct ?
We will begin by tweaking your hard drive for the fastest performance, so if you are using KDE, then exit to the console. ( because of the nature of these tweaks your computer could become unstable resulting in corrupted or lot data, therefore it should be done without X-Windows running).
if you are logged in as a normal user, type su at the command prompt then enter the password.
The command we will be using is : hdparm
You can get a list of all the commands for hdparm by typing it by itself and hitting enter.
A further explanation of these commands can be obtained by typing man hdparm
The next step will be to determine what your hard drive is called, hda, hdb, etc.
type dmesg this will display all the information that was displayed during boot.
If you have 1 hard drive then more than likely it is called: hda
Lets assume it is hda.
Now type: hdparm -I /dev/hda
This will read all sorts of information directly from the drive, telling us what it can support.
Do a speed test by typing: hdparm -t /dev/hda
Repeat this a few times and get a general idea of the speeds and write them down so when we are finished you can compare the results.
I got the results of: 4.31 MB/s
Next Type in: hdparm /dev/hda
This output tells you what the defaults are set at, you will notice that I/O support reads 16-bit, its probably not using DMA and the unmask irq is probably 0 (off), along with multicount being disabled.
type in: hdparm -c3 -m16 /dev/hda
This will turn on multireads and turn on the 32-bit flag w/sync
Now do your speed test again, what a great improvement !!!
You may want to stop here because the next few tweaks could make your computer lock up if they are not supported.
We need to turn DMA on by typing: hdparm -d1 /dev/hda
Set the unmask irq bit to on by typing: hdparm -u1 /dev/hda
Do: man hdparm to understand what this does.
And the last setting will be to set the PIO mode of your drive, so look at the information from doing hdparm -I /dev/hda and see which pio modes it supports.
Type in hdparm -p4 /dev/hda
Replace 4 with the highest number supported by your drive.
Run: hdparm -t /dev/hda
At this point I got a reading of 19.43 MB/s
Now we dont want to type in these parameters every time we reboot, so we will add them to a startup script.
Change to /etc/rc.d
I simply added them to the end of the rc.local script, because It is the last script that
is executed and any fscking is done before that point.
You can combine all these settings on one line or you can put each on a separate line if you want to make it easier to understand. Also make sure you put in a comment saying what these settings are for so you can find them easier if you need to change them.
Example: hdparm -c3 -m16 -d1 -X34 -u1 -p4 -kK /dev/hda
PLEASE NOTE: Do these things at your own risk, I am not responsible for lost or corrupted data.
Speed up your hard disk with Linux
by Craig
This is my first tut so its a little rough.
The default installation of any distribution is designed to work on a broad range of computer setups and therefore has minimal optimizations (same as Windows9x by the way).
If you already know GREAT otherwise:
If you have 2 hard drives then more than likely it is called: hdb
Before you use a particular tweak, make sure you check this information to make sure your drive supports it.
Most newer hard drives can use these settings, so we will be turning them on.
We can also turn on multiword DMA2 by typing hdparm -d1 -X34 /dev/hda
Which is a drastic improvement.