IDE HDs II
Summary:
- RAID
- S.M.A.R.T.
- Performance Tuning
RAID
RAID (Redundant Arrays of Independent Disks) comes various flavors, with RAID-0 (striping) and RAID-1 (mirroring) being the most common. RAID can either be done in hardware (using a controller like the ubiquitous PROMISE RAID chips and controllers) or in software.
On-board RAID controller chips by Promise (e.g. on the Asus A7V) should get detected by the installer and work. The HPT368 (UDMA/66 RAID) should work, too, but might require some special boot loader parameters (read the 'HPT366 chipset support' paragraph in /usr/src/linux/Documentation/Configure.help).
If you want to use a controller card, you will usually have to download and install drivers from the vendor's page. The IDE controller list on linhardware.net has more information on this topic. Another valuable source of information is RAID solutions for Linux.
S.M.A.R.T.
S.M.A.R.T. is the 'Self-Monitoring, Analysis and Reporting Technology' used in most modern IDE hard drives. It is used to check the reliability of the drive and predict drive failures. To put this technology to use in GNU/Linux, you need to enable S.M.A.R.T. in your system's BIOS and you need a program like the UCSC S.M.A.R.T. Suite or ide-smart (Mandrake Contrib RPM). They allow you to run tests (even periodically) and will warn you, if drive parameters drift out of range (indicating an upcoming drive failure).
Handling is very simple (as 'root'):
ide-smart -d /dev/{device} -q
will run a quiet test, only returning messages if there was an error.
Performance Tuning
- The first rule is to refrain from connecting any kind of slave device to a port which already has an IDE master disk. If you really need a second disk, use the second port, and if you've already got a CD/DVD there, get a controller card.
- The second rule is to keep cables as short as possible. The longer the cable the higher the possibility of data transfer errors.
- More RAM ;-). GNU/Linux makes a generous use of RAM for caching disk accesses. Low memory resources will lead to thrashing (i.e. swapping memory to and from the hard disk). Yes, there is the swap file, but the best swap file is an unused swap file1.1
- Think big1.1 Larger disks are (usually) faster. Remember however that more speed in most cases also means more heat and more noise.
Those of you who are familiar with M's history might remember the infamous 6.0 initscript bug, where a 'hdparm' parameter lead to freezes on some systems.
Later on, using 'hdparm' optimization became an installation option along with an appropriate warning. It has been removed again since because it caused trouble on some systems.
It isn't all that dangerous provided you know what you are doing and if you use the right options. And the disk speed will increase significantly even with the conservative settings I'm going to describe here.
hdparm -i /dev/hd{x}
hdparm /dev/hd{x}
hdparm -Tt /dev/hd{x}
Optimization Examples
Since I usually use
hdparm
I turn on 32-bit I/O support. I'm using setting '3' which is slightly slower than '1' but more secure:
hdparm -c3 /dev/hda
Now the benchmark shows a value around 5.8 MB which is already a significant increase.
What about (U)DMA?
hdparm -d1 /dev/hda
The benchmark takes a huge leap up to 15 MB/sec. Note that this command will automatically put the drive to the highest available transfer mode (UDMA/33 here), so there is no need to specify the
-X34
And that's all there is to it:
hdparm -c3d1 /dev/hda
-m16
-u1
You might have heard about the
hd{x}=autotune
Mandrake Linux user Roger shares his thoughts:
"One could either add to '/etc/lilo.conf':
append=" hda=dma hdb=dma hdd=ide-scsi quiet hdc=ide-floppy opti"
I'm also seeing some other options for the append line in 'lilo.conf' such as
idex=ata66
Or, for Mandrake 8.1, I added a new file, called '/etc/rc.d/init.d/hdparm-settings': ~#Tweak drives for best speeds1.1 ~#WDC WD273BA 27.3GB 66MB/sec 7200RPM UDMA4 hdparm -c1 -m0 -d1 -X68 -S253 /dev/hde
~# WDC WD400BB-00AUA1 40GB 100MB/sec 7200RPM UDMA5 hdparm -c1 -m0 -d1 -X69 -S253 /dev/hdg
~# WDC WD102BA 10.2GB 66MB/sec 7200RPM UDMA4 hdparm -c1 -m0 -d1 -X68 -S253 /dev/hdf
Now, add this to your run level. I used /usr/bin/ksysv (as root) to add this to my run-level 5. An easier and less messy way of doing this is just adding these few lines anywhere inside your '/etc/rc.d/rc.local', only con is that it will execute at the end of the boot process. Since I have ultra dma hdd's, I enabled udma option by adding the "-X" option. Not well documented in the man page of hdparm, so here's the options for "-X": 33 multiword DMA mode1 66 UDMA2 68 UDMA4 (My two Ultra66 hdd's support this) 69 UDMA5 (My Ultra100 hdd supports this)
To find out of which your hdd supports & is currently set to, do the following:
# hdparm -i /dev/hdx<br> DMA modes: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
There's another option called
multcount
I'm also not seeing much in improvement by enableing UDMA4/5 but, my drives support it so why not? Eh? Just be advised that messing with these options could cause corruption with your filesystem, so be safe and make regular backups. The '-c' option is obsolete from what I've just read. It was mainly used on drives prior to 66/100 drives. The '-S240' option is not needed...it only sets the 'sleep option' for the hdd's to ~20 minutes."
Mandrake Linux user Hoyt Duff adds:
"You might want to give the boot option
ide0=0x1f0
floppy=daring
Sleep Mode
hdparm
hdparm -S{xxx}
man hdparm
Notice that the hard drive 'sleep' function puts a great deal of mechanical strain on the hard drive when 'waking it up'. Furthermore does the Linux drive access cache prevent a drive with mounted partitions on it from going into 'sleep' mode. The 'noflushd' package from your Mandrake Linux CD enables you to work around that. You should make sure to its man page before using it, though.
Once you've found a suitable setting, execute the 'hdparm' command again, adding the 'k' option. This will preserve your settings beyond the current session.
Related Resources:
man smartctl
man hdparm
Speeding up Linux Using hdparm
HOWTO: Multi Disk System Tuning
Revision / Modified: Dec. 18, 2001 / Feb. 13, 2002
Author: Tom Berger
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!