Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-08-2003, 10:38 PM
|
#1
|
Member
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99
Rep: 
|
Windowze will overwrite my MBR
Hello. I run Mandrake 9.1. I will be forced to install Windows XP in a week, by doing so It will overwrite the MBR, so I wont be able to run the GRUB to decide which OS I wanna boot. I think the only solution is to copy the LILO or GRUB (either one) to a floppy disc and boot from it after installing XP. the problem---> I dont know how to install grub or Lilo in a floppy.
If there is any other way around please tell me, otherwise I would appreciate any help u can give me.
Thanks

|
|
|
09-08-2003, 11:16 PM
|
#2
|
LQ Guru
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796
Rep:
|
creating a grub boot disk is easy, first insert a floppy, if it's not formatted do:
mke2fs /dev/fd0
then mount it, for example on /mnt/floppy:
mount -t ext2 /dev/fd0 /mnt/floppy
then do:
grub-install --root-directory=/mnt/floppy 'fd0'
and that's it you got yourself a grub bootdisk. When you want to reinstall grub into MBR just boot with the disk, then after you get to the grub prompt first change the root to where your /boot directory is by doing
root (hd0,0)
if its in the first partition of primary master
then:
setup (hd0)
to reinstall it in mbr
|
|
|
09-08-2003, 11:20 PM
|
#3
|
LQ Addict
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661
Rep:
|
You can do it using the installation CD of mandrake. I forget the exact procedures but search here on the forum and you'll find it.
Another way to do it is to make a boot floppy using the tool available in mandrake control center ->boot. Start mandrake using the floppy and then reinstall lilo or grub once you have mandrake up and running. BTW, having a boot floppy is always a good idea.
|
|
|
09-09-2003, 11:44 AM
|
#4
|
LQ Newbie
Registered: May 2003
Location: Melbourne, Victoria, Australia
Distribution: RH9.0, Fedora Core 1, Fedora Core 2
Posts: 19
Rep:
|
purefan,
This is one of the solutions that I got off the net. It's for RedHat, but should work with Mandrake also.
Put the redhat boot disk you created on the installation on the floppy
drive, boot the system and run grub command
Remember that for grub (hd0,1) means hda (primary controller master), second partition.
Now we need to tell grub where are the grub files:
If you know where they are type something like:
root (hd0,1)
else if you have no idea, type:
find /boot/grub/stage1
and then the root command with the correct parameters
setup (hd0)
to install it on hd0 that is MBR of the first HD
type quit and reboot
The menu will appear again.
The other way is :
If you didn't create the boot disk, boot with the Red Hat Linux CD number 1 and choosse rescue mode typing:
linux rescue
Now you need to repair the ext3 filesystem because now it's bigger than before and the journal file must be created again
First, check the filesystem:
fsck.ext3 /dev/hda2
Now, create again the journaling ext3 file:
tune2fs -j /dev/hda2
Now mount the root filesystem on /mnt/sysimage and run grub
mount -t ext2 /dev/hda2 /mnt/sysimage
cd /mnt/sysimage
cd sbin
grub
Once started, GRUB will show the command-line interface . First, set the GRUB's root device1 to the boot directory, like this:
grub> root (hd0,1)
If you are not sure which partition actually holds these files, use the command find, like this:
grub> find /boot/grub/stage1
This will search for the file name /boot/grub/stage1 and show the devices which contain the file.
Note added by: John Neuhaus
If you are using a separate /boot partition , as the official documentation says:
"... if you have the partition /boot and you install GRUB images into the directory /boot/grub, GRUB recognizes that the images lies under the directory /grub but not /boot/grub"
Then if 'find /boot/grub/stage1' does not find the file, try 'find /grub/stage1'
Once you've set the root device correctly, run the command setup :
grub> setup (hd0)
This command will install GRUB on the MBR in the first drive.
It's worked successfully on my RedHat 9.0.
-Akshar
|
|
|
09-09-2003, 01:03 PM
|
#5
|
Senior Member
Registered: Jun 2003
Distribution: Debian/other
Posts: 2,104
Rep:
|
Another way is just to make a simple boot floppy with mkbootdisk
Put a blank floppy in your drive:
su to root user in a shell then type
mkbootdisk 2.4.21-0.13mdk
You can use this to boot into MAndrake any time - then when your ready just re-install your bootloader as required.
|
|
|
09-09-2003, 06:47 PM
|
#6
|
Member
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99
Original Poster
Rep: 
|
Thank you all for the help, I have my problem totally fixed now and can install the windoze without worries.
I appreciate all your concern.
Have a good day
|
|
|
All times are GMT -5. The time now is 03:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|