How to Fix a FUBAR'd MBR w/out Formatting


Recommended Posts

Fixing the Master Boot Record without Formatting

This is the ONLY guide on the web to fixing a FUBAR'd MBR without formatting or deleting your partitions.

A FUBAR'd MBR is one that cannot be repaired by using fixmbr or fdisk/mbr.

A warning: all the steps are laid out very clearly, but it takes absouloutely forever to carry out. Its a long and harsh road, but the path is clearly marked, there are no dead ends, and all the pot-holes are filled.

For n00bs and advanced alike, this works, and it works well. It will test your patience and your resolve, but ITS WORTH IT.

YOU WILL NOT LOSE A SINGLE BYTE OF DATA!

This is the ONLY way. I searched the entire web for a safe and secure way of pulling it off, and THERE WAS NONE.

There are some steps that can and are in the process of being shortened.

You are required to install Linux, but we will not even step foot in it. Do not be afraid :)

Please post feedback on the blog, its where people from all over the web will be reading the guide in the end.

EDIT

Forgot to post a link :pinch:

Left a moment there - not sure if all that was actually necessary at this point in time....

But at the very least, his steps are detailed *and* explained - so anyone carefully reading the blog and not thinking they know what to do and getting ahead of themselves should have a working MBR in a matter of an hour or less.

Thanks John.

I left a reply to your post there....

Basically I am working on trying to find a copy of a Grub Installer that boots from a floppy or something, without Linux at all. I think that will make it a lot easier, no Linux download, and no Resuce Mode for people who already installed Linux.

Plus, most beginners tremble at the *nix word :)

Hmmm, I wonder if I can assist you in this venture. I don't know if there is a floppy - accessible GRUB, b/c I am not sure that it will fit - but a very tine ISO would work just as well, and not limit you to a 1.44 / 1.76 (in case you use the M$ Extended Floppy format) barrier.

A 3 MB ISO may seem like a waste of a CDR - but if that ISO saves their arse even *one* they'll place it in storage and refer to it every single time.

EDIT: Added the following

Read your replies, and replied again. Thanks again for a well documented and clarified guide. As I said before as long as n00bs / lusers don't get ahead of themselves, they'll be back up and running in under an hour.

Now to find out if there is a GRUB install for use for the fix to avoid having to get a 20-40 MB install CD download (I personally use Gentoo, and the minimal CDs for it at 65 MB, but there *has* to be a way of compressing only the *absolutely* essential files into a minute image.

Edited by johngalt

Kewl. I will keep an eye out for it as well. I *know* there was a distro that was floppy loadable, and thus I may be wrong about GRUB not fitting on a floppy, but I cannot remember for sure.

And no, not referring to QNX - that is a different flavor entirely - and I have used it before when I worked at IBM. This was something more recent that I saw.

If you can install Grub to a floppy, and can locate the grub files on the floppy, I got the entry that will allow you to automatically install it to a HD....

We can edit it so that it can take into account various types of HDs - such as (hd0,0) etc, or to see how it works (if differently) for SATA drives.

try this:

#For installing GRUB into the hard disk
title Install GRUB into the hard disk
root    (hd2,0)
setup   (hd0)

In this example, my 'root' files, IE where the grub.conf is located, is [hd2,0]. By altering that you should be able to install Grub to the HD from a floppy, no?

EDIT: Added the following

In fact, that should work correctly, except that from that point on it would look for the floppy diskette every time it booted, and then the 'optional' steps at the end to remove GRUB would become mandatory to help fix it.

Of course, as you also mentioned in the guide, if the user already has Linux then they can perform this themselves and save a lot of time.

looks like this is shaping up nicely :) Good work John ^*^

Anyway, just a couple of things that I think would need to be looked at first however:

1) If I were to make the Grub floppy image on my computer, then distribute the unpacker that users can run, the entries in Grub will correspond to teh entries on my pc.. i.e. Windows on hd0,0 and linux on hd0,3 and hd1,2

There needs to be a wizard that will correctly identify the existing partitions. especially since the command to boot to windows is drastically different from booting to Linux, and not all of our users will be on one system or the other, ther are some linux-only and windows-only people.

but its a start :) I'm working on it too... just reinstalling FC4 tonight the real way (did the minimal install to get my MBR working he he) then I will see what i can get.

again, thanks a million!

Hmmm.... this is getting tricky - but you could *theoretically* make multiple entries - like this:

#For installing GRUB onto device IDE 0 Disk 0
title Install GRUB into the hard disk
root    (fd0) [color=#FF0000]<--- changed that - that *should* be correct for locating the grub.conf on the floppy[/color]
setup   (hd0)

#For installing GRUB onto device IDE 0 Disk 1
title Install GRUB into the hard disk
root    (fd0) [color=#FF0000]<--- changed that - that *should* be correct for locating the grub.conf on the floppy[/color]
setup   (hd1)

#For installing GRUB onto device IDE 1 Disk 0
title Install GRUB into the hard disk
root    (fd0) [color=#FF0000]<--- changed that - that *should* be correct for locating the grub.conf on the floppy[/color]
setup   (hd2)

#For installing GRUB onto device IDE 1 Disk 1
title Install GRUB into the hard disk
root    (fd0) [color=#FF0000]<--- changed that - that *should* be correct for locating the grub.conf on the floppy[/color]
setup   (hd3)

Of course, then, if SATA drives are represented differently (I don't have access to am cine with SATA enabled, so I cannot say one way or another) then that will need editing as well to add entries for SATA drives.

An easier way might be to make sure there is no timeout setting (either set it extremely high, like 65535, or comment it out completely) so the user is *forced* to make a choice, then give him the commands to do so, with an explanation:

title Please read this carefully.  You have just booted your system
title with a *nix boot loader called GRUB.  In order to facilitate the
title MBR fix process, please select the very last entry in this list
title using the arrow keys and then hit the [E] key to edit the entry.
title Use the arrow keys to select the last line, which should have
title the syntax "setup (hd0)" - replace the 'hd0' part, leaving the
title parentheses, with your Windows system drive number - i.e.
title if the Windows disk is the master drive on the primary IDE
title channel, then use hd0 - if it is the slave drive on the primary
title IDE channel, use hd1.  Master on the 2nd IDE channel = hd2
title and slave on 2nd IDE is hd3.  Please note that IDE nomenclature
title starts at 0, so IDE 0 is the first* IDE channel and IDE 1 is the 2nd.
root (fd0)
setup (hd0)

Not exactly a wizard, but getting there- still not very n00b friendly, I admit, as you have to be savvy enough to know 8where you stuff is installed.

But a wizard on a floppy - umm, well...I don't see it.

Kudzu can probably run off the CD ISO image I mentioned earlier ;-0

well, I *may* have found something easier:

Invoking grub-install

The program grub-install installs GRUB on your drive using the grub shell (see Invoking the grub shell). You must specify the device name on which you want to install GRUB, like this:

    grub-install install_device

   

The device name install_device is an OS device name or a GRUB device name.

grub-install accepts the following options:

--help

Print a summary of the command-line options and exit.

--version

Print the version number of GRUB and exit.

--force-lba

Force GRUB to use LBA mode even for a buggy BIOS. Use this option only if your BIOS doesn't work properly in LBA mode even though it supports LBA mode.

--root-directory=dir

Install GRUB images under the directory dir instead of the root directory. This option is useful when you want to install GRUB into a separate partition or a removable disk. Here is an example in which you have a separate boot partition which is mounted on /boot:

          grub-install --root-directory=/boot hd0

         

--grub-shell=file

Use file as the grub shell. You can append arbitrary options to file after the file name, like this:

          grub-install --grub-shell="grub --read-only" /dev/fd0

         

--recheck

Recheck the device map, even if /boot/grub/device.map already exists. You should use this option whenever you add/remove a disk into/from your computer.

THis is a helper program that comes with the grub package. It can theoretically be invoked to install to the MBR via a script. Now the only problem would be, that a simply MS Boot Disk would not suffice, we woudl have to have a complete linux kernel fit on a floppy! but nesides the kernel there would not be anything, since the only thing we need is the kernel to run the grub-install script.

We could add grub-install as runtime script, it would install and then exit.

However, now seems to be the right time to ask this quesion: Do we *need* a floppy image? In this day and age, most new PCs do not have floppies. Every PC needs a CD-Drive however.... I personally have a floppy cuz many morons from the past still give me files via 3.25, but its disabled from teh BIOS for virus protection and speeded booting

That is the one I was trying to find lol.

I forgot about grub-install script, figures though since I always manually install grub by running grub from the CL....

I also still have a floppy in my system (both of them in fact) and can *easily* test the install scripts as well. The best part? Both machines (P4 2.0 GHz and Celeron 366 laptop) already have GRUB installed to hd0 to begin with, so as long as it is a current version of Grub, it will not affect anything (of course, I will have to manually specify the root folder to avoid losing my current configurations, but that is easy enough).

But, you still are no closer to a wizard / script that *auto* detects the HD and knows where to place it, no?

actually, we are.

Grub-install itself I *believe* does that. its how you get standard grub.conf across all distros.

My FC4 install last night went awry, guess where: Grub! Yep, apparently if you give the ext3 partition a name (Like I did mine: Fedora Core 4), then assign it a label '/' in FC4 setup, grub wont boot it.. you get kernel panic....

Soon as its fixed I'll try to compile a script and get you a copy.

thnks!

I can check now - great little tool called RSFgui - windows executable that allows you to read ReiserFS partitions (which is what I use for Gentoo).

Just as I thought - no grub-install script in /boot/grub.

I will try searching the usually /bin /sbin etc dirs later on. but I haven't gotten X working fully yet so I have no real Internet access. Yet. (and yes, by Internet access I mean the ability to enter forums and read stuff and reply. Not even via elinks / links2.

I went ahead and rated ya a 5 - with the work you're putting in to it it is definitely worth that much - even if it only saves .0001% of all computers out there - all those folks are gonna love you for life.

better than RSFgui, there are programs that can mount reiserfs systems in my computer, from where you can read and write to the NATIVELY!

i am usng ext3 with IFS Drives, (its free), but hope to upgrade to resiserfs soon

thanks for the rate... anyone else :D

best of luck with you net.. Linux needs net very much

Yeah, I said *net8 and meant GUI. I can do things without a GUI, but browsing is still too much of a PITA without a GUI.

When you said tools to mount ReiserFS, were you referring to *windows*? because I have been looking for such a tool and cannot find it.

If you meant in Linux, *that* I can see - building support for it in your kernel helps tremendously.

Cool!

I just formatted my nix :(

I downloaded Gentoo 2005.1 it reached 99% (with GetRight) then all of a sudden it resets to ZERO!

BUT before that I made much progress in Fedora Core with grub-install.

1) Grub2 is not yet included with anything, and hard to install. If we use GRUB2 = much more happy people!

2) grub-install is very picky on where it is installed to, gives much trouble if the first partition is NTFS :(

3) Grub itself comes with a basic bash.... can be used to run Grub-Install from within Grub?!

4) Looking a tad harder, but much clearer.

well, it depends upon which Gentoo 2005.1 you are downloading - and sometimes those managers get FUBAR'd from the several mirrors available - There are so many ways to get Gentoo working that it is impossible for me to know which one you are using.

I *can* say that there is now a Gentoo LiveCD (and a Live DVD as well, ISTR) that allow you to install from a GUI based installer script, but also allow you to simply have a working install environment when installing. The basic problem is that different boot CDs have support for different parameters - for example, if you want to use LVM, then you'll not be able to go through a stage 1 (I think). Other restrictions apply as well.

Regarding grub-install - I had a feeling that this would be the case seeing as it was an install script....

re: Grub itself - that is what the install entry I have in my grub.conf makes use of....

as long as it does not get hazy, you are all good.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Nvidia GeForce NOW gains support for Dark Scrolls, Empulse, and more by Pulasthi Ariyasinghe The final update of June for Nvidia's cloud gaming service GeForce NOW is now available, and it is touting support for six more games. The company is also drawing subscriber attention towards the summer sales kicking off across stores, so they can stock up on more cloud-supported titles. Of course, the Steam Summer Sale is the biggest promotion, which is kicking off later today. "Supported Steam games can be streamed across devices with GeForce NOW, making it easy to buy a game once, keep progress synced and pick up where the gameplay left off on PCs, Macs, handheld devices, phones, TVs and more," says the company. "In other words, the Steam Summer Sale brings the deals; GeForce NOW adds the flexibility." Don't forget that the GeForce NOW summer sale is still active as well. This limited-time offer drops the 12-month Performance membership from $99.99 to $64.99, saving members $35. At the same time, the 12-month Ultimate membership is currently going for $129.99, dropping the price by $70 from the original $199.99. Here are the games joining GeForce NOW's supported list this week: Dark Scrolls (New release on Steam, available June 22) SAND: Raiders of Sophie (New release on Steam, available June 22) Deer & Boy (New release on Steam, available June 23) EMPULSE (New release on Steam, available June 24) The Adventures of Elliot: The Millennium Tales (Steam) FATAL FURY: City of the Wolves (Steam) With the June expansions coming to an end, Nvidia should be announcing its July GeForce NOW plans next week. Keep in mind that, unlike subscription services like Game Pass or EA Play, a copy of a game must be owned by the GeForce NOW member (or at least have a license via PC Game Pass) to start playing via Nvidia's cloud servers. There is also a limit to how many hours subscribers can use the service per month.
    • Davinci Resolve 21.0.1 by Razvan Serea DaVinci Resolve is the world’s only solution that combines editing, color correction, visual effects, motion graphics and audio post production all in one software tool! Its elegant, modern interface is fast to learn and easy for new users, yet powerful for professionals. DaVinci Resolve lets you work faster and at a higher quality because you don’t have to learn multiple apps or switch software for different tasks. That means you can work with camera original quality images throughout the entire process. It’s like having your own post production studio in a single app! Best of all, by learning DaVinci Resolve, you’re learning how to use the exact same tools used by Hollywood professionals! DaVinci Resolve is the only post production software designed for true collaboration. Multiple editors, assistants, colorists, VFX artists and sound designers can all work on the same project at the same time! Whether you’re an individual artist, or part of a larger collaborative team, it’s easy to see why DaVinci Resolve is the standard for high end post production and is used for finishing more Hollywood feature films, episodic television programing and TV commercials than any other software. Davinci Resolve 21.0.1 release notes: Addressed multiple DNG and Apple ProRAW color issues. Addressed issue with automatic smart bins after deleting keywords. Addressed issue with multiple linked audio in media management. Addressed multiple Resolve FX issues in photo page. Addressed issue with key shortcut to switch viewer in photo page. More consistent creation of new photo albums. Addressed color thumbnail refresh for photo transform indicator. Transcription now honors project settings language. Improved face recognition in IntelliSearch. Addressed exported bins not retaining generator and title properties. Addressed ease control display and sensitivity issues. Addressed keyframe issue when copying clips with Fusion effects. Addressed keyframe refresh for Fusion effects in the edit page. Addressed issue with 3D renders in Linux with non-English locales. Addressed Fusion viewer color issue for some RCM settings. Addressed issue with saturation limits in Fusion gradient controls. Addressed Fusion display issues with dual screen layouts. Addressed issue with non-English character inputs in Linux. Disabling MultiMaster now disables trim blanking controls. Addressed crash in some scenarios with CineFocus. Addressed lag when toggling bypass grades and Fusion effects. Addressed occasional issue with Fairlight loudness meters. Addressed data burn display of good take tag in upgraded projects. Addressed project manager scroll lag for large project libraries. Support for Sony Alpha 7R VI ARW RAW stills. Support for decoding Affinity RGB 16-bit formats. Addressed a color issue with MainConcept H.265 HDR renders. Addressed a color issue with Windows native H.265 HDR renders. RemoveMotionBlur API now uses correct encode parameters. Addressed character limit consistency in GenerateSpeech API. General performance and stability improvements. Download page: Davinci Resolve 21.0.1 | 3300 MB (Free, paid upgrade available) Links: DaVinci Resolve Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • There are so many of these apps now that do this, what do people recommend?
    • Just the price of doing business. The scamble to pull as much from the web as possible is happening, and it's happening before a case like this changes how or what is legal do to with AI in terms of data harvesting. But even then as we've seen with the likes of Google who ignore cookie requests and just accept the fact they'll get fined, it's built into their business price model now. AI is here, its not going away. Their reward if any from the court case would be best suited to trying to incorprate AI or licence their end points as authentic human verified content. The problem is, as we've seen these same news papers are using AI themselves.
  • Recent Achievements

    • First Post
      kinowa earned a badge
      First Post
    • Rookie
      krychek57 went up a rank
      Rookie
    • Grand Master
      Jaybonaut went up a rank
      Grand Master
    • One Year In
      Philsl earned a badge
      One Year In
    • Dedicated
      Scoobystu earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      462
    2. 2
      +Edouard
      172
    3. 3
      PsYcHoKiLLa
      137
    4. 4
      Michael Scrip
      78
    5. 5
      Xenon
      77
  • Tell a friend

    Love Neowin? Tell a friend!