LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Recovering linux after resetting MBR (https://www.linuxquestions.org/questions/linux-newbie-8/recovering-linux-after-resetting-mbr-154166/)

hackop 03-06-2004 08:29 AM

Recovering linux after resetting MBR
 
Hello,
I'm new to linux and last night I had a bit of a problem. First off, I had a dual boot of Windows XP and Fedora Core 1. Everything was working fine until last night when I went to boot into WinXP. I couldn't boot into it at all. It would just BSOD and reboot the machine. So, I went in via recovery console and did a "fixboot" "fixmbr" to reset the boot records. In the process, I also erased Grub from the MBR. Now, I have WinXP working, but I cannot access my partition. What makes this worse is that my computer doesn't have a floppy drive in it, as I've not had a chance to replace it since it died. I DO have a USB flash drive that the bios can boot from, but I don't know how to format that (or even access it from linux) so that I can set it up as a linux boot device. If anyone has experienced this before, or knows a way to help me get back to my precious linux without reinstalling and losing all of my data, please give me a heads up. Thanks a lot!

-Scott

rberry88 03-06-2004 08:57 AM

You can just put in your Linux Install CD#1 and use the Linux rescue mode to re-install grub.

A search on these boards will give you plenty to fix your problem.

rberry88

lugoteehalt 03-06-2004 08:58 AM

Quote:

reinstalling and losing all of my data
As you may know having /home on its own partition enables you to re-install without destroying your own stuff. You could keep copies of configuration files in there too.

For God's sake don't take my word for it, but doing:
grub-install /dev/hda
might fix grub. May be slightly different syntax with your thing.

Qzukk 03-06-2004 09:07 AM

Hmm... do you have a cdrom you can boot from? The fedora cd should have a rescue mode on its boot menu (typically "rescue root=/dev/rootpartitionname")

If booting from flash is the only way to go, you'll need a formatting utility for flash drives. It *appears* that the flash drive booting process is the same as a harddrive (with partitions and an MBR). Install something like <a href="http://www.freedos.org">FreeDOS</a> and then find a copy of loadlin and a kernel image to load with it.

Or, if you have access to another Linux machine (or you can figure out how to do these things from Windows) there are instructions <a href="http://am.xs4all.nl/phpwiki/index.php/UsbMorphix">here</a> for it. Remember, you're just out to get a kernel to boot, so that you can give it the root=/dev/rootpartitionname parameter and boot into your real Linux install and redo your boot record.

hackop 03-06-2004 09:21 AM

Thank you. I tried the rescue disc last night, but it didn't have an option to reinstall grub and I didn't know any manual commands to do it myself. But, I took what lugoteehalt posted and tried that and luckily it worked. However, I have a feeling that Windows is going to crash again in time because I've read that XP doesn't like it when it's not in the MBR. I guess I'll see if I can start using the Windows bootloader to boot linux as well.

Qzukk 03-06-2004 11:38 AM

For that you'll want to do something like this:
1 - Remove grub
2 - install lilo, edit lilo.conf and set boot= to /dev/partition-linux-is-on (instead of /dev/hda). Configure the linux boot option to point to your kernel, and any other settings you need.
3 - run /sbin/lilo

Then, in Windows, get bootpart from http://www.winimage.com/bootpart.htm and tell it to add an entry to the boot manager for your linux partition (you'll need to read the docs to see how linux numbering and windows numbering match up. Then when you boot windows, you'll get a menu of what to boot. Choosing linux will start lilo, which will then boot linux.

lugoteehalt 03-10-2004 09:46 AM

Seems a bit rough on poor old grub, after it's done such a splendid job.:)


All times are GMT -5. The time now is 03:16 PM.