LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Test Hard Drive performance? (http://www.linuxquestions.org/questions/linux-hardware-18/test-hard-drive-performance-360225/)

voxel 09-04-2005 07:18 PM

Test Hard Drive performance?
 
I had a heck of a time trying to install SuSE 9.3 on my laptop... because suse would refuse to detect/recognize my main hard drive... and eventually someone suggested I try installing with: insmod=ide-generic ... which worked like a charm..

However, I have suspected that because of this 'generic' IDE driver I might not be getting the best performance out of my SuSE install... is there a way of testing the read/write speeds of the hard drive in comparison to what it should be?

Should I even be worrying about this? It just doesn't seem to be performing to the level I'm used to in windows...

Any help/suggestions would be greatly appreciated!

Thanks in advance,

hubcapboy 09-04-2005 07:30 PM

no promises that this won't blow your hard drive up, but I run

#/sbin/hdparm -u 1 -d 1 /dev/hda

in one of my init.d scripts to turn on dma and irq.

you can test the speed of your drive on a direct read with /sbin/hdparm -t /dev/hdx (where x is the drive, usually a if it's the master on the primary IDE)

I wouldn't fret about using a generic IDE driver. the reason IDE is a standard is to avoid having a driver for each different model. If your drive wasn't fully compatible with a generic IDE driver, you wouldn't have been able to force an IDE plug into it.

/g

voxel 09-06-2005 12:35 AM

Is there a way to check to see if DMA and IRQ are already enabled?

Snowbat 09-06-2005 02:04 AM

hdparm /dev/hda
You can see DMA status in the 'using_dma' line

hdparm -i /dev/hda
More detailed information including an indication of the particular DMA mode in use (highlighted with *) if DMA is enabled.

cat /proc/interrupts
IRQ list. Typically the primary IDE controller uses 14 and a secondary controller uses 15. Each IDE controller requires an IRQ to function. No IRQ, no drive access. hubcapboy did not 'turn on irq' with that command.

voxel 09-06-2005 11:01 AM

This is the output from the command hdparm -i /dev/hda
Code:

Model=HITACHI_DK23FB-40, FwRev=00M1A0A1, SerialNo=19N409
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=DualPortCache, BuffSize=8192kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78140160
 IORDY=yes, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5
 AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
 Drive conforms to: ATA/ATAPI-5 T13 1321D revision 3:

 * signifies the current active mode

So it looks to be using UDMA mode 2... However, I checked my BIOS, and under the IDE configuration of Primary Master (my hard drive) it states the following about DMA:

Async DMA: MultiWord DMA-2
Ultra DMA: Ultra DMA-5

Does this mean I'm not getting the best performance out of my hard drive? how can I make sure linux takes advantage of UDMA5?

Snowbat 09-06-2005 04:03 PM

Since that drive has a maximum media transfer rate of 50.2 MB/sec (for the two platter model) or 45.5 MB/sec (for the single platter), you may be limited by udma2 33 MB/sec operation although in the real world I'd be surprised if you notice any improvement using udma5.
http://www.netcomdirect.com/hitrdk40at292.html

Run a benchmark to establish your udma2 transfer rates
hdparm -t /dev/hda

Try setting udma5 mode (WARNING: MAY CAUSE DATA CORRUPTION - HAVE A BACKUP OR BE PREPARED TO REINSTALL)
hdparm -d1 -X udma5 /dev/hda

If no error, run another benchmark to check the difference.
hdparm -t /dev/hda

Also possibly worth trying is the hdparm -u 1 switch which sets the interrupt-unmask flag.
-u Get/set interrupt-unmask flag for the drive. A setting of 1
permits the driver to unmask other interrupts during processing
of a disk interrupt, which greatly improves Linux's responsive-
ness and eliminates "serial port overrun" errors. Use this fea-
ture with caution: some drive/controller combinations do not
tolerate the increased I/O latencies possible when this feature
is enabled, resulting in massive filesystem corruption. In par-
ticular, CMD-640B and RZ1000 (E)IDE interfaces can be unreliable
(due to a hardware flaw) when this option is used with kernel
versions earlier than 2.0.13. Disabling the IDE prefetch fea-
ture of these interfaces (usually a BIOS/CMOS setting) provides
a safe fix for the problem for use with earlier kernels.

voxel 09-06-2005 11:10 PM

Thank you very much for your help :)
I was able to successfully change to UDMA mode 5 without any errors and test the hard drive.. and you were right, there really isn't any difference in transfer speed :)

Now if linux defaulted to UDMA2, would it be safer to use UDMA2 if UDMA5 did not appear to offer any increase transfer speed?

Snowbat 09-07-2005 01:44 AM

I think it may be your BIOS that defaulted to udma2. If it runs udma5 in Windows, it may be a Windows driver bumping it to udma5 during boot.

http://ldp.nllgg.nl/HOWTO/Ultra-DMA-8.html#ss8.1
I doubt you'll have any problems running udma5 in Linux. You could append the hdparm command to /etc/rc.d/rc.local to switch it during boot.

5400 rpm drives are never particularly fast though. You might consider fitting a 7200 rpm drive although it will use more power and probably run hotter and noisier. The Hitachi Travelstar 7K100 60GB (for instance) has a maximum media transfer rate of 70.1 MB/sec if your laptop has an ATA-66 or ATA-100 controller to handle the pace.

(Edit: Since udma2, 4, and 5, are ATA-33, ATA-66, and ATA-100, respectively, your laptop does indeed have an ATA-100 controller.)


All times are GMT -5. The time now is 08:36 PM.