# sata slower than ata ?!

## SzczechoO

Hi!

I was playing a little with hdparm and I've found out that my sata drive with 8mb cache is actually slower than ata drive with 2 mb cache.

Here is the specification of my hardware:

abit nf7-s v 2.0

seagate barracuda vii 7200 120gb 8mb cache sata connected to sil3112

seagate barracuda vii 7200 80gb 2 mb cache ata connected to promise 20268

hdparm from sata 

```
# hdparm -i -M -m 1 -d -a -c 3 -u 1 -t -T -X 69 /dev/hdi

/dev/hdi:

 setting 32-bit IO_support flag to 3

 setting multcount to 1

 setting unmaskirq to 1 (on)

 setting xfermode to 69 (UltraDMA mode5)

 multcount    =  1 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 readahead    = 256 (on)

 Model=ST3120026AS, FwRev=3.05, SerialNo=3JT0ASLW

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

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

 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=1

 CurCHS=65535/1/63, CurSects=4128705, LBA=yes, LBAsects=234441648

 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

 AdvancedPM=no WriteCache=enabled

 Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2:

 * signifies the current active mode

 acoustic     =  0 (128=quiet ... 254=fast)

 Timing buffer-cache reads:   1956 MB in  2.00 seconds = 976.20 MB/sec

 Timing buffered disk reads:  130 MB in  3.03 seconds =  42.84 MB/sec
```

hdparm from ata

```
# hdparm -i -M -m 1 -d -a -c 3 -u 1 -t -T -X 69 /dev/hde

/dev/hde:

 setting 32-bit IO_support flag to 3

 setting multcount to 1

 setting unmaskirq to 1 (on)

 setting xfermode to 69 (UltraDMA mode5)

 multcount    =  1 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 readahead    = 256 (on)

 Model=ST380011A, FwRev=3.06, SerialNo=3JV2N4Q2

 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=1

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

 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: ATA/ATAPI-6 T13 1410D revision 2:

 * signifies the current active mode

 acoustic     =  0 (128=quiet ... 254=fast)

 Timing buffer-cache reads:   1940 MB in  2.00 seconds = 969.66 MB/sec

 Timing buffered disk reads:  160 MB in  3.02 seconds =  52.97 MB/sec
```

I understand the advantage of 8mb cache at sata and the result of Timing buffer-cache reads but why is sata slower at Timing buffered disk reads by 10MB/sec ?

----------

## Little Nemo

You should at least connect both disks to the same controller before making comparisons. An inadequate driver might slow it down. hdparm produces the following result for my disk:

```

# hdparm -i -M -m 1 -d -a -c 3 -u 1 -t -T -X 69 /dev/hde

/dev/hde:

 setting 32-bit IO_support flag to 3

 setting multcount to 1

 setting unmaskirq to 1 (on)

 setting xfermode to 69 (UltraDMA mode5)

 multcount    =  1 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 readahead    = 256 (on)

 Model=Maxtor 6Y160M0, FwRev=YAR51FW0, SerialNo=Y43A6MFE

 Config={ Fixed }

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

 BuffType=DualPortCache, BuffSize=7936kB, MaxMultSect=16, MultSect=1

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

 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

 AdvancedPM=yes: disabled (255) WriteCache=enabled

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

 acoustic     =  0 (128=quiet ... 254=fast)

 Timing buffer-cache reads:   128 MB in  0.19 seconds =670.26 MB/sec

 Timing buffered disk reads:  64 MB in  1.15 seconds = 55.81 MB/sec

```

The Maxtor disk has an 8GB cache, too, and it's connected to a VIA onboard controller on an Asus 8KV SE deluxe. My guess is that the SATA controller you've attached your disk to is the culprit, not the disk itself.

----------

## SzczechoO

 *Quote:*   

> You should at least connect both disks to the same controller before making comparisons. An inadequate driver might slow it down.

 

OK, I've got another ata hdd (seagate barraduda vii 7200 2 mb cache 120gb)which is also connected to sil3112 through serillel 1 (ata->sata) adapter. The output from this one:

```
# hdparm -i -M -m 1 -d -a -c 3 -u 1 -t -T -X 69 /dev/hdk

/dev/hdk:

 setting 32-bit IO_support flag to 3

 setting multcount to 1

 setting unmaskirq to 1 (on)

 setting xfermode to 69 (UltraDMA mode5)

 multcount    =  1 (on)

 IO_support   =  3 (32-bit w/sync)

 unmaskirq    =  1 (on)

 using_dma    =  1 (on)

 readahead    = 256 (on)

 Model=ST3120022A, FwRev=3.06, SerialNo=3JT168GQ

 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=1

 CurCHS=65535/1/63, CurSects=4128705, LBA=yes, LBAsects=234441648

 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: ATA/ATAPI-6 T13 1410D revision 2:

 * signifies the current active mode

 acoustic     =  0 (128=quiet ... 254=fast)

 Timing buffer-cache reads:   1920 MB in  2.00 seconds = 959.19 MB/sec

 Timing buffered disk reads:  158 MB in  3.02 seconds =  52.24 MB/sec
```

as you can see native sata drive is slower than this one by 10mb/s also

----------

## Little Nemo

Okay. Of course the SATA driver for your controller might be slowing down the disk, too. If you know someone else who has a SATA controller and is willing to let you test your disk under Linux, then you could make sure it's really the disk. I still cannot believe it, though.

----------

## srs5694

I don't know enough about the Seagate model lines to know if you should be getting equivalent or better performance from the SATA disk; it's possible that the SATA disk is just plain not as fast as the PATA disk. I'd look into this issue before getting too worried about this. Get some spec sheets from Seagate and compare the internal data transfer rates for the two drives. (The external data transfer rates are meaningless; that's just the interface speed, which is almost certain to be much higher than the true data transfer rates.) If those rates are identical, or if they're higher for the SATA drive, then you should start looking for causes.

As you're using a Silicon Image controller, you can try switching from the ATA to the libata driver. If the Silicon Image ATA driver is built into the kernel, you'll need to rebuild your kernel, disabling it or at least building it as a module instead. You'll also need to activate the libata driver, which is in the SCSI section of the kernel configuration. Until recently, the Silicon Image libata driver was considered experimental, but I think that may have changed with 2.6.5 (I haven't actually checked with a 2.6.5 kernel, though, so I'm not positive of that).

I also recall hearing that Seagate's SATA implementation is a bit wonky. I didn't look into that in great detail, though; I just read a couple of comments and so bypassed Seagate when I bought my SATA drive. You might want to look into it further, though. Try a search for "Seagate SATA" on this forum, for instance.

----------

## ravenqr

My Seagate Barracuda 7200.1 80 gig hdparm's at 56 mb/s

got half of that sata drive in raid0 with a 40 gig ide drive and i get 111 mb/s with the raid0

seagate sata's are good drives...only true sata drive out there

i would check into the chipset performance for via...that could be it

----------

## Kiroku6

Sorry to take this off subject a little but, why do you say Seagate is the only true SATA?

----------

## den_RDC

I think he means that most (if not all) Seagate's SATA drives are "really" native sata (they aren't PATA drives with a convertor onboard). You can spot "converted" drives easily by the fact that the usually have a small square chip on them with a big "M" printed on (these are pata-sata bridges made by Marvell). The difference between a "converted drive" and a "native" drive is almost non-existant, but the seagate drives support the new and upcoming SATA queuing scheme that looks & works a lot like SCSI (and we all like scsi very much ofcourse). Afaik this queing scheme needs a compatible controller and driver, so it might be linux can't do this yet. But it's nice to have i guess.

PS. I am pretty shure all this is correct, but don't shoot me if it isn't  :Smile: 

----------

## eNTi

```

root@eNTi $ hdparm -tT /dev/sda

/dev/sda:

 Timing buffer-cache reads:   1036 MB in  2.01 seconds = 516.53 MB/sec

 Timing buffered disk reads:  150 MB in  3.03 seconds =  49.46 MB/sec

```

i get this withtout hdparm tweaking. anyone knows, if there's a similiar tool for scsi like hdparm for ide? my sata drive is connected to a promise-pci controller and hdparm does not support scsi very well.

----------

## GentooBox

My SATA hardisks is faster than my ATA harddisks.

SATA:

 *Quote:*   

> hdparm -Tt /dev/scsi/host1/bus0/target0/lun0/disc 
> 
> /dev/scsi/host1/bus0/target0/lun0/disc:
> 
>  Timing buffer-cache reads:   2436 MB in  2.00 seconds = 1217.58 MB/sec
> ...

 

IDE ATA:

 *Quote:*   

> hdparm -tT /dev/hda
> 
> /dev/hda:
> 
>  Timing buffer-cache reads:   2412 MB in  2.00 seconds = 1204.38 MB/sec
> ...

 

SATA RAID0:

 *Quote:*   

> hdparm -tT /dev/md1
> 
> /dev/md1:
> 
>  Timing buffer-cache reads:   2408 MB in  2.00 seconds = 1202.38 MB/sec
> ...

 

SATA IDE RAID0:

 *Quote:*   

> hdparm -tT /dev/md2
> 
> /dev/md2:
> 
> Timing buffer-cache reads:   2400 MB in  2.00 seconds = 1197.79 MB/sec
> ...

 

I have an AMD64 CPU, thats why i get 12xx mb/s in cache.

I have a VIA SATA controller.

----------

## irondog

 *srs5694 wrote:*   

> 
> 
> As you're using a Silicon Image controller, you can try switching from the ATA to the libata driver. If the Silicon Image ATA driver is built into the kernel, you'll need to rebuild your kernel, disabling it or at least building it as a module instead. You'll also need to activate the libata driver, which is in the SCSI section of the kernel configuration. Until recently, the Silicon Image libata driver was considered experimental, but I think that may have changed with 2.6.5 (I haven't actually checked with a 2.6.5 kernel, though, so I'm not positive of that).

 The performance between the ATA and libata driver is increadible since the ata driver doen't use UDMA and the libata driver does.

Note: when switching to libata (which is also available in kernel 2.4.27-pre1 and higher) the device nodes will be /dev/sda and /dev/sdb because the scsi framework is used.

----------

## Nate_S

 *Quote:*   

> 
> 
> SATA Drive:
> 
>  PIO modes:  pio0 pio1 pio2 pio3 pio4
> ...

 

Yeah, it looks like your SATA drive is not using UDMA at all.

----------

## srs5694

 *eNTi wrote:*   

> 
> 
> ```
> 
> root@eNTi $ hdparm -tT /dev/sda
> ...

 

If all you want to do is test drive speed, hdparm should work. (It certainly works for me.) If you want to adjust interface parameters, I'm not aware of any similar tool. In theory, they're unnecessary for SCSI, since SCSI host adapters typically operate at peak performance automatically. I don't know how this interacts with SATA drives that use drivers in the Linux SCSI section, though.

----------

## marcalj

Hi, I'm now proving my new SATA HD and I get the same problem. My PATA drive is faster than SATA drive (in the same Sil3112A chipset).

```
/dev/hde:

 Timing buffer-cache reads:   1956 MB in  2.00 seconds = 976.68 MB/sec

 Timing buffered disk reads:  152 MB in  3.03 seconds =  50.22 MB/sec

/dev/hdg:

 Timing buffer-cache reads:   1964 MB in  2.00 seconds = 981.66 MB/sec

 Timing buffered disk reads:  164 MB in  3.03 seconds =  54.15 MB/sec
```

hde = WDC WD1200JD-00FYB0 (WD 120GB SATA 8mb cache)

hdg = WDC WD800JB-00ETA0 (WD 80GB PATA100 8mb cache)

Strange...isn't it?

----------

## dugb

Someone suggested to me the other day that older mother boards have the SATA controller attached to the south bridge chip via the PCI bus. Its only the newer boards that have the controller directly attached to south bridge chip. Of course nearly all boards these days have PATA as part of the south bridge or directly attached to it. 

The PCI bus is clocked at 66Mhz, a SATA or PATA controller connecting directly to south bridge can be clocked  faster than 66Mhz.

I admit I have not sat down and done the math yet to see if this would really make any difference.

----------

## hw-tph

Here's my single Seagate 160GB SATA disk on my NF7-Sr2 using libata (hence the SCSI device name):

```
root@bimbo:/home/hw/down# hdparm -tT /dev/sda

/dev/sda:

 Timing buffer-cache reads:   1828 MB in  2.00 seconds = 913.23 MB/sec

 Timing buffered disk reads:  168 MB in  3.02 seconds =  55.56 MB/sec
```

Works well enough for me.  :Smile: 

I will be adding another SATA disk to try to use raid-detect later on .

Håkan

----------

## PrakashP

Samsung 160GB 8MB 7200rpm PATA drvie, with PATA->SATA converter attached to SiI3112A, using libata, Abit NF7-S Rev2.0, using 2x512MB in DC mode

```

hdparm -tT /dev/sda

/dev/sda:

 Timing buffer-cache reads:   2028 MB in  2.00 seconds = 1013.14 MB/sec

 Timing buffered disk reads:  182 MB in  3.01 seconds =  60.43 MB/sec

```

----------

## marcalj

How it works "libata" ? is configuration in the kernel? Can you especify where?

How can I know if I use libata?  :Razz: 

Thanks.

----------

## hw-tph

libata can be found under SCSI Low Lever drivers. If you're using libata your SATA disk will be called /dev/sda since it's a SCSI device to the kernel when you use libata.

----------

## janiskr

mm then result of

hdparm -tT /dev/hda

```
/dev/hda:

 Timing buffer-cache reads:   1284 MB in  2.00 seconds = 641.46 MB/sec

 Timing buffered disk reads:  170 MB in  3.01 seconds =  56.51 MB/sec

```

is not so bad

----------

## johntramp

I have the same problem.  Is there nothing that can be done about it?

I guess I will just have to get another sata drive and set up a raid array.

----------

## hw-tph

Do you have performance problems when using the libata driver or when using the IDE/ATA driver?

By the way - there is nothing that makes a SATA drive faster than an IDE drive. The disk, cache management and so on are the same. The only difference is the interface which the controller uses to speak to the drive. Some higher rotation speed disks are appearing as SATA only though, like there have been 10000rpm SCSI drives for years.

Using SATA-150 won't get you any better speeds than good old ATA-100 if you're using a single disk. One single disk will not (and this will probably be true for a couple of years) saturate the 100MB/s connection that ATA-100 provides. The best disk speeds I get except from SCSI is still from my Promise 20267 ATA-100 controller on my old Asus A7V using a new 8MB cache Hitachi ATA disk. It averages about 58MB/s in hdparm.

Håkan

----------

## johntramp

ok, so the only real performance seen out of sata is via raid then?

----------

## rasmuslp

 *Little Nemo wrote:*   

> The Maxtor disk has an 8GB cache, too [...]

 

Quite a lot   :Smile: 

----------

## hardcore

```
 # hdparm -tT /dev/sda

/dev/sda:

 Timing cached reads:   1988 MB in  2.00 seconds = 992.66 MB/sec

 Timing buffered disk reads:  176 MB in  3.01 seconds =  58.38 MB/sec
```

The same model of hard drive should perform the same, despite being native sata or pata.  Hard drives today are no-where near filling the bandwidth of pata or sata ( unless in raid ).  I think your problem is you weren't using the libata driver, which is a much better driver for sata drives.

----------

## KozmoNaut

ATA Maxtor Diamondmax Plus 9 w/ 8MB cache:

```
# hdparm -tT /dev/hda

/dev/hda:

 Timing cached reads:   3616 MB in  2.00 seconds = 1807.37 MB/sec

 Timing buffered disk reads:  146 MB in  3.02 seconds =  48.32 MB/sec
```

----------

## thecrazyperson_ws

My 120GB WD Caviar SE (8MB cache, PATA 7200 RPM) in my server gives me about 20MB/sec on buffered disk reads   :Crying or Very sad: 

Then again, it is in my old 200 MHZ pentium that requires the use of a controller card to access that HD (I'm using a SIIG CMD-649U.... a crappy card IMO)

----------

