Tux

...making Linux just a little more fun!

The joys of cheap hardware

Neil Youngman [Neil.Youngman at youngman.org.uk]


Sun, 9 Dec 2007 15:07:50 +0000

A little while back I bought a cheap HP desktop and today I decided to put a 2nd hard disk in. This is when I found that, although the spec sheet tells you you have a spare 3.5 in hard disk bay, it doesn't tell you that there are only 2 SATA connectors on the board and they are both in use! The PCB has spaces for 4 SATA connectors, but only 2 have been connected up, although bizarrely they have put in an IDE connector and a floppy connector.

Fortunately, I have a spare SATA controller, so I can still get the disk in. Unfortunately, when I boot Debian the disk order gets swapped, so GRUB sees the original disk as disk 1, but Debian sees it as disk 2. The upshot is that it refuses to boot, as it can not mount the root partition. Interestingly Knoppix still sees them in the expected order.

Using partition labels in /etc/fstab isn't a solution because it can't actually find /etc/fstab.

I have a temporary workaround, as I have swapped the DVD SATA connection to the second hard disk, so both are connected from the motherboard. This has the advantage that they are mounted in a predictable order, but the disadvantage is that I no longer have the option of booting from CDROM, without swapping the cables back.

Does anyone know how the disk order is determined and is there any way to force Debian to put the disks connected from the Motherboard ahead of those connected from the additional SATA controller?

Neil Youngman


Top    Back


Thomas Adam [thomas at edulinux.homeunix.org]


Sun, 9 Dec 2007 15:19:38 +0000

On Sun, Dec 09, 2007 at 03:07:50PM +0000, Neil Youngman wrote:

> Fortunately, I have a spare SATA controller, so I can still get the disk in. 
> Unfortunately, when I boot Debian the disk order gets swapped, so GRUB sees 
> the original disk as disk 1, but Debian sees it as disk 2. The upshot is
> that it refuses to boot, as it can not mount the root partition.
> Interestingly Knoppix still sees them in the expected order.

You can often enforce the ordering through the BIOS, since this is what GRUB uses. You can issue something at the GRUB prompt too, to tell it what the root partition is for the specific drive, but I forget what.

-- 
Thomas Adam
"It was the cruelest game I've ever played and it's played inside my head."
-- "Hush The Warmth", Gorky's Zygotic Mynci.

Top    Back


Martin J Hooper [martinjh at blueyonder.co.uk]


Sun, 09 Dec 2007 16:05:35 +0000

Neil Youngman wrote:

> Does anyone know how the disk order is determined and is there any way to 
> force Debian to put the disks connected from the Motherboard ahead of those 
> connected from the additional SATA controller?
> 
> Neil Youngman

Try using map in your menu.lst assuming you can see the drive where it is.

http://www.gnu.org/software/grub/manual/html_node/map.html


Top    Back


Neil Youngman [Neil.Youngman at youngman.org.uk]


Sun, 9 Dec 2007 18:54:36 +0000

On Sunday 09 December 2007 15:19, Thomas Adam wrote:

> On Sun, Dec 09, 2007 at 03:07:50PM +0000, Neil Youngman wrote:
> > Fortunately, I have a spare SATA controller, so I can still get the disk
> > in. Unfortunately, when I boot Debian the disk order gets swapped, so
> > GRUB sees the original disk as disk 1, but Debian sees it as disk 2. The
> > upshot is that it refuses to boot, as it can not mount the root
> > partition. Interestingly Knoppix still sees them in the expected order.
>
> You can often enforce the ordering through the BIOS, since this is what
> GRUB uses.  You can issue something at the GRUB prompt too, to tell it what
> the root partition is for the specific drive, but I forget what.

I don't think the BIOS helps because the problem isn't the ordering in GRUB, it's the ordering in the kernel and that's different from the ordering in GRUB. Also I'm not sure how the BIOS interacts with a separate controller.

Thinking about it some more, I think I just need to change root=/dev/sda2 to root=/dev/sdb2 and as long as the ordering doesn't change, It'll be OK. Time for some more experimentation.

Neil


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Mon, 10 Dec 2007 08:31:44 +0530

Hello,

On Sun, 09 Dec 2007, Neil Youngman wrote:

> Unfortunately, when I boot Debian the disk order gets swapped, so GRUB sees 
> the original disk as disk 1, but Debian sees it as disk 2. The upshot is that 
> it refuses to boot, as it can not mount the root partition. Interestingly 
> Knoppix still sees them in the expected order.

You have run into the "persistent device naming" problem. IRST this has been discussed in TAG before.

Anyway, my own solution is to use the disks under lvm (Debian package "lvm2"). Since the boot process scans all volume groups a root device like /dev/vg/root always works whether it is based in /dev/sda2 or /dev/sdb2.

There is till the grub problem for which I don't really know a solution --- perhaps pupa (grub2) has a solution.

Regards,

Kapil. --


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Mon, 10 Dec 2007 08:48:11 +0530

On Mon, 10 Dec 2007, Kapil Hari Paranjape wrote:

> There is till the grub problem for which I don't really know a
^^^^

> solution --- perhaps pupa (grub2) has a solution.
s/till/still

You may be able to do something with the "map" and "find" commands for "grub" but currently the menu file does not seem to have branching.

Regards,

Kapil. --


Top    Back


Neil Youngman [Neil.Youngman at youngman.org.uk]


Sat, 15 Dec 2007 21:07:56 +0000

On Sunday 09 December 2007 15:07, Neil Youngman wrote:

> A little while back I bought a cheap HP desktop and today I decided to put
> a 2nd hard disk in. This is when I found that, although the spec sheet
> tells you you have a spare 3.5 in hard disk bay, it doesn't tell you that
> there are only 2 SATA connectors on the board and they are both in use! The
> PCB has spaces for 4 SATA connectors, but only 2 have been connected up,
> although bizarrely they have put in an IDE connector and a floppy
> connector.
>
> Fortunately, I have a spare SATA controller, so I can still get the disk
> in. Unfortunately, when I boot Debian the disk order gets swapped, so GRUB
> sees the original disk as disk 1, but Debian sees it as disk 2. The upshot
> is that it refuses to boot, as it can not mount the root partition.
> Interestingly Knoppix still sees them in the expected order.
>
> Using partition labels in /etc/fstab isn't a solution because it can't
> actually find /etc/fstab.
>
> I have a temporary workaround, as I have swapped the DVD SATA connection to
> the second hard disk, so both are connected from the motherboard. This has
> the advantage that they are mounted in a predictable order, but the
> disadvantage is that I no longer have the option of booting from CDROM,
> without swapping the cables back.
>
> Does anyone know how the disk order is determined and is there any way to
> force Debian to put the disks connected from the Motherboard ahead of those
> connected from the additional SATA controller?

I've decided that a hardware solution is best. I considered http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=260184741633&ssPageName=_RSCC_Pr4_PcY_BIN_IT but do I really need 0.36TB of disk installed? I don't think so, at least not yet, so something like http://cgi.ebay.co.uk/3-5-SATA-PC-USB-External-Hard-Drive-Hdd-ENCLOSURE-Case_W0QQitemZ220183997193QQihZ012QQcategoryZ86758QQssPageNameZWDVWQQrdZ1QQcmdZViewItem will probably be ideal, as it makes my spare disk a portable backup and data transfer solution.

Neil


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Sat, 15 Dec 2007 23:51:18 -0500

On Sat, Dec 15, 2007 at 09:07:56PM +0000, Neil Youngman wrote:

> On Sunday 09 December 2007 15:07, Neil Youngman wrote:
> >
> > Does anyone know how the disk order is determined and is there any way to
> > force Debian to put the disks connected from the Motherboard ahead of those
> > connected from the additional SATA controller?
> 
> I've decided that a hardware solution is best. 

Good thought, Neil. I often find that a difficult and complicated software solution can be circumvented with a simple hardware solution - and I think that a lot of people lose track of that option.

> I considered 
> http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=260184741633&ssPageName=_RSCC_Pr4_PcY_BIN_IT 
> but do I really need 0.36TB of disk installed? 

Of course you do! Or at least you will. :) Waiting until you really need it, however, lowers the price drastically - see Moore's Law.

-- 
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *

Top    Back