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

    • Liene PixCut S1 Starter Kit gets a whopping 31% discount on Prime Day by Steven Parker Liene reached out to us to share another Prime Day exclusive deal that starts today on Amazon. It gives buyers a massive 31% off on the cost of this color sticker printer and cutting machine. It's basically an all-in-one sticker maker for DIY crafts, custom labels and gifts. It utilizes thermal dye-sublimation at 300 dpi, and offers precise "AI" auto-cutting. Here are some more of its highlights: All-in-One Convenience - Print and Cut in One Step. Say goodbye to the hassle of using separate machines. The PixCut S1 seamlessly integrates high-resolution photo printing and precise die cutting into one streamlined device. With just a few clicks on the user-friendly app, you can edit, print, and cut directly from your smartphone via Bluetooth. Create stickers in just 2 minutes! This all-in-one solution saves you time and effort, making your creative projects more enjoyable and efficient. AI Image Extraction & Precision Cutting - Unleash your creativity with the AI image extraction feature that automatically recognizes and extracts subjects from your photos. Then watch as the high-precision cutting system, guided by the same AI technology, perfectly follows every edge with pinpoint accuracy. This seamless AI-to-cut workflow ensures flawless results every time. Turn any moment into custom stickers with professional edges in minutes - just masterpieces made simple. High-Resolution Prints - Vivid and True-to-Life Colors. Utilizing thermal dye-sublimation technology, the PixCut S1 delivers stunning 300 dpi high-resolution prints with 16.7 million colors. Whether you're printing photos, stickers, or labels, you can expect vibrant, true-to-life color effects that make your creations stand out. Every detail is captured with precision, providing professional-quality results every time. AI Lab - Bring Your Imagination to Life. Upload a photo, pick a style from the Liene Photo App, and watch AI bring your vision to life instantly. Turn selfies into an anime character, a fantasy hero, or a festive holiday illustration — all with stunning realism. One style, endless versions of you. Print your AI art as custom stickers, unique gifts, or social media posts — perfect for avatars and DIY projects. No design experience required. Your creativity is just one click away from magic. Durable Stickers - Create Long-Lasting Creations .Thanks to the four-layer thermal dye-sublimation technology, the photopaper is automatically laminated during printing. Stickers produced by PixCut S1 are durable, waterproof and scratch-resistant, ensuring they remain vibrant and intactover time. Perfect for creating custom stickers, labels, and more that last. No Subscription. Just Pure Creativity. With the Liene app, available on mobile, tablet, and desktop. Unlock 40,000+ free images, fonts & elements (and growing), plus 2000+ ready-to-use templates for phone skins, lens stickers, ID cards, labels, name tags, journaling, and more. No paywalls, no hidden fees, just pure creativity. Turn any idea into a custom creation in minutes. Your imagination has no limits, neither should your software. This deal is for the Starter Kit, so what do you get? What's in the box PixCut S1 Photo Sticker Printer and Cutter x 1 Photo Sticker Cutter Ink Cartridge x 1 (36 sheets) Photo Paper 4"x6" (18 sheets) Sticker Paper 4"x7" (White) x 18 sheets Blade x 1 (Pre-installed) So in short everything you need to get printing and cutting. The Liene PixCut S1 has a 4.3 star rating after more than 1,000 reviews from customers, but we can't promise the landing page always sold this particular model, so do check out the reviews before purchasing. In any case Prime members are covered with a 30 day return or replacement should things not work out so great. Liene Pixcut S1 for $205.99 (was $299.99) 31% off Use code 15PIXCUT6 during checkout Although this is a Prime Day discount, the above code will stay live until June 30. Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
    • https://www.tenforums.com/tuto...b-results-windows-10-a.html Check the comment dates. Some of them are as old as 2016.
    • I wonder how many are laid off for cost savings, and this being blamed on AI to make it sound less scary and bad, for a more positive "modern, with the times" spin for investors? Because Oracle is down 14% the past year. We're looking at a company struggling here. If AI would actually be working out so well for them that they can do massive layoffs, surely this would've been reflected the past year in their stock value?
    • AI is the beginning, wait until real robots replace more jobs, specifically jobs that require physical work.
    • AI is indeed eliminating jobs, and Oracle just proved it by Hamid Ganji There’s no question that AI has become the hottest trend in workplaces, and every company is trying to adopt AI-driven solutions across its operations. While some industry leaders repeatedly say AI won’t lead to massive layoffs, recent data suggest that AI is actually one of the main reasons some companies are reducing their workforce. According to Oracle’s annual regulatory filing, the company has laid off about 21,000 employees, or 13% of its workforce, amid increasing AI adoption. “The adoption and deployment of AI technologies across our operations have resulted, and may continue to result, in reductions to our workforce,” Oracle said in the filing. The software giant now has approximately 141,000 full-time employees, a notable decrease from 162,000 during the same period last year. Restructuring expenses, including severance payments, cost Oracle $1.84 billion in fiscal 2026. Additionally, around 49,000 Oracle employees were based in the U.S., while approximately 92,000 were employed internationally. Like many other companies, Oracle has fully embraced AI and concentrated much of its efforts on the technology. The company is also a key participant in the United States’ $500 billion Stargate Project, which aims to build multiple AI data centers across the country. When it comes to AI adoption and its impact on the workforce, opinions remain divided. NVIDIA CEO Jensen Huang, whose company has been one of the biggest beneficiaries of the AI boom, recently said in an interview that attributing job cuts to AI is a “lazy” narrative. “The narrative that connects AI to job loss, for many of the CEOs that are doing it – it is just too lazy. AI has just arrived, how is it possible they're already losing jobs?” Huang said. However, statistics and recent reports tell a different story. According to Layoffs.fyi, 196 tech companies have laid off about 119,800 employees so far this year. Reducing staff and replacing roles with AI agents could become one of the most significant trends in the job market in the years ahead.
  • Recent Achievements

    • One Month Later
      timbobit earned a badge
      One Month Later
    • One Month Later
      nates earned a badge
      One Month Later
    • Week One Done
      Almohandis earned a badge
      Week One Done
    • Rookie
      dorf went up a rank
      Rookie
    • First Post
      mike_rumble earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      464
    2. 2
      +Edouard
      177
    3. 3
      PsYcHoKiLLa
      97
    4. 4
      Michael Scrip
      89
    5. 5
      neufuse
      70
  • Tell a friend

    Love Neowin? Tell a friend!