...making Linux just a little more fun!
Neil Youngman [Neil.Youngman at youngman.org.uk]
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
Thomas Adam [thomas at edulinux.homeunix.org]
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.
Martin J Hooper [martinjh at blueyonder.co.uk]
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.
https://www.gnu.org/software/grub/manual/html_node/map.html
Neil Youngman [Neil.Youngman at youngman.org.uk]
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
Kapil Hari Paranjape [kapil at imsc.res.in]
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. --
Kapil Hari Paranjape [kapil at imsc.res.in]
On Mon, 10 Dec 2007, Kapil Hari Paranjape wrote:
s/till/still> There is till the grub problem for which I don't really know a^^^^> solution --- perhaps pupa (grub2) has a solution.
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. --
Neil Youngman [Neil.Youngman at youngman.org.uk]
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 https://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 https://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
Ben Okopnik [ben at linuxgazette.net]
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 > https://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 * https://LinuxGazette.NET *