# Serial ATA (SATA) disks and Sil3112 controller: SOLVED !!!

## behd

```

credits for the following tip goes to people who take parts in the thread

on linuxquestions.org:

http://www.linuxquestions.org/questions/history/51535

```

I struggled a few days with this so I think that it could be of some interest for concerned people...

HOWTO activate UDMA mode on SATA disks ?

(without it your system freeze from times to times during intense I/O operations... kupdated use all your CPU...)

Note: script below works perfectly with this configuration:

Asus P4G8X Deluxe (Sil31112A) & Seagate SATA (model: ST380023AS)

with 2 disks in raid0...

[edit] Note2: Don't forget to edit it to fit your disk configurations

```

--- code of /etc/init.d/enabledma ---

#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/local,v 1.10 2003/01/06 21:32:43 azarah Exp $

depend() {

        after checkroot

}

start() {

        ebegin "Enabling DMA on disks"

        einfo "Setting 16bit data transfer with U-DMA5 mode" 

        echo "max_kb_per_request:15" > /proc/ide/hde/settings

        echo "max_kb_per_request:15" > /proc/ide/hdg/settings

        hdparm -d1X69 /dev/hde

        hdparm -d1X69 /dev/hdg

        eend 0

        eend $? "Enabling DMA on disks failed"

}

------------------------------------------

```

of course I won't tell you that you should: "rc-update add enabledma boot"  :Wink: 

Oh and I am wondering, the screen output of hdparm only appears during runlevel default (even the einfo) ?!? therefore I presume that it's only ran at this moment... how is it possible ???

-> my goal was to execute it before checkfs, but whatever I use (before checkfs, after modules, etc... it keep executing in default...)

----------

## f00b@r

Great!

But what do I have to do, if I have a RAID1-System?

Loading the silraid-module fails with "No Raid-Array found".

----------

## behd

ouch... would need a bit more informations to give you more precise answer:

- hardware (controller, disks)

- kernel version & conf

- are u booting on this array ??

Plus, I remember that I read something about raid1... can't tell you anymore what it was... but I think, there's was some kind of other problems...

----------

## f00b@r

The controller is the same.

No, I haven't installed Gentoo yet, because it can't find my raid-array.

I'm booting the "smp"-Kernel from the 1.4rc4-bootcd.

----------

## behd

a friend of mine has made an howto based on the way I installed my Gentoo:

http://forum.hardware.fr/forum2.php3?post=22688&cat=11&config=&interface=&cache=&sondage=&owntopic=&p=1&trash=&subcat=

I don't know which kernel Gentoo rc4 is using but if it's not a .2.4.21 (or pre - 2.4.21)...

there's lot of chances that it's the problem !!!

What I could advice you:

1. make sure there's no problem booting raid1 under linux (google the web for this)

2. download a mandrake 9.1 (or later) boot-cd (You don't need the whole distro !!! only first CD)

3. boot it with rescue option

goto console

loadkeys xxx (xxx =  your key ma)

modprobe ataraid

modprobe silraid

download makedev (there's a link to it in the howto)

execute makedev

now see if you can act on your array (fdisk, mkfs, etc...)

NB. with ataraid disk:

/dev/ataraid/d0 is the equivalent of /dev/hda for normal disk

/dev/ataraid/dopX is the equivalent of /dev/hdaX for normal disk (where X is partition number)

if it work then you are saved and can start the gentoo installation from there !!!

NB. Other infos on sataraid there:

https://forums.gentoo.org/viewtopic.php?t=46042

----------

## behd

btw. what MB are you  using (brand + model) ???

Are you sure that the array has been correctly created ???

Have you already installed an other OS it ?

----------

## f00b@r

I've got that Asus A7N8X-Deluxe MB with the Silicon Image 3112A-Controller.

At the moment only WinXP runs (without problems) on that RAID-system, so I it was created correctly.

I already tried the Mandrake rescue option with the result, that an error occurs ("No RAID-Array found").

So I think that silraid-module only supports RAID0, doesn't it?   :Rolling Eyes: 

----------

## behd

> So I think that silraid-module only supports RAID0, doesn't it?

I don't think so... those ataraid drivers use the kernel raid support (Multiple devices RAID & LVM)...

silraid is just the driver to the hardware (the Sil3112A chip for instance) and make use of kernel raid support to interact with the devices...

Therefore this should work... I presume that the problem is somewhere else...

---

What you could still try:

# modprobe ataraid

# lsmod (see if it's correctly loaded)

if ataraid is in the list... then load silraid with -v option 

#modprobe -v silraid

if there's no more clue, eventually try to search logs for more informations...

----------

## f00b@r

Ok, I tried that:

- Booted Gentoo 1.4rc4 (boot-CD)

- executed makedev-script (from redhat)

- modprobed ataraid (w/o errors)

- moprobed silraid (modprobe -v silraid, failed)

# modprobe -v silraid

 *Quote:*   

> /sbin/insmod /lib/modules/2.4.21_pre7-gss-livecd/kernel/drivers/ide/raid/silraid.o
> 
> Using /lib/modules/2.4.21_pre7-gss-livecd/kernel/drivers/ide/raid/silraid.o
> 
> Symbol version prefix 'smp_'
> ...

 

output from dmesg:

 *Quote:*   

> Guestimating sector 241253695 for superblock
> 
> Guestimating sector 156300463 for superblock
> 
> Guestimating sector 156300463 for superblock
> ...

 

It's your turn again   :Very Happy: 

----------

## behd

try looking there:

http://www.ussg.iu.edu/hypermail/linux/kernel/0305.0/0466.html

----------

## mog

hmmm ... did as suggested ... however on boot it throws an 

error at me when checking for the dependency "checkroot"

why? ... what is checkroot and what is it needed for

----------

## behd

> why ?

sorry can't help you without a bit more info (what does the error says ???)

> what is checkroot ?

cat /etc/init.d/checkroot  :Wink: 

> and what is it needed for

well the "cat" shoudl tip you... it just mount your fs in ro mode and check it for errors...

NOW why did I suggest to use "after checkroot" ???

1. because I read somewhere that dma & max_kb_per_request should be configured as soon as possible in order to avoid problems (freeze computer, etc...).

[edit] 2. because checkroot is using "before *"

----------

## Moled

 *f00b@r wrote:*   

> Ok, I tried that:
> 
> - Booted Gentoo 1.4rc4 (boot-CD)
> 
> - executed makedev-script (from redhat)
> ...

 

I have the exact same problem   :Confused: 

----------

## Baad3r

Same problem here, too.   :Sad: 

----------

## drekka

Ok , done so testing on my system:

Asus A7N8X Deluxe, 2 x seagate SATA 120G Drives in raid 0.

Seeing the max_kb_per_request trick and only getting 25M/sec on my drives after setting -d1 -X70, I decided to try it. I looked in the /proc/ide/hde/settings and /proc/ide/hdg/settings files and to my surprise found that the drives where already running at 15 for this setting. 15 being the value everyone recommends. So I experimented with values ranging from 1 to 255.

Results:

1-15: 25M/sec

16-22: 38M/sec

23: 39M/sec

24-255:41M/sec

This seems to fly in the face of what everyone has said in this forums. Instead of reducing the setting to 15, I should be increasing it to 24 or greater. 

However, when I tried do this using the following set of commands from a comand line (testing before installing them perminantly)

hdparm -d0 /dev/hde

hdparm -d0 /dev/hdg

echo "max_kb_per_request:32: > /proc/ide/hde/settings

echo "max_kb_per_request:32: > /proc/ide/hdg/settings

hdparm -d1 -X70 /dev/hde

hdparm -d1 -X70 /dev/hdg

The system would lock up and die within a minute or two with all sorts of IO errors. I tried several different values above 24 all with the same result. dead system.

Does anyone know why my system would appear to be back to from to what everyone is saying ???

cio

Derek.

----------

## gmichels

I saw that value was already set at 15 and my drives get individual speeds of 35mb/s. I really didn't try changing them to check for performance increase. The array benchmark shows speeds of about 70mb/s. I'll try tonight and put the results here.

Anyway this is below expected since the drives can go up to 50mb/s if used in plain ide channels.

A weird behaviour here: if I enable the vesa framebuffer, my disks performance drop to 4mb/s. I can only get decent speeds disabling the framebuffer.

----------

