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

    • Doogee and Ulefone regularly release phones with 10k-25k mAh batteries, but those are bricks. I don't understand how they could make it only weigh 220 grams with a battery that size.
    • Windows 10 quietly gets one more year of support and updates by Taras Buria Windows 10 reached its end of life at the end of 2025. Microsoft kicked off the Extended Security Updates program, aimed at giving regular consumers one more year of security-only updates. By doing so, Microsoft gave users more time and money to update their computers to a newer operating system or compatible hardware. Now, with the end of the Extended Security Updates program quickly approaching, Microsoft is making an important adjustment. Users discovered that the official support article for the program now lists a new end-of-support date: The Extended Security Updates program is not a new concept. It has been an official way for business consumers to continue receiving critical updates for unsupported Microsoft products for many years. However, all this time, it was a business-only, paid feature. With Windows 10, Microsoft brought ESU to regular consumers, allowing them to get security updates for Windows 10 past October 2025 essentially for free. When Windows 10 was approaching the end of support, many guessed that Microsoft might adjust its support timelines, and this is exactly what seems to be happening. Of course, Microsoft would love everyone to switch to new computers, such as its latest Surface devices, but in the days of ever-growing hardware prices, not everyone is lucky enough to have money for a new PC. Leaving hundreds of millions of customers with a Windows version that no longer receives security updates is a major risk that Microsoft is not willing to take. If you have a Windows 10 PC to enroll in the Extended Security Updates program, check out this guide to learn how to do so.
    • Sony announces Bungie layoffs that will affect "significant number of employees" by Pulasthi Ariyasinghe Sony today announced that major layoffs are happening at its first-party studio Bungie, the developer that has spawned series like Halo, Destiny, and Marathon over the past decades. The news arrives just weeks after Bungie delivered the final update to Destiny 2, and it's that team being hit with the layoffs the most. CEO of Sony Interactive Entertainment Hermen Hulst revealed the staff reduction today, calling it "painful news." "Over the past several months, together with Bungie leadership, we reviewed the studio’s long-term direction, development priorities, resource needs, and role within our broader portfolio strategy," said Hulst, explaining the decision. "We explored multiple alternatives before concluding that a reduction was necessary to align the studio’s resources with its current priorities and long-term goals." The layoffs will be hitting "a significant number of employees" across most of the Destiny franchise development team. It doesn't look like Sony is planning to continue the series following Destiny 2's sunsetting update. The studio is said to be in early stages of looking at other projects to pivot to, but it's said that keeping the size of the team at current levels is no longer feasible. "We know this decision has a profound impact on the people affected, their families, friends, and teammates," said Bungie leadership in a separate message on social media. "While these changes are necessary to best position the studio now and for the future, that does not lessen the difficulty of this moment or the impact it has on those affected." At the same time, "some" of the Marathon development team are also affected by the layoffs. The recently released multiplayer-only extraction shooter title hasn't seen a big boom of players either, but the company is reportedly hoping that the live service experience will pick up players with future updates.
    • Microsoft adds reusable skills and finance data connectors to Copilot in Excel by Karthik Mudaliar Microsoft is giving Copilot in Excel a collection of new features aimed squarely at finance teams. The update introduces reusable instructions for common tasks, connections to services such as FactSet and Morningstar, and a better way to review what Copilot intends to do before it starts changing a workbook. The most interesting addition is 'Skills' finally coming to Copilot in Excel. Skills let companies teach Copilot how to handle a recurring process, so employees do not need to write the same detailed prompt every month. Users can create skills that can specify the steps Copilot should follow, along with the required layout, formulas, and formatting. Microsoft says users can create their own skills by saving a SKILL.md file in OneDrive. The file is written using Markdown and tells Copilot when and how to perform the task. Once it is available, a user can select the skill in the Copilot pane or mention it in a prompt using the @ symbol. There is also a library of prebuilt finance skills for customers who do not want to create their own. Microsoft plans to let developers distribute additional skills through the Microsoft Marketplace and the Microsoft 365 Admin Center, with LSEG, Ramp, Rogo, samaya.ai, Velixo, and Vena among the first partners involved. The company says that it is also expanding the external data that Copilot can access from inside Excel. New connectors are being added for CB Insights, Daloopa, FactSet, Morningstar, PitchBook, and S&P Global data through technology developed by Kensho. There is a catch, however. Accessing these services may require a separate subscription from the relevant data provider, so a Microsoft 365 Copilot licence will not necessarily unlock all of them. FactSet is also only available in preview for now, with general availability planned for July. Microsoft is also trying to make Copilot’s workbook edits easier to inspect. Users can switch to a planning mode that shows which sheets, cell ranges, formulas, and assumptions Copilot intends to work with before it begins making changes. Once the work is complete, the Show Changes pane can distinguish edits made by Copilot from those made by human collaborators. The update continues Microsoft’s push to turn Excel Copilot from a chatbot into an agent that can carry out longer tasks. The company previously added an Agent Mode capable of planning and completing multi-step Excel work. Microsoft also recently acquired financial AI startup Fintool, another indication that finance is becoming a key target for its Excel AI strategy. Prebuilt skills, personalization, workbook rules, external connectors, planning mode, and Copilot attribution in Show Changes are generally available to Microsoft 365 Copilot customers using Excel on the web, Windows, and macOS. Custom skills are initially available to Microsoft 365 Insiders on Windows and Mac starting today. Microsoft plans to make them generally available across Windows, Mac, and the web over the next month. Partner-built skills are expected during the third quarter of the year. Availability may still differ depending on region and licensing.
    • Exactly. They serve different (although related) purposes.
  • 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
      438
    2. 2
      +Edouard
      169
    3. 3
      PsYcHoKiLLa
      134
    4. 4
      Xenon
      77
    5. 5
      Michael Scrip
      75
  • Tell a friend

    Love Neowin? Tell a friend!