Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
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.
i have a dual boot machine with XP and RH8.0
i had to format my c drive and hence the MBR also got formatted and so did the grub. how do i reinstall grub in MBR?i do not want to destgroy the data. so no reload for me!
I faced the same problem a couple of weeks back. I found a solution online and am pasting from the same document.
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
Another solution 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.
umashanker, i had given forst shot to your method (because it was short and hence easy ) but it di not work. i got the message..
grub: could not find file or directory.
Thnx anyway.
and akshar, if possible send me the address of this document which u had pasted as solution to my problem.. i m assembling all the useful links on my website for use of other people.. so kindle oblige.
(once more )
'Twas a long time back (in computer years) that I looked it up online. I think your option would be to google and find the page....check out "Restoring Grub" on Google, thats how I got to the site.
Glad to know that I could be of help....
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.