[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question about Hard Disk ordering in BIOS and seen by debianinstaller



Remi Butaud wrote:
> 
> Remi Butaud wrote:
> >
> > Hi,
> >
> > Here's the trick question:
> >
> > How does the installer (or a linux core, like the one that's on the
> > debian netinstall CDs) know the hard disk ordering? It seems that it
> > doesn't read it from the BIOS, or that it doesn't do it properly.
> >
> > Let me explain:
> > I have the following hard disk order : SATA0 - IDE0 - SATA1 se in the bios.
> > Let us assign names to the devices, which will be
> > /dev/sda : SATA0, /dev/hda: IDE0, /dev/sdb: SATA1
> >
> > Some OS is on /dev/sda1 and is being used at boot. When I install
> > debian, it does see that there is another os, but the boot loader
> > installs itself on the MBR of /dev/hda. Which, at reboot, is
> > completely ignored, as the BIOS uses the order above.
> >
> > So why does the mini-OS or the base system or the installer decide to
> > put the bootloader on the wrong disk in the first place? Or rather, is
> > there a way to let it know the BIOS settings?
> >
> > Cheers,
> >
> > Remi.
> >
> >> PS: The 'incriminated' motherboard is ASUS K8N-E Deluxe (AMD 64 /
> nForce3 based)
> 
> >The key for you may be to edit the /boot/grub/device.map file, which is
> >how you can tell GRUB what the BIOS order of drives is. The original
> >content of device.map constitutes a "guess", which is often right, but
> >definitely not always.
> >
> >Here's the section of the GRUB manual, that gives some more information
> >on it:
> >
> >http://www.gnu.org/software/grub/manual/grub.html#Device%20map
> >
> >Tom
> 
> Thank you Tom, I'll try that with next install, which should happen soon :)
> 
> However, is there a way for the installer to get the information from
> the BIOS rather than simply guessing?
> 
> Cheers,
> Remi.

The original content of device.map is generated by the GRUB shell
(/sbin/grub) running within Linux, and it comes from how the Linux
kernel sees the drives. That can differ from the BIOS order, especially
when you have a mix of drive types, or if you have changed the BIOS boot
order yourself. I doubt there is much you can do about that.

I haven't tried this, but at the point in the installation where it is
about to install the boot loader, you can probably switch over to the
alternate console (I think it's Alt+F3 or Alt+F4), and go in there and
edit/create the /boot/grub/device.map with the contents you need. I
believe that file will then not be touched by GRUB (because it already
exists) when you return to installation screen and install GRUB.

But.....if this is the only reason you are going to reinstall Debian,
there's no need to do that just for the boot loader. You can fix and
reinstall GRUB manually without a complete reinstall of the OS.
Basically by booting from a Live CD and chrooting into your root
partition from there to fix the device.map file, and then reinstall
GRUB. If you want to do this, and need a little help let me know,
although the GRUB manual and Googling this topic should pretty much get
you there.

Tom



Reply to: