?
Solved

Gentoo Linux  & WinXP dual boot

Posted on 2004-04-26
12
Medium Priority
?
387 Views
Last Modified: 2013-12-06
Hi,

I have a laptop (IBM T41) with Gentoo Linux installed, with GRUB as the boot loader. I wanted to make this a dual boot system, so I installed WinXP in another partition. I didn't realise winxp would write over the boot partition.

Using fdisk I was able to change the active partition, but if any other partition other than winxp is set active, I get an "error loading operating system" message.

Next I downloaded KNOPPIX (linux on disc), and this boots fine off the cd. I can access the linux partitions and the winxp partition, so, at least none of the information is lost.

I now need to make the original gentoo linux bootable. I presume this means rewriting over the MBR, but I have no idea how. Also, I don't have a linux boot disk...

Can anybody help?

Thanks in advance,
Ru
0
Comment
Question by:ruadhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
12 Comments
 
LVL 8

Expert Comment

by:da99rmd
ID: 10917835
This will install grub on MBR of hda
grub-install /dev/hda (assume hda)

Edit the /etc/grub.conf
default=0
timeout=10
#(hd0,0) if you have the linux /boot partition on hda1
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.7-10)
      root (hd0,0)
      kernel /vmlinuz-2.4.7-10 ro root=/dev/hda6
      initrd /initrd-2.4.7-10.img

title Windows XP
# If you have linux on hda3
      rootnoverify (hd0,2)
      chainloader +1

#end
/Rob
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10918370
Dont forget to chroot to the root of your orginal install of Gentoo
Before running the grub-intsall

/Rob
0
 

Author Comment

by:ruadhan
ID: 10959229
Hi,

Do I edit grub.conf before I run grub-install?

Currently in /mnt/hda1 I have a grub/ folder which contains a grub.conf file.

Ruadhan
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 

Author Comment

by:ruadhan
ID: 10959245
oh yeah, nearly forgot, the /boot folder is on the same partition as the rest of the linux stuff (hda4)
is this ok?

ruadhan
0
 

Author Comment

by:ruadhan
ID: 10959572
tried to execute, but I get the following output:
 
root@ttyp0[grub]# chroot /mnt/hda4/ grub-install
/sbin/grub-install: lin 59: cannot create temp file for here document: Read-only file system

Looks like knoppix doesn't want to write anything to the disk
what can I do now?

Cheers

0
 

Author Comment

by:ruadhan
ID: 10959718
ok made the partitions writable

then i executed the following and got some output:

root@ttyp0[/]# chroot /mnt/hda4 grub-install /dev/hda
/dev/hda does not have any corresponding BIOS drive
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 10975431
Thats because you chroot i think, try writing the
grub-install --root-directory=/mnt/hda/boot /dev/hda
without chroot first.
/Rob
0
 
LVL 2

Accepted Solution

by:
Cicha earned 2000 total points
ID: 11030857
You can use grup install of couse,
but I prefer use grub stages and dd utils:
first - load from KNOPPIX
secoud - mount gentoo root portision to /folder
then - make boot floppy disk
# cd /folder/usr/share/grub/i386-pc
# dd if=stage1 of=/dev/fd0 bs=512 count=1
# dd if=stage2 of=/dev/fd0 bs=512 seek=1
then reload from floppy
and in grub enter following commands:
root (hd0,0); #were hd0,0 your boot partition
setup (hd0); #This command will install the GRUB boot loader on the Master Boot Record (MBR) of  the first drive.

And boot from hda now ready
0
 

Author Comment

by:ruadhan
ID: 11100920
Hi Cicha

Do I have to write directly to /dev/fd0? Currently the only floppy drive I have is an external pcmcia one, but KNOPPIX doesn't support it. I have a new one on order, but until it arrives...
Can I copy these files to a temp folder, transfer them to another machine, burn to cd, and then boot off the cd. How do I make the cd bootable if I do this?
0
 
LVL 2

Expert Comment

by:Cicha
ID: 11142893
Can you just start command grub ?
0
 
LVL 8

Expert Comment

by:da99rmd
ID: 11143410
ruadhan,
> root@ttyp0[/]# chroot /mnt/hda4 grub-install /dev/hda
> /dev/hda does not have any corresponding BIOS drive
This is because you changed root first.
just write the grubb-install /dev/hda
with out changeing root.
/Rob
0
 

Author Comment

by:ruadhan
ID: 11163670
Hey

Thanks for all the help. I managed to get a USB floppy installed. KNOPPIX couldnt see it straight off, so had to mount it as a SCSI

# mkdir /mnt/usbdisk1
# mount -t vfat /dev/sda /mnt/usbdisk1

Then to make the boot disk was
# dd if=stage1 of=/dev/sda bs=512 count=1
# dd if=stage2 of=/dev/sda bs=512 seek=1

and the rest was just like cicha said.

Thanks again for all contributions
ruadhan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question