Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dual boot gentoo and win98 problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Sun Apr 13, 2003 3:47 am    Post subject: Dual boot gentoo and win98 problems Reply with quote

I knew I'd be back... :?

I'm still working on my first dual boot Gentoo system, and can boot into Gentoo without difficulty. Booting into Win98 is another issue entirely.

Here's my partition setup:

/dev/hda1     Win98   (FAT32) [boot flag set]

/dev/hda2     [extended] which contains:

/dev/hda5     /boot    (ext3)
/dev/hda6     /          (ReiserFS)
/dev/hda7     swap
/dev/hda8     /home  (ReiserFS)

My grub.conf file looks like this:

Code:
default 0
timeout 30
splashimage=hd(0,4)/boot/grub/splash.xpm.gz

title=Gentoo
root (hd0,4)
kernel (hd0,4)/boot/bzImage root=/dev/hde6

title=Win98
root (hd0,0)
makeactive
chainloader +1


The code for Win98 worked for my previous installation of SuSE on this machine.

When I boot the computer, I get a nice splash screen, with options for wither Gentoo or Win98. If I pick Gentoo, I get into Gentoo without problems. If I pick Win98, on the other hand, the screen blanks and I go back into the grub splashscreen and the menu options again.

My Win98 partition is intact -- I can see all the files from within Gentoo.

During my experimenting with grub, I have typed in various combinations of root (hd0,0/hd0,4) and setup (hd0/hd0,0/hd0,4), so I don't know if that is screwing things up.

What am I doing wrong?
Back to top
View user's profile Send private message
xenon
Guru
Guru


Joined: 25 Dec 2002
Posts: 432
Location: Europe

PostPosted: Sun Apr 13, 2003 4:10 am    Post subject: Reply with quote

My system works this way - I have Windows on a hard disk, and Gentoo on the other one; the machine boots from the Gentoo disk, through Grub.

Code:
default 0
timeout 10
splashimage=(hd0,4)/boot/grub/splash.xpm.gz

title=Gentoo Linux
root (hd0,4)
kernel /boot/bzImage root=/dev/hdc1 hdb=ide-scsi hdd=ide-scsi

title=Windows XP Professional
map (hd1) (hd0)
map (hd0) (hd1)
root (hd1,0)
makeactive
chainloader +1
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Apr 13, 2003 4:55 am    Post subject: Reply with quote

wilburpan wrote:
During my experimenting with grub, I have typed in various combinations of root (hd0,0/hd0,4) and setup (hd0/hd0,0/hd0,4), so I don't know if that is screwing things up.

setup (hd0) did the correct thing (installing GRUB into the MBR)
setup (hd0,4) is harmless (installing GRUB into your /boot partition)
setup (hd0,0) caused your problem (replacing the Win98 bootloader with another copy of GRUB)
Now when you use the chainloader command, it loads another copy of GRUB.
I'm not sure how to restore the Win98 bootloader short of reinstalling Windows.
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Sun Apr 13, 2003 6:49 pm    Post subject: Reply with quote

cyrillic wrote:
setup (hd0) did the correct thing (installing GRUB into the MBR)
setup (hd0,4) is harmless (installing GRUB into your /boot partition)
setup (hd0,0) caused your problem (replacing the Win98 bootloader with another copy of GRUB)
Now when you use the chainloader command, it loads another copy of GRUB.
I'm not sure how to restore the Win98 bootloader short of reinstalling Windows.

Thanks! setup (hd0,0) was the problem. I killed my Win98 bootloader with grub.

Just in case anyone else out there makes the same mistake I did, here's what I did to fix this. I found this information on this webpage.

Before you start, you need a Windows boot floppy and a way of booting into Gentoo from a floppy.

1. Get back into Gentoo.

2. Zero out the MBR by using the dd command:
Code:
dd if=/dev/zero of=/dev/hda bs=446 count=1

bs=446 zeroes out the MBR but leaves your partition table alone.

3. Zero out the boot sector of the Windows partition:
Code:
dd if=/dev/zero of=/dev/hda1 bs=512 count=1

Replace /dev/hda1 with the appropriate pointer to your Windows partition.

4. Reboot into Win98 with a Windows boot disk. Rewrite the Windows MBR by using fdisk:
Code:
fdisk /mbr


5. Copy the Windows system files from your boot floppy to your Windows partition boot sector by using the sys command:
Code:
sys a: c:


6. Check to make sure you've recovered Windows by rebooting from your hard drive. You should go straight into Windows, since you've rewritten the MBR in step 4 and the Windows partition boot sector in step 5. Gentoo is still on your hard drive in its partitions, just not accessible at this point.

7. Use a Gentoo boot disk to get you back into your Gentoo installation. I used my grub boot disk for this part.

8. Reinstall grub the way that you were planning to, but make sure you don't install it onto your Windows boot sector again or you will have to start over. On the other hand, you could deliberately kill the Win98 bootloader with grub and fix it again to prove that you can recover from real boneheaded moves like I did. One more point to the superiority of Linux over Windows. :D

Now I'm off to build a desktop environment.
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Sun Apr 13, 2003 7:08 pm    Post subject: Reply with quote

Thanks wilburpan.
I find myself using Windows less and less, but this tip will come in very handy in case I need to fix a friend's computer.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum