Telling grub which partition should it boot
Ok. I don't know if this question belongs here, so take my apologies if such is the caso. Anyway, grub is fooling me too much and googling hasn't helped me much. I want grub to boot a certain partition, but it refuses to do it no matter what I try. This is the scenario:
I have two SATA drives and one IDE drive. Windows (2000) and Linux (Debian Etch) live in sda (1 for Windows and 2 for Debian). I boot them nicely by setting root(hd0,0) for Windows and root (hd0,1) for Debian. This is OK. Now I have a new OS installed at my IDE's first partition (hda1 in Linux), and grub doesn't want to boot it. I tried setting root in grub to hd1,0, hd2,0,hd3,0,hd4,0 and so on. Nothing works. In the best cases (hd1 and hd2), grub complains about error 12, while with hd3 and hd4 it complains about error 21 (which AFAIK means that it couldn't find the drive). I *can* boot hda1 if I chose that drive as the boot drive in my system's BIOS, but I'd like to integrate the new OS into grub's menu. I *guess* that it is grub itself who gets fooled, because the bios reports hda to be the first drive (which in grub's own language is hd0), but grub calls hd0,0 the disk it is installed on. I'm clueless :( EDIT: FYI, grub is installed in sda's MBR |
If your third drive is the IDE then it should be refered to as (hd2,0). hd2 is the third drive and 0 is the first partition of that drive. You also need to make sure that the file /boot/grub/device.map contains:
(hd2) /dev/hda Create a stanza in /boot/grub/menu.lst to boot to that drive and to that partition. |
You can really wind up chasing your tail with GRUB--especially if you change BIOS settings after installing and configuring GRUB.
What is your new OS? If Linux, then you can simply install GRUB from there. You can also install GRUB on that drive--IF you know what GRUB believes to be the numbering. I am very fuzzy on how this all works when you mix SATA and IDE drives. My personal preference is to put all OSes on one drive, and use all the other dirves for data, backup, or specific directories. This avoids a lot of confusion. |
If you want to grab Grub by its horns try read the Grub Manual.
In there you will find the command at Grub prompt Code:
geometry (hd0) Also if your new OS uses Grub then it must have Grub's menu.lst so you can ask Grub to report to you which partition has it by Code:
find /boot/grub/menu.lst The possibilities are endless. Still confused? In my signature you can see a link in which I created 145 partitions and wrote the menu.lst before filling everyone of them with an OS. I can certify that Grub does not get fooled and will do exactly it is told. It boots every one of the 145 systems. |
This "new OS" - Vista by any chance ???.
|
Grub boots a Vista no difference to a Dos, Windows, BSD or Solaris.
|
I can finally boot it, but I still think that grub calls hd0 to the drive he lives on no matter what the bios says. This is device.map on /boot/grub:
Quote:
Quote:
Anyway, the new OS I wanted to boot is MS-DOS 6.22. In the grub world, it lives in hd1. DOS' boot code gets installed on hda's MBR, so this is the grub stuff to boot it: Quote:
Anyway, thank you all for the tips. You are so nicely helpful people :) PS: I'm no particularly anti-MS and I love Windows 2000 (which IMO is an OK desktop OS), but I'll NEVER install Vista here. They really screw it up with it. |
Here is my "speculation" of what happened.
The device.map can be accurate if (1) you have since changed the disk order either knowingly or unknowingly. The plugging and unplugging of hard disks can cause the Bios to alter the disk order too. (2) Initially your hda did not have a bootable system and the Bios proceeded to boot the OSs in the second disk sda. The way Dos boots from "root (hd1)" means you use Grub to boot up the MBR of hd1 and it is this MBR that boots up Dos and not GRub. This is totally acceptable, say the MS's MBR has been installed in hda and it boots whatever primary partition in hda with the booting flag switched on. If Grub doesn't boot by "root (hd1,0)" then perhaps your Dos is in a partition other than 1st partition 0. This is quite possible as I could not image when you installed Win2k and Suse booting from sda your hda was a raw disk at that time without any partition inside but occupying the first bootable disk status. The makeactive command cannot be applied to the whole disk hd1. I am not entirely sure if savedefault can be accepted for such a booting choice either. You can show us the output of "fdisk -l" if you want a deeper investigation. |
Quote:
Code:
hda: 234441648 sectors (120034 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) Code:
Disposit. Inicio Comienzo Fin Bloques Id Sistema Quote:
I say this because of this is an almost vanilla Debian. And I remember that when I first rebooted after installing it (just basic system, I apt-getted later for X and KDE), the Debian installer wrote 'root=/dev/hda2' instead of 'root=/dev/sda2' in the Linux entry and 'root(hd1,0)' instead of 'root(hd0,0)' for the Windows 2000 entry. The same happens if I now do a 'grub-install'. I knew how to edit the boot commands and also knew where I installed Debian and Windows, so that saved my butt and made it no problem at all. I guess that this can be fixed by editing device.map properly, but it is Grub (or Debian) who fools itself. Am I the only one to experience this? Regards! |
Grub is rarely (never ???) at fault in these things.
Poorply designed and/or implemented (distro) installer. Anaconda is another that doesn't handle multiple OS's on different disks very well. I prefer to do my own grub builds. |
From my experience if a distro has bugs the installer possibly has the most of it.
Grub seldom gets wrong unless you boot it with an older Grub, say 0.91 on a newer Linux that has been packaged with Grub 0.97. |
All times are GMT -5. The time now is 07:00 PM. |