# Kernel problems with Sata and Pata disks

## Gert Andersen

Hi.

I have 2 Sata harrdisk on my system a 160G Sata as my main system as sda and then a new 700G Sata Pata disk, first try to add and connect the 700G Pata to the linux with the old kernel 2.6.24-r7 and when I startups is my bios fine seeing the 700G harddisk and Linux is beging start up and reading sda1 on the 160G Sata disk until it shall read and use sda3 roout mount, then linux stops and saying root sda is not valid and asking for shell commands.

Then I then have unconnect the 700G Sata Pata disk and upgraded kernel to 2.6.28-r5 and connect the 700G Sata Pata disk again and start up the pc, gentoo linux start up and read the sda1 and comes to shall use and read sda and say the same as before that root mount sda3 is not a valid mount, and asking for shell commands.

Is there some in the kernel ther enot working or is there another solotion that the 700G has error, or is 700G Pata perhaps miss around with the partion of sda3.

----------

## disi

Hmm, this is a problem. First comes IDE and the SATA per default. You want to either find a solution to change this order or you want to change the root=/dev/sdb3 in your grub.conf

Just for information PATA is parallel ATA which means IDE drive

While SATA is serial ATA

//edit: could you check in your BIOS for some option to change the boot order to first SATA then IDE?

I can't reproduce the problem since I only have optical drives on IDE  :Sad: 

----------

## Sysa

 *Gert Andersen wrote:*   

> Hi.
> 
> I have 2 Sata harrdisk on my system a 160G Sata as my main system as sda and then a new 700G Sata Pata disk, first try to add and connect the 700G Pata to the linux with the old kernel 2.6.24-r7 and when I startups is my bios fine seeing the 700G harddisk and Linux is beging start up and reading sda1 on the 160G Sata disk until it shall read and use sda3 roout mount, then linux stops and saying root sda is not valid and asking for shell commands.
> 
> Then I then have unconnect the 700G Sata Pata disk and upgraded kernel to 2.6.28-r5 and connect the 700G Sata Pata disk again and start up the pc, gentoo linux start up and read the sda1 and comes to shall use and read sda and say the same as before that root mount sda3 is not a valid mount, and asking for shell commands.
> ...

 

I do not see the problem here!

The simplest way is to built-in both (SATA&PATA) drivers into your kernel, write grub boot loader into both drives, set correct root= parameter in grub config (BTW, if it is necessary, you can edit it during startup) and adjust your /etc/fstab in your system.

That's all! This configuration is working for me in some installations.

If you need more advices, please public your /boot/grub/grub.conf, /etc/fstab  and output of "fdisk -lu /dev/[sh]d?" command with explanations what you keep in every partitions.

----------

## Gert Andersen

[quote="Sysa"][quote="Gert Andersen"]Hi.

I have 2 Sata harrdisk on my system a 160G Sata as my main system as sda and then a new 700G Sata Pata disk, first try to add and connect the 700G Pata to the linux with the old kernel 2.6.24-r7 and when I startups is my bios fine seeing the 700G harddisk and Linux is beging start up and reading sda1 on the 160G Sata disk until it shall read and use sda3 roout mount, then linux stops and saying root sda is not valid and asking for shell commands.

Then I then have unconnect the 700G Sata Pata disk and upgraded kernel to 2.6.28-r5 and connect the 700G Sata Pata disk again and start up the pc, gentoo linux start up and read the sda1 and comes to shall use and read sda and say the same as before that root mount sda3 is not a valid mount, and asking for shell commands.

Is there some in the kernel ther enot working or is there another solotion that the 700G has error, or is 700G Pata perhaps miss around with the partion of sda3.[/quote]

I do not see the problem here!

The simplest way is to built-in both (SATA&PATA) drivers into your kernel, write grub boot loader into both drives, set correct root= parameter in grub config (BTW, if it is necessary, you can edit it during startup) and adjust your /etc/fstab in your system.

That's all! This configuration is working for me in some installations.

If you need more advices, please public your /boot/grub/grub.conf, /etc/fstab  and output of "fdisk -lu /dev/[sh]d?" command with explanations what you keep in every partitions.[/quote]

Hmm, then is then how to built in SATA&PATA drives into my kernel, as the first 160G SATA is fine enough starting up reading /dev/sda1, so it first using SATA and then PATA + IDE drives in that order.

My grub.con look likes this:

tittle=Linux Gentoo 2.6.28-r5

root (hd0,0)

kernel /kernel-genkernel-2.6.28-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 vga=0x317 video=vesafb:mtrr:33,ywrap udev

initrd /initramfs-2.6.28-gentoo-r5

My fstab:

/dev/sda1  /boot  ext2   defaults   1 2

/dev/sda2  none  swap   sw          0 0

/dev/sda3  /        ext3    noatime  0 1

none         /proc   proc   defaults   0 0

none        /dev/shm  tempfs  defaults  0 0

The of it is for one IDE as sha ans 2 usb disks.

The new SATA 700G is not setup in my fstab yet, I like to see what the dev of sd* dmesg will show for it. So I hope it would get sdb and let the usb external harddisk get the other SD's, With the 250G IDe is there no problem with starting up.

----------

## Gert Andersen

[quote="disi"]Hmm, this is a problem. First comes IDE and the SATA per default. You want to either find a solution to change this order or you want to change the root=/dev/sdb3 in your grub.conf

Just for information PATA is parallel ATA which means IDE drive

While SATA is serial ATA

//edit: could you check in your BIOS for some option to change the boot order to first SATA then IDE?

I can't reproduce the problem since I only have optical drives on IDE  :Sad: [/quote]

I have the SATA 160G disk as /dev/sda3, and the bios using starup first SATA 160G, and it does until linux shal use /dev/sda3 and here it goes bad with error and stop, messagig - no valid sda3 root is found, use shell.

----------

## NeddySeagoon

Gert Andersen,

Grub and the kernel use two different ways to detect your hard drives.

Grub asks the BIOS whit it has found and uses the BIOS determined drive ordering.

Thats not an issue for you as grub still loads the kernel and boots into it.

The kernel typically searches for IDE drives before SCSI/SATA drives and you have little control over this.

You may patch grub and the kernel to make use of UUIDs, which are independant of the physical device but only when you r system is working.

You will need to change grub.conf to point to the relocated /dev/sd and also /etc/fstab, then all should be well again.

----------

## Gert Andersen

Hi.

It now ho the way to make my menuconfig to the kernel 2.6.28-r5 so I by the genkernel --oldconfig --menuconfig all made kernel to startup reading the harddisk in 3 steps:

1. Fists my 160G SATA with /dev/sda1 and /dev/sda3 first

2. PATA 700G or IDE 250G in secund step

3. IDE 250G or PATA 700G in the third step.

4. USB connections for external drives

That should do it that way so my kernel only read the 160G SATA disk before any else and most not read and look on another disks before kernel have finish with SATA 160G and have finde both /dev/sda1 /dev/sda2 /dev/sda3, and then when the kernel have done this and read and loaded root files and system started up it can go on to the other drives there not use main programs for linux it must look for other disk on the system, told of then in dmesg log so I by this can see what names the have got like /dev/sdb and I can format new drives.

My 700G PATA disk is not linux formatted with fdisk by partion yes.

I like some help here to setup my menuconfig for kernel disk to do it so the Kernel is compiled to first startup only by the 160G SATA without look for other thing before it have find the sda3 on SATA disk the other disk on the system must not be read on search before the root mount on /dev/sda3 is used and working, then shall kernel look on the other disks.

----------

## nixnut

Moved from Gentoo on AMD64 to Kernel & Hardware.

Kernel stuff, so moved here

----------

## cyrillic

 *Gert Andersen wrote:*   

> 1. Fists my 160G SATA with /dev/sda1 and /dev/sda3 first
> 
> 2. PATA 700G or IDE 250G in secund step
> 
> 3. IDE 250G or PATA 700G in the third step.
> ...

 

The easiest way to get the kernel to detect harddrives in the order that you want is to compile your SATA controller driver into the kernel. and compile your IDE/PATA/USB controllers as modules.

This way, the compiled-in driver will be loaded first, and the modules will be loaded later in the boot sequence.

----------

## bunder

i can boot sata fine in a machine with four ide drives in it...

in the bios you set the sata as the boot device, and that should work.

on the other hand, some motherboards have multiple drive busses...  on the machine above, one of the ide busses is linked to sata via the promise "raid" chip.  when that happened, the ide drives would show up as sdb/sdc, but the sata was still sda.  i had to disconnect my cdrom from that machine so i could use the intel ide chip for all the ide drives with proper drive letterings.  (it wouldn't let me connect a cdrom to that promise ide bus)

----------

