You are not logged in.

#1 2010-01-21 23:56:01

Frimkron
Member
Registered: 2010-01-21
Posts: 6

[SOLVED] SATA Disks Changing Order in GRUB

Hi!

I appologise if this one's been asked before - I've lurked for quite a while trying to find a solution to this on the forums, but to no avail.

I'm trying to install Arch on my machine which currently has Windows XP installed on it, so that I can dual-boot. I have the following hard disks:

1 x 100GB IDE  - Windows disk
1 x 40GB IDE  - Where I'd like to put Arch
2 x 40GB SATA  - A Raid-1 (mirrored) set with data on it

So 2 IDE disks and 2 SATA, the SATAs being a RAID set which I'd like to be able to access from either OS. It's a "fake" RAID controlled by the BIOS (nvidia chipset).

Because I don't intend to install Arch to the RAID itself, I figured I could postpone trying to get Arch to see the RAID until after Arch is installed.

So, during the Arch install, the disks are ordered as follows:

/dev/sda    IDE Windows disk
/dev/sdb    IDE Linux disk
/dev/sdc    SATA Raid disk 1
/dev/sdd    SATA Raid disk 2

I partitioned sdb with boot, swap and root partitions and I set up GRUB's menu.lst file so that Arch would boot from (hd1,0) and Windows would boot from (hd0,0). I selected sda as the location to install the GRUB stage 1.

After removing the live CD and restarting, I got:

GRUB Loading stage1.5.

GRUB loading, please wait...
Error 17

without the menu appearing at all. According to the GRUB docs this error means it found the specified partition but it doesn't contain the stage 2 like it was expecting, i.e. its looking on the wrong disk.

Now the weird thing is, if I insert my Windows CD and select not to boot from it when prompted, the machine then proceeds to load the GRUB menu sucessfully.

If I then boot into Arch, it gets as far as checking the filesystem on /dev/sdb and fails. Executing fdisk -l reveals why - the devices are now arranged in the following order:

/dev/sda     SATA Raid disk 1
/dev/sdb     SATA Raid disk 2
/dev/sdc     IDE Windows disk
/dev/sdd     IDE Linux disk

The SATA disks in the RAID set are now listed as the first 2 disks rather than the second 2 like they were during the Arch install.

So my questions at this point are:

* Is there a reason why the hard disks might be ordered differently at different times?
* Why would allowing the BIOS to boot from my Windows CD affect the disk order?
* Is the fact that these disks are part of a fake-RAID part of the problem?

I have read in other threads that this could be worked around by installing GRUB stage 1 to whichever disk GRUB ends up looking on. This isn't really an option for me because I don't want to write to one half of my mirrored RAID and corrupt it.

I'd really appreciate any help or advice anyone can give.

Many thanks!

Last edited by Frimkron (2010-01-24 22:32:43)

Offline

#2 2010-01-22 11:01:14

Frimkron
Member
Registered: 2010-01-21
Posts: 6

Re: [SOLVED] SATA Disks Changing Order in GRUB

Well I've made some progress on my problem.

I used the Windows CD trick to boot into Arch, then opened the GRUB command prompt and executed setup (hd2) to ensure that the Windows disk, listed 3rd in Arch and at boot time, had GRUB stage 1 on it pointing at the correct disk number.

This got my GRUB menu loading correctly without having to put the Windows CD in. However my menu entries were wrong, so I hit 'e' on the menu to temporarily edit the entry so I could boot into Arch. However, what I found was that the GRUB menu was now seeing the disks in yet another way:

hd0    IDE Windows disk
hd1    SATA RAID set
hd2    IDE Linux disk

I booted into Arch and edited menu.lst so the Arch entry was set to (hd2,0) and the Windows entry (hd0,0). This got my GRUB menu working correctly.

However, Arch was still complaining that the filesystem was invalid, because it was trying to use /dev/sdb but the disk order at that point was:

/dev/sda    SATA RAID disk 1
/dev/sdb    SATA RAID disk 2
/dev/sdc    IDE Windows disk
/dev/sdd    IDE Linux disk

I edited fstab to change the mountpoints to use /dev/sdd instead. This time when I booted Arch again, it still complained about the filesystem. The disk order had changed again!

/dev/sda    IDE Windows disk
/dev/sdb    IDE Linux disk
/dev/sdc    SATA RAID disk 1
/dev/sdd    SATA RAID disk 2

This is driving me crazy. I seem to be trying to hit a moving target at the moment!

Offline

#3 2010-01-22 11:45:55

count-corrupt
Member
From: Germany
Registered: 2009-02-01
Posts: 112

Re: [SOLVED] SATA Disks Changing Order in GRUB

You should try labelling your disks, or otherwise referring to them by uuid. See here for reference.
That way, even if the naming of the device-nodes changes, your disks can be uniquely identified.

For instance, the Arch part of my menu.lst looks like this:

title=Arch Linux
root (hd0,0)
kernel /boot/vmlinuz26 root=/dev/disk/by-label/arch ro quiet vga=0x0368 disablemodules=sata_mv
initrd /boot/kernel26.img

As soon as the Kernel takes over, it will identify my disks by label (I chose labels because I can then clearly distinguish the disks myself, other than with uuids).

Edit: Oh, and by the way, changing the boot-order of your disks in the bios does indeed change the order in which disks are regognized by the system.

Last edited by count-corrupt (2010-01-22 11:48:09)

Offline

#4 2010-01-22 22:35:52

Frimkron
Member
Registered: 2010-01-21
Posts: 6

Re: [SOLVED] SATA Disks Changing Order in GRUB

Ah, thanks count-corrupt - that's solved the problem beautifully. I'm well on my way to getting Arch set up now.

The disk ordering issue is certainly a pain. I think I'll probably replace my IDE disks with SATA at some point in the future to avoid further problems with GRUB.

Offline

Board footer

Powered by FluxBB