[vox-tech] grub questions - FIXED!!!
Peter Jay Salzman
p at dirac.org
Tue Aug 10 10:40:58 PDT 2004
On Mon 09 Aug 04, 5:41 PM, Peter Jay Salzman <p at dirac.org> said:
> I'm going to give Grub a fair chance and learn it. At best, I'll love
> it and decide to use it. At worst, I'll at least be able to help other
> Linux users with Grub questions.
>
> I've got a new system with 3 hard drives:
>
> /dev/hda - 80 GB PATA drive with Debian. I plan on taking this drive out
> and use it to hold system backups elsewhere. I installed it
> temporarily to play with my SATA drives and the drivers that Rick
> mentions on his website.
>
> /dev/hdg - 200 GB SATA drive with Debian.
>
> /dev/hde - 250 GB SATA drive with Win2k.
>
> I can boot into either Linux OS. The problem is Win2k. When I choose
> the Win2k entry of the Grub menu, it dumps me into a bash-like prompt
> (the prompt is "grub> "). I'm not sure what to do here or how to boot
> Win2k.
>
> The hde partitions are as follows:
>
> /dev/hde1: bootable OS partition
> /dev/hde2: applications
> /dev/hde3: user data
>
> Grub's menu text file looks like (I've deleted all comments and
> "recovery mode" kernels):
>
> default 0
> timeout 300
> color cyan/blue white/blue
>
> title Debian GNU/Linux, kernel 2.6.7
> root (hd2,0)
> kernel /vmlinuz-2.6.7 root=/dev/hdg6 ro
> savedefault
> boot
>
> title Debian GNU/Linux, kernel 2.4.26-1-386
> root (hd2,0)
> kernel /vmlinuz-2.4.26-1-386 root=/dev/hdg6 ro
> initrd /initrd.img-2.4.26-1-386
> savedefault
> boot
>
> title Other operating systems:
> root
>
> title Debian GNU/Linux, kernel 2.6.7 (on /dev/hda5)
> root (hd0,0)
> kernel /vmlinuz-2.6.7 root=/dev/hda5 ro
> savedefault
> boot
>
> title Debian GNU/Linux, kernel 2.4.26-1-386 (on /dev/hda5)
> root (hd0,0)
> kernel /vmlinuz-2.4.26-1-386 root=/dev/hda5 ro
> initrd /initrd.img-2.4.26-1-386
> savedefault
> boot
>
> title Windows NT/2000/XP
> root (hd1,0)
> savedefault
> makeactive
> chainloader +1
>
> I'd like to put "boot" at the end of the Win2k stanza, but when I type
> "boot" at the grub prompt, it tells me that the kernel needs to load
> before booting (huh?).
>
>
> Also, I understand how Grub addresses drives and partitions. What
> exactly does it mean when you have a letter at the end of a drive /
> partition like (hd0,0,a)? The docs call "a" a "slice". Never heard of
> a slice in this context before.
>
> Thanks!
> Pete
I have the whole thing figured out. Refer to my list of hard drives to
understand what follows (I'm not refering to drive names on purpose):
* 80 GB PATA drive with Debian.
* 250 GB SATA drive with Win2k.
* 200 GB SATA drive with Debian.
1. Windows indeed wants to be the first drive (hd0).
2. Grub: MBR of the PATA drive.
3. ntloader: boot sector of the 1st partition of the Win2k SATA drive.
4a. If BIOS is set to boot PATA first, this is what the drives on my
system look like:
* hda (hd0) - 80 GB PATA drive with Debian.
hda1 (hd0,0): /boot
hda5 (hd0,4): /
* hde (hd1) - 250 GB SATA drive with Win2k.
hde1 (hd1,0): /winnt
* hdg (hd2) - 200 GB SATA drive with Debian.
hdg1 (hd2,0): /boot
hdg6 (hd2,5): /
4b. Grub boots ntloader which is in the boot sector of the 1st SATA
drive (hd1,0), which is actually the 2nd drive according to BIOS.
4c. Since Win2k is the 2nd drive, ntloader cannot boot it. In fact, I'm
guessing that the strange characters that I saw is what happens when
ntloader tries to load the Linux kernel on (hd0,0).
5a. If BIOS is set to boot off SATA first, my drives look like:
* (hd0) - 250 GB SATA drive with Win2k.
(hd0,0): /winnt
* (hd1) - 200 GB SATA drive with Debian.
(hd1,0): /boot
(hd1,5): /
* (hd2) - 80 GB PATA drive with Debian.
(hd2,0): /boot
(hd2,4): /
5b. The MBR of (hd0) is untouched and still has the minimal bootloader
in it. It loads the ntloader directly without touching Grub.
6a. There are a few ways to make grub boot Windows.
6b1. The first way is to:
6b2. Put Grub in the MBR of the PATA drive.
6b3. Have BIOS boot off PATA.
6b4. Somehow, map the Win2k drive from (hd1) to (hd0).
6b5. Somehow, map the Debian PATA drive from (hd0) to (hd1).
6b6. This can be accomplished via:
title Windows NT/2000/XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
savedefault
makeactive
chainloader +1
or by:
title WinXP 0x80<->0x81+hd1
map (0x81) (0x80)
map (0x80) (0x81)
rootnoverify (hd1,0)
makeactive
chainloader +1
6b7. This is currently what I'm doing. I'd like to do something else
since I'd like to do something else with that PATA drive.
6c1. Another way is to:
6c2. Put Grub on the MBR of the Win2k SATA drive.
6c3. Have BIOS boot SATA first.
6c4. And use the Grub stanzas above, without using the map command since
Win2k will already be the first drive.
What I plan on doing is:
* install-grub /dev/hde
* Remove the two map commands from the win2k stanza.
* Change the drive numbers around in Grub's menu file.
* Reboot
* Change BIOS to boot off SATA first.
* Cross my fingers.
Pete
--
Make everything as simple as possible, but no simpler. -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
More information about the vox-tech
mailing list