# Hard disks faster in suse than gentoo?

## murphydog

I have two hardrives, hdb and hdd (They are on cable select and thats the only way the cable fitted so they are now slaves  :Shocked:  )

Hdb has Suse 8.2 pro on it and is a Maxator 80GB 7200rpm.

hdd has gentoo (gentoo-dev-sources 2.6.3) and is (i think) a seagate 60GB 7200rpm.

These are the hdparm results from gentoo

```
bash-2.05b# hdparm -tT /dev/hdb

/dev/hdb:

 Timing buffer-cache reads:   496 MB in  2.00 seconds = 247.54 MB/sec

 Timing buffered disk reads:   94 MB in  3.06 seconds =  30.71 MB/sec

bash-2.05b# hdparm -i /dev/hdb

/dev/hdb:

 Model=Maxtor 6Y060L0, FwRev=YAR41VW0, SerialNo=Y2SN9XHE

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=120103200

 IORDY=on/off, tPIO={min:120,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 udma6

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: (null):

 * signifies the current active mode

bash-2.05b# hdparm /dev/hdb

/dev/hdb:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 65535/16/63, sectors = 120103200, start = 0

bash-2.05b# hdparm -tT /dev/hdd

/dev/hdd:

 Timing buffer-cache reads:   476 MB in  2.01 seconds = 236.50 MB/sec

 Timing buffered disk reads:   44 MB in  3.02 seconds =  14.56 MB/sec

bash-2.05b# hdparm -i /dev/hdd

/dev/hdd:

 Model=ST340015A, FwRev=3.01, SerialNo=5LA06QSV

 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4

 BuffType=unknown, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78165360

 IORDY=on/off, 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=no WriteCache=enabled

 Drive conforms to: device does not report version:

 * signifies the current active mode

bash-2.05b# hdparm /dev/hdd

/dev/hdd:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 65535/16/63, sectors = 78165360, start = 0
```

And these from suse

```
linux:/home/homepc # hdparm -tT /dev/hdb

/dev/hdb:

 Timing buffer-cache reads:   128 MB in  0.96 seconds =133.33 MB/sec

 Timing buffered disk reads:  64 MB in  1.47 seconds = 43.54 MB/sec

linux:/home/homepc # hdparm -i /dev/hdb

/dev/hdb:

 Model=Maxtor 6Y060L0, FwRev=YAR41VW0, SerialNo=Y2SN9XHE

 Config={ Fixed }

 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57

 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16

 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=120103200

 IORDY=on/off, tPIO={min:120,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 udma6

 AdvancedPM=yes: disabled (255) WriteCache=enabled

 Drive conforms to: (null):  1 2 3 4 5 6 7

linux:/home/homepc # hdparm /dev/hdb

/dev/hdb:

 multcount    = 16 (on)

 IO_support   =  1 (32-bit)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    =  8 (on)

 geometry     = 7476/255/63, sectors = 120103200, start = 0

 linux:/home/homepc # hdparm -tT /dev/hdd

/dev/hdd: Input/output error
```

(For some reason suse keeps saying that hdd has a bad superblock when i try and mount it, but it works fine with gentoo.)

As you can see, under suse hdb is about 50% faster than under gentoo. Hdd is pitifully slow under gentoo, and doesn't work with suse.

I assume this is because i haven't configured gentoo properly. 

Can anyone tell me where i've gone wrong?

Thanks in advance

Richard.

----------

## moocha

Wrong IDE chipset driver compiled into the Gentoo kernel? Or maybe correct driver compiled in, but you forgot to remove Generic IDE chipset support and that one's getting used?

----------

## murphydog

Thanks for the reply. I did have the generic IDE chipset compiled in, so i removed it, but it seemed to make little difference.

I have a Jetway 663AS Pro mother board, so now in my kernel config i have 

```

< >     generic/default IDE chipset support

[ ]       Generic PCI IDE Chipset Support

<*>         VIA82CXXX chipset support

```

The mother board manual says: 

VIA VT8363/VT 82C686B KT-133 Chipset

Does that sound right?

Any other ideas?

Thanks

Richard

----------

## revertex

why it does't work with cable select?

turn off your pc

disconect both disks

change the jumper to cs

conect only one hd at the end of the cable

power on(do not connect the second disk)

look at your bios if everithing is ok(udma,etc...)

run your benchmarks

repeat these steps with the other disk.

kinda weird, both disks has the same cache(2mb).

is your cable a 80 pin?Last edited by revertex on Mon May 03, 2004 3:30 pm; edited 1 time in total

----------

## WaVeX

Sorry  to go a little off topic here. But what does cable select do anyways.  I've wondered this for years. Never used it before.

----------

## moocha

 *murphydog wrote:*   

> I have a Jetway 663AS Pro mother board, so now in my kernel config i have 
> 
> ```
> 
> < >     generic/default IDE chipset support
> ...

 

Yup, that's exactly right...

 *murphydog wrote:*   

> Any other ideas?

 

Not at the moment, but I'll keep on it - it's made me curious. And it has to be software-related since the hardware configuration didn't change between Gentoo and SuSE. Very strange.

 *WaVeX wrote:*   

> Sorry to go a little off topic here. But what does cable select do anyways. I've wondered this for years. Never used it before.

 

http://www.pcguide.com/ref/hdd/if/ide/confCS-c.html  :Smile: 

----------

## revertex

hummm, try play with different hdparm configs, just search in these foruns for "hdparm"  and you will find a lot of usefull settings.

----------

## Gentree

 *WaVeX wrote:*   

> Sorry  to go a little off topic here. But what does cable select do anyways.  I've wondered this for years. Never used it before.

 

not your main point but CS is for a cable with a crossover pair in the cable that sets the master or slave status by its position on the cable. Thus you put the two dirves on CS and let the hardware connection determine who is master.

More usually you chose which is Master and slave with jumpers and use a unbiased cable that connects both drives identically from an electrical point of view.

Be sure to select one MA and one SL in the latter case and verify that you cable does not have on pair or wires cross-over inbetween the two connecters to the disks.

I have had some disks which dont work with the jumper in certain positions . ie they are faulty but do work reliably if you let them have the position they want.

Each time you change something obviously go through the BIOS on reboot (this may explain hdd u/s on SUSE)

Getting back to murphydog's question:

In fact some of the performance figures were better under Gentoo for hdb: 247 Mb/s againt 133 !

Are these results repeatable or do you get largely varying results if you rerun hdparm?

It seems a bit odd that there is such a major diff but obvioulsy you dont have the same detailed control over your kernel options on SUSE so its hard to do an accurate comparison.

dmesg | grep DMA 

will show you if DMA and UDMA are setting up correctly on boot. This may shed some light.

HTH  :Cool: 

----------

## Nate_S

I noticed that the drives are using different udma modes

hdb:

 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma6 

hdd:

 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5 

 * signifies the current active mode 

the udma 5 versus the udma2 probly causes the speed difference you're seeing.  

I think udma5 is ATA133 and udma2 is ATA66.  If the software settings are all right, check your ide cables, be sure that they are both 80wire and also remember that they can get damaged pretty easily if they are very bent or twisted (i've had that happen before)

-Nate

----------

## moocha

UDMA2 is ATA33 (the highest mode you can get without an 80 wire cable), and UDMA5 is ATA100.

----------

## MadEgg

 *moocha wrote:*   

> UDMA2 is ATA33 (the highest mode you can get without an 80 wire cable), and UDMA5 is ATA100.

 

Would UDMA6 be ATA133 then?

----------

## moocha

 *MadEgg wrote:*   

> Would UDMA6 be ATA133 then?

 

Yup.

----------

## Gentree

 *Quote:*   

> the udma 5 versus the udma2 probly causes the speed difference you're seeing.

 

I think the speed diff he was refering to was the diff between Gentoo and SUSE on hdb , not the diff between the drives which are physically very different.

----------

## murphydog

First off thanks for all the replys.

 *Quote:*   

> Are these results repeatable or do you get largely varying results if you rerun hdparm?

 

They are all repeateable, but now and again (usually the first one or two times hdparm is run) they are lower. I've always assumed this to be because the disk is being used in the background, but i may be wrong

I tried dmesg | grep DMA in gentoo, but it didn't return anything, so i tried straight dmesg and it is full of crap like

```
IN=eth0 OUT= MAC=00:50:ba:c6:99:1c:00:09:f3:04:18:c0:08:00 SRC=68.38.124.101 DST=10.0.0.10 LEN=52 TOS=0x00 PREC=0x00 TTL=113 ID=4550 DF PROTO=TCP SPT=4670 DPT=32805 WINDOW=17184 RES=0x00 ACK FIN URGP=0

IN=eth0 OUT= MAC=00:50:ba:c6:99:1c:00:09:f3:04:18:c0:08:00 SRC=83.31.158.91 DST=10.0.0.10 LEN=44 TOS=0x00 PREC=0x00 TTL=48 ID=0 DF PROTO=TCP SPT=411 DPT=33235 WINDOW=5808 RES=0x00 ACK SYN URGP=0

IN=eth0 OUT= MAC=00:50:ba:c6:99:1c:00:09:f3:04:18:c0:08:00 SRC=83.31.158.91 DST=10.0.0.10 LEN=44 TOS=0x00 PREC=0x00 TTL=48 ID=0 DF PROTO=TCP SPT=411 DPT=33235 WINDOW=5808 RES=0x00 ACK SYN URGP=0

```

I take it this is a seperate problem with eth0  :Sad:   (eth0 is connected to an adsl router, if that makes any difference)

I'm not sure why hdd is only at udma2. It has a new 80 wire cable, but it seems to be stuck at udma2. 

If i put the jumpers to master and slave instead of cable select, will they still work at the same speed, or will they both revert to udma2?

 *Quote:*   

> I think the speed diff he was refering to was the diff between Gentoo and SUSE on hdb , not the diff between the drives which are physically very different.

 

Yes thats right. I was about to move gentoo to hdb to get the extra speed, when i noticed that the drives were faster in suse. Although if anyone can get hdd running faster please feel free, as theoretically it should be about the same speed as hdb  :Wink: 

Richard

----------

## huw

the IP stuff in dmesg is logging from iptables, it's not a problem with your ethernet card.

----------

## Wabkebab

I have the same problem with the CDROMS, between gentoo and mandrake 9.2. On gentoo the performance is quite poor, and in the other hand, on mandrake it's excelent!

Initially when I did hdparm /dev/hda (My 16x DVD / 48x CDROM) I get the astoning 615 kB/s transfer rate, and playing with hdparm(seting up udma2 and PI0 mode 4, the settings supported by the motherboard and the drive) I reached to 1.30 Mb/s.

Note: My HD has a 38 Mb/s transfer rate.

Any ideas?   :Rolling Eyes: 

----------

## murphydog

Does anyone have any more ideas? 

Are there any configeration files I can copy over from suse to gentoo, or is there any way of telling if its a kernel thing or some other problem. Does suse have some magic kernel patch that makes hard disks faster  :Shocked:  ?

Regards,

Richard

----------

## Rainmaker

try hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hdb

these are "Safe performance-enhancing options"

Try looking at man hdparm for tweaking the settings a bit for your drive

----------

## molander

I may be missing something here.

Gentoo:

```

bash-2.05b# hdparm -tT /dev/hdb 

/dev/hdb: 

 Timing buffer-cache reads:   496 MB in  2.00 seconds = 247.54 MB/sec 

 Timing buffered disk reads:   94 MB in  3.06 seconds =  30.71 MB/sec 

```

Suse:

```

linux:/home/homepc # hdparm -tT /dev/hdb 

/dev/hdb: 

 Timing buffer-cache reads:   128 MB in  0.96 seconds =133.33 MB/sec 

 Timing buffered disk reads:  64 MB in  1.47 seconds = 43.54 MB/sec 

```

Looks to me like your gentoo system is faster than Suse for buffer-cache reads. The disk reads are a touch slower in gentoo but that could be due to the smaller file size. My suggestion is to copy over hdparm from one to the other and see if it will use the same test file sizes. Also curious is the read ahead is 256 in gentoo but only 8 in suse. You can specify that by using a "-a". That may also account for part of the difference.

----------

## moocha

 *molander wrote:*   

> My suggestion is to copy over hdparm from one to the other and see if it will use the same test file sizes.

 

That will not change anything since hdparm doesn't test by reading files.

----------

## murphydog

I've tried messing about with hdparm settings from the man page and also other threads on this forum, and the drive seems to be fastest with those original settings from the first post.

I tried lowering the read ahead to 64 from 256 in gentoo on hdb and the disk reads stayed the same at approx 30mb/s. I then lowered it to 8 (like suse's) and the disk reads dropped to 19mb/s. I then booted into suse and raised the reaad ahead to 64 , expecting a performance increase like in gentoo, but the disk reads stayed at  about 44. When i tried 256 in suse it said it was an invalid option.

Does this make any sense? Or is my computer haunted by gremlins....

Thanks for all your help,

Richard

----------

## jokernel

Are you using different kernels?

Are you using ACPI?

----------

## murphydog

 *Quote:*   

> Are you using different kernels? 

 

Yes. Suse has the stock kernel it installed itself (8.2 pro) and gentoo has gentoo-dev-sources 2.6.3

 *Quote:*   

> Are you using ACPI?

 

No i don't think i am in gentoo. The only bits selected in the whole of the power management section are 

```
[*] Power Management support

[*]   Software Suspend (EXPERIMENTAL)
```

I think suse might use acpi because it turns itself off, but gentoo doesn't (  :Question:  )

Would it make a difference?

Thanks

Richard

----------

## molander

 *moocha wrote:*   

>  *molander wrote:*   My suggestion is to copy over hdparm from one to the other and see if it will use the same test file sizes. 
> 
> That will not change anything since hdparm doesn't test by reading files.

 

Didnt say that it did. I am wondering if the suse version of hdparm prefers different test properties than the gentoo version.

----------

## jokernel

 *Quote:*   

> I think suse might use acpi because it turns itself off, but gentoo doesn't (  ) 
> 
> Would it make a difference?

 

On some boards it does.

On 2.6 kernel try 

hdparm -a 4096 ...

or bigger

and

check the performance with 

hdparm -t /dev/hdaX

hdaX your root partition

----------

## Gatak

Do not use hdparm for testing =) use dd_rescue /dev/hdX /dev/null to test. That will do a sequential read of the whole disk (or untill you ctrl-c it) and it continously outputs transfer speeds.

emerge dd-rescue

----------

## jokernel

 *Quote:*   

> Do not use hdparm for testing =)

 

Why?  :Shocked: 

----------

## Gatak

Because hdparm does not test to read lots of MB, but only a few. dd_rescue will let you read all over the harddisk the same way on both harddisks.

----------

## jokernel

If you want to check the entire hard disk then you are right.

But in this case you want to check that nothing seriously misconfigured in your kernel. Hdparm fast and quite reliable for this.

----------

