[HELP] How to fix the MBR from Linux


Recommended Posts

Recently, I installed Slackware again, as well as lilo. However, even though I can correctly boot to Linux, when I try to boot Windows XP (on a NTFS partition ) I get a BSOD (my first one ever) saying UNMOUNTABLE_BOOT_VOLUME.

I googled for it, and apparently the root cause is the MBR being unable to be read by Windows, but everyone sugests either using the XP install CD, or several floppies to download the boot disks, none of which I have.

So, is there a way for me to fix it from Linux?

Thanks in advance.

Edited by nav_uno
Link to comment
https://www.neowin.net/forum/topic/357395-help-how-to-fix-the-mbr-from-linux/
Share on other sites

Hmmm...  Get someone to send you the 512 byte MBR, then use a dd if=~/XP_mbr.bin of=/dev/hda bs=512 count=1 command (assuming you save the file locally in your home dir as "XP_mbr.bin".

586362613[/snapback]

Great, I feel hope now, can anyone please send it to me ? [email protected] or PM me

EDIT: Do I need to uninstall lilo?

Hmmm... Get someone to send you the 512 byte MBR, then use a dd if=~/XP_mbr.bin of=/dev/hda bs=512 count=1 command (assuming you save the file locally in your home dir as "XP_mbr.bin".

When you install the XP MBR, you will boot without going to LILO at all. Straight to Windows.

I'm working on getting a copy of my wife's MBR to post here...

EDIT: Try this. I got it by using DamnSmallLinux running on QEMU while inside her running XP box. It should be valid, but I cannot guarantee. You have been warned. :unsure:

EDIT 2: Had to slap a ".txt" at the end of it, so Neowin would let me attach. :pinch:

XP_MBR.bin.txt

When you install the XP MBR, you will boot without going to LILO at all.  Straight to Windows.

I'm working on getting a copy of my wife's MBR to post here...

EDIT: Try this.  I got it by using DamnSmallLinux running on QEMU while inside her running XP box.  It should be valid, but I cannot guarantee.  You have been warned. :unsure:

EDIT 2:  Had to slap a ".txt" at the end of it, so Neowin would let me attach. :pinch:

586362675[/snapback]

OK, I tried what you sugested, and now it's completely foobared, but it's my fault, you had warned me :cry:

Now the entire disks apears as free space, no partitions, no nothing. The partition table seems to be erased. I'm posting this on Knopix. Not even the bootdisk for Linux works, it throws a kernell panic error.

I'm running out of options, if it was only my PC, I wouldn't mind, but my sister uses it also, and I would like to fix it in case she wants to use it.

I'll try to install grub, and put the parameters on it hardcoded, to see if it boots either OS. Would it work without the partition table?

Any sugestions other than that?

Whopee!! Apparently, Knopix has a very usefull tool called testdisk, that has allowed me to restore my partition table. Going to reboot now, and see how it turns out.

EDIT: This is me on my Slackware install. XP did not boot, but I mounted the partition, and everything is there, so, I can breath again, no files are lost.

Edited by nav_uno

well thats good, im glad you fixed that, now as for your xp, i suggest not to do anything risky again like what mark said to do :p, and if you do, always make backups of files youre going to be replacing, my advice borrow a friends xp recovery disc and do it that way

Yeah, I'm back to square one. I've re-installed lilo, hoping the MBR is in better state with mark's patch, and it boots Linux correctly, but XP still BSOD's.

The thing is, my friend has my XP install CD, and I doubt he'll be able to return it any time soon. And I've bought some floppies to get the boot disks, but the thing is that what you download from MS site is an .exe you have to execute from Windows, to create the boot disks.

And even though Mark's patch din't work, it was a very good learning experience. I had no idea how to restore the partition table before, but now I do, as well as how to write data to a specific part of the the disk. Thank god there's Knopix !

Sorry... I had to take the kids to football practice, and I didn't get back home until now.

Also sorry that the MBR thing didn't work out for you, but very (VERY) glad you were able to recover what you could.

It sounds like your XP install is what is wrong, not your MBR. You will need your XP CD, and do a repair installation. This will re-wipe out your LILO, and you will need to reinstall LILO, but after that, you should have a working Windows and Linux install on your PC.

Mark i figure the reason your method didnt work is because his partitions arent set up the same as the compouter you got that file from, therefore wouldnt it not be doing the right thing? Like his mbr is suppsoed to say boot from hda1 or something, but the windows you got your mbr file off of it says to boot from hda2? I think that's the most logical reason it didn't work, and he can't just "replace" his with that of another computer with a different setup, am i wrong in the assumption that all " XP_MBR.bin" are different depending on your pc?

You are right! I just did a bit of research (link), and it seems that we only wanted the first 446 bytes, not the full 512 byte block. The first 446 bytes should be common from one XP to another (and from 98, too, from what I am told).

My error. :pinch:

Ok, that seems right, I actually was thinking that after all got messed. So, what should I do? Do I need a different file, or do I use the same, but only copy the first 446 bytes?

Also, does the file renaming to .txt changes the content?

EDIT: Acording to the link, it says that the MBR program looks at the fist 512 bytes of the startable partition, and jumps to the program in that section. I wonder if that's what is wrong, and not the MBR itself, since it is able to contain lilo, and lilo boots well both Linux and a small Dell utility on the first 16 MB partition of the disk.

Edited by nav_uno

If you modify your dd command to use a block size of 1 byte, and count 446 of them suckers:

dd if=~/XP_MBR.bin.txt of=/dev/hda bs=1 count=446

That should be much less destructive. (you could also just change the block size to 446, and leave count as 1)

The content of the file should not be changed by changing the extension on the file name, and the size of what I uploaded is exactly correct, so it didn't add any CR/LF to the file.

Question: Did you recover your partition table? Or did you just recover the files that were on it? </me being curious>

EDIT to your edit: Yes, that could be the problem. Your MBR could be correct, but point to code that is non-existent or incorrect.

If you modify your dd command to use a block size of 1 byte, and count 446 of them suckers:

dd if=~/XP_MBR.bin.txt of=/dev/hda bs=1 count=446

That should be much less destructive.  (you could also just change the block size to 446, and leave count as 1)

The content of the file should not be changed by changing the extension on the file name, and the size of what I uploaded is exactly correct, so it didn't add any CR/LF to the file.

Question:  Did you recover your partition table?  Or did you just recover the files that were on it?  </me being curious>

EDIT to your edit:  Yes, that could be the problem.  Your MBR could be correct, but point to code that is non-existent or incorrect.

586365559[/snapback]

Yes I recovered the partition table using testdisk, and now all partitions, with every correspondant file are there. The disk is currently at exactly the same state it was when I first posted the issue, so, don't worry. ;) :p

I'll borrow an install CD from work to try and fix it, but I'm feeling a little adventurous, so before trying the repair from the install cd, I'll try the command you posted, since now I know it's best to first backup the MBR, and even if it goes wrong, I know how to fix it.

EDIT to your EDIT of my EDIT: Ok, though I noticed that windows starts to boot, and it gets to the screen with the progress bar below the XP logo before the BSOD, so I'm leaning towards believing that it should be the MBR, but I was curious about the health of the Windows partition, as I don't know for sure if it was the Slackware install that originated this, or if it was one of those days when Windows decides to hate you.

Edited by nav_uno
Ok, though I noticed that windows starts to boot, and it gets to the screen with the progress bar below the XP logo before the BSOD, so I'm leaning towards believing that it should be the MBR

586365816[/snapback]

Well, if it makes it to any sort of boot screen, the MBR is fine. It only holds 446 (I know this now!) bytes of information - not enough for NTLDR. The MBR passes control to NTLDR or LILO or GRUB or whatever other boot loader is installed. You have a Windows problem. This one needs to be repaired by booting the XP CD and performing a "repair". It would also be wise to do a checkdisk before doing too much work at repairing. Your partitions have been through a lot, recently, and we need to make sure that your filesystem structure is intact.

Ok people, the plot thickens..... I just tried the XP install CD, and both the repair and setup options throw a BSOD. Now I don't get it, and have no clue what to do next. The windows partition is there, I can see it from Slackware. I uninstalled lilo to see if the XP CD worked, but nope, no luck.

Any sugestions ?

Yes actually. At this point I would stop worrying about this, its not worth the trouble - somethings wrong with your XP installation. Backup everything you need from Slackware, then find somewya to store it outside of your PC, format everything and reinstall XP, then reinstall Slack... thats what I would do, I'm sure there's a way to fix this issue but I don't think its worth your time at this point, it would be faster to start fresh.

The thing is, even trying to install XP from the install CD throws a BSOD. I'll try it one more time and let you know.

EDIT: I stand corrected, it now stays at "Examining startup environment", after selecting both "repair" and "install" options.

Edited by nav_uno
  • 2 weeks later...

This is me, posting from Windows again. Unfortunately, I wasn't able to fix the old install. So I backed up as much as I could from Linux, deleted the partition, fixed the mbr, the boot sector, and only then could I proceed to re-install Linux.

I'm thinking that the hard drive might be failing, as the CHKDSK said there were unrecoverable problems, so I'll prolly need to get another one. Even on the new install, I sometimes get a BSOD while using Windows normally.

Anyway, thank you all guys for helping me su much, and providing great support, as usual in this site.

PS: Funny thing, I used to have XP Home, and now I installed PRO, and it never asked me for activation nor CD Key, even though I had formated the previous install.

Can't edit my post, but I meant "re-install windows" not linux. And I had tried to boot to recovery console, but always got either a BSOD or the system just hanging, the only way I could made it boot from the XP cd was to completely delete the partition.

And what do you mean by click? I does makes some strange noises seldomly, about the same sound as when reading a floppy.

And what do you mean by click? I does makes some strange noises seldomly, about the same sound as when reading a floppy.

586430212[/snapback]

Dead on. That harddrive is meant to fail :pinch: Those Maxtors out there are pretty cheap and durable :whistle:

By the way, try not to put your harddrive in the freezer or something like that, I've had a ton of harddrives fail at work and those techniques never worked ;)

Maybe this has nothing to do with your problem, but a smilar thing happend to me when I messed with the format of my partitions and the windows drive letter changed. If the letter changes you cannot boot on windows anymore.

Example:

2 partitions of 10GB each one. One installation of windows in the first one (drive letter C:) and another one in the second partition (driveletter D:).

If you install linux or something that is not NTFS/Fat on the first partition, the driveletter will change to C for the second partition and your xp installation will be screwed up. There's a KB article on how to solve that but I prefered to format.

---

Dead on. That harddrive is meant to fail  :pinch: Those Maxtors out there are pretty cheap and durable  :whistle:

By the way, try not to put your harddrive in the freezer or something like that, I've had a ton of harddrives fail at work and those techniques never worked  ;)

586443680[/snapback]

Update: Windows won't boot anymore (again) only this time, no BSOD, it just goes blank. When I try to mount the partition from linux, it says "bad option, wrong fs or bad superblock". But, when I use the recovery console I can see every file there.

Anyway, I know I'll have to buy a HD, which is why I'm currently evaluating different ones. Currently I'm just using Slackware, which also fails from time to time, throwing paging errors and an ocasional segmentation fault, but overall is workable still. I just wonder what the hell did I do to mess this up so bad.

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

    • No registered users viewing this page.
  • Posts

    • While LibreOffice is not pleased to see a new competitor, they are absolutely correct in stating that Euro-Office using a MS file standard as a default is not being truly "European." Using a MS standard just means Euro-Office is just a "bastardized MS Office Suite." (Wasn't a major purpose of Euro-Office was to get away from being captive and enslaved to MS's Office Suite??)
    • Microsoft continues its long-term policy of spying on their users--despite vehement denials. That feature will be disabled (or removed) either "elegantly" with MS providing a true way to disable it, or "quick and dirty" via a third-party who WILL come up with a way to disable it. Your choice MS...
    • Helium Browser 0.13.3.1 by Razvan Serea Helium is a private, fast, and honest Chromium-based web browser — built for people, with love. It offers the best privacy by default, unbiased ad-blocking, and a clean experience free from bloat and noise. Proudly based on Ungoogled-Chromium, Helium removes Google’s clutter while keeping a fast, efficient development pipeline. With thoughtful touches like native !bangs and split view, Helium is a people-first, fully open-source browser that puts control back in your hands. Privacy, security, and control come first. Ads, trackers, and third-party cookies are blocked automatically, HTTPS is enforced everywhere, and all Chromium extensions work seamlessly — while Google can’t track your activity. Helium’s 13,000+ offline-ready !bangs let you jump straight to sites or AI tools like ChatGPT instantly. Open-source, people-first, and unbiased, Helium delivers a browsing experience that’s fast, secure, and free from noise, ads, and compromises. Helium Browser key features: Performance Fast, efficient, and lightweight — built on Chromium’s optimized engine. Energy-saving and consistent — stays fast over time without slowing down. No bloat — stripped of unnecessary components for maximum speed. Minimalist interface — compact, clean, and distraction-free. Customizable toolbar — hide elements you don’t need. Smooth and stable — no flicker, lag, or animation glitches. Comfort-focused experience — intuitive and unobtrusive. Privacy & Security Best privacy by default — blocks ads, trackers, phishing, and third-party cookies. Unbiased ad-blocking — powered by community filters and uBlock Origin. No telemetry or analytics — zero background web requests on first launch. Strict HTTPS enforcement — warns for insecure sites. Passkeys supported — modern authentication made simple. No built-in password manager or cloud sync — your data stays yours. Extension Compatibility Full Chromium extension support — including MV2 extensions. Anonymized Chrome Web Store requests — Google can’t track extension installs. Extended MV2 support — maintained for as long as possible. Smart Features Native !bangs — browse faster using 13,000+ offline-ready shortcuts. AI integration — use !chatgpt and others directly from the address bar. Offline functionality — bangs work without an Internet connection. Philosophy People-first design — open source, transparent, and community-driven. No ads, no noise, no bias — privacy and honesty over profit. Helium Browser 0.13.3.1 changelog: f53b28d update: helium 0.13.3.1 (#292) b3cbb2ba revision: bump to 3 (#1925) bcacb8c7 chromium: update to 149.0.7827.114 (#1924) Download: Helium 64-bit | Portable 64-bit |~100.0 MB (Open Source) Download: Helium ARM64 | Portable ARM64 Links: Helium Home Page | macOS | Linux | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Microsoft Weekly: Xbox exclusives are back, big Windows app updates, and more by Taras Buria This week's news recap is here. Microsoft is returning to XBOX exclusives, Windows 11 gets new preview builds, the Low-latency Profile is here, big updates for inbox Windows apps, Patch Tuesday updates, and more. Quick links: Windows 10 and 11 Windows Insider Program Updates are available Reviews are in Gaming news Great deals to check Windows 11 and Windows 10 Here, we talk about everything happening around Microsoft's latest operating system in the Stable channel and preview builds: new features, removed features, controversies, bugs, interesting findings, and more. And, of course, you may find a word or two about older versions. The June 2026 Patch Tuesday updates are now publicly available. Windows 11 users can download KB5094126, which introduces plenty of new features and security updates, including the Low-latency Profile for better performance, shared Bluetooth audio support, and more. Windows 10 users with PCs enrolled in the Extended Security Update program can download KB5094127. In addition, Microsoft released new Defender updates for its operating systems. Speaking of Defender, Microsoft will now deliver EDR updates via Microsoft Update for faster security improvements independent of Patch Tuesday updates. Following the release of this month's Patch Tuesday updates, Microsoft also published new Windows 11 images available in the Media Creation Tool app. Now, you can create bootable USB media for clean Windows 11 installations with the latest releases. Some unfortunate stuff is going on with certain PCs from Dell and HP. Dell acknowledged that the SupportAssist bug causes black screens of death, while HP systems are suffering from Secure Boot update issues and boot loops. Both companies issued official advisories. Windows Insider Program Here is what Microsoft released for Windows Insiders this week: Builds Canary Channel Builds 29610.1000 and 28120.2302 This week's "Canary" builds only contain performance improvements and fixes, including the Low-latency mode, which is now available in the Stable channel for all Windows 11 24H2 and 25H2 users. Dev Channel Build 26300.8687 Microsoft brought some useful File Explorer changes with this build. You can now open folders in a new tab by middle-clicking them in the address bar. Beta Channel Build 26220.8680 and 28020.2298 Screen Tint, improved Windows Widgets, and other enhancements are included in this week's Beta releases. Release Preview Channel Builds 26200.8728 and 26100.8728 These builds also feature better widgets, new Windows Update controls, point-in-time restore, File Explorer improvements, and more. In addition to new Windows 11 preview builds, Microsoft announced that inbox Windows 11 apps now have their dedicated release notes in the official documentation. Also, Microsoft dropped massive feature updates for six apps, including Paint, Clock, Calculator, Camera, Media Player, Photos, and more. Updates are available This section covers software, firmware, and other notable updates (released and coming soon) delivering new features, security fixes, improvements, patches, and more from Microsoft and third parties. Google has some bad news for those still using MV2-based extensions in Chromium-based browsers, particularly Chrome. The company is now removing flags responsible for Manifest V2-based extensions (uBlock Origin is one of the most popular). However, some browsers resist this change, and Opera issued a statement that it will allow users to continue using MV2 extensions for as long as possible. While Microsoft is still not ready to share new details about MV2 extensions in Microsoft Edge, the company shared important details about the way it will be updating the browser going forward. Now, Microsoft wants to update Edge every two weeks across all platforms instead of the current four-week schedule (only the Extended Stable is exempt from this change). This week, Microsoft confirmed a useful new Teams feature that is coming to the messenger soon. It also detailed all the improvements that made the platform better for users in 2026. However, not all changes are great, as the company is moving ahead with the check-in feature, which many believe will lead to employee monitoring. PowerToys received a feature update this week. Version 0.100 arrived with a big rework for the Shortcut Guide, a new extension gallery for Command Palette, new Dock features, and plenty of other changes. Here are other updates and releases you may find interesting: Microsoft is bringing big performance improvements to OneDrive on Mac Popular Windows 11 file manager Files gets improved tags, layouts, and a new OneDrive icon New Outlook for Windows and Web is getting a simple but very useful email feature Microsoft had to shut down 70+ GitHub repos after getting hacked, bringing back some Microsoft AI boss no longer believes that AI will replace human workers Microsoft wants to end printer driver headaches with Windows Ready Print SQL Server Management Studio 22.7 brings "What's New" page, T-SQL formatting, and lots more Microsoft releases Visual Studio Code 1.124 with smarter autonomous AI agents Windows Server gets DNS over HTTPS (DoH) support Here are the latest drivers and firmware updates released this week: NVIDIA 610.52 Hotfix with multiple fixes for black screens of death, sleep issues, G-SYNC, and more. Reviews are in Here is the hardware and software we reviewed this week Steven Parker reviewed a rather unorthodox device here on Neowin this week. He took for a spin the DWARF mini, the world's smallest smart telescope for night and day sky captures. It tracks objects in the sky, has a sun filter, and has a low learning curve. There is also nice build quality and a quite affordable price. Pulasthi Ariyasinghe reviewed 007 First Light. The game turned out to be a satisfying spy adventure in the James Bond universe with great gunplay and combat, impressive crowds, over-the-top action sequences, and more. There are a few quirks here and there, but overall, the game scored high on our scale. On the gaming side Learn about upcoming game releases, Xbox rumors, new hardware, software updates, freebies, deals, discounts, and more. Microsoft held the latest XBOX Games Showcase this week. There, the company announced plenty of cool stuff, including a remake of Halo: Combat Evolved, a special 25th anniversary XBOX Series X with a classic translucent green design (coming in November 2026), details about Gears of War: E-Day, Spyro: A Realm Beyond after nearly 20 years since the last release, a new Hellblade game from Ninja Theory, a new expansion for DOOM: The Dark Ages, fresh details about State of Decay 3, and even a new entry in the Crazy Taxi series. More improtantly for XBOX fans, Microsoft announced the return of XBOX exclusives, with Gears of War: E-Day and Clockwork Revolution kicking it off. Microsoft also has some good news for Nintendo Switch 2 owners. Minecraft is coming natively to the second-gen Switch, offering better performance and new features, including the visual overhaul called "Vibrant Visuals." Playground Games revealed a 30-minute gameplay video of the upcoming Fable, showcasing combat, action, NPC simulation, relationships, and player choices. Additionally, the studio confirmed a bug with Forza Horizon 6 wiping saves for some gamers. It also had to shut down one of the game's online modes after users discovered an infinite money glitch. NVIDIA announced new games for the GeForce NOW streaming service and a big Summer sale that lets you get 12 months of GeForce NOW for $35 or $70 less, depending on the tier. Speaking of discounts, check out this week's Weekend PC Game Deals article, full of discounts and the latest freebies from the Epic Games Store. Great deals to check Every week, we cover many deals on different hardware and software. The following discounts are still available, so check them out. You might find something you want or need. GIGABYTE Radeon RX 9070 XT Gaming OC ICE 16G - $649.99 | 13% off 1TB Samsung T7 Portable SSD - $189.98 | 31% off AirPods Pro 3 - $179 | $50 off Edifier R1280Ts Powered Bookshelf Speakers - $129.99 | 24% off This link will take you to other issues of the Microsoft Weekly series. You can also support Neowin by registering for a free member account or subscribing for extra member benefits, along with an ad-free tier option.
    • Microsoft Flight Simulator's City Update 15 enhances Midwest cities by Pulasthi Ariyasinghe The third major city update of the year has landed for the original Microsoft Flight Simulator and the 2024 release. The latest drop is upgrading the visuals and regional accuracy of three metropolitan regions in the American states of Illinois, Minnesota, and Wisconsin. The 15th city update is adding eight new areas of interest that have been enhanced with high-fidelity TIN (triangulated irregular network) surface texturing in the mentioned regions. The free update highlights Chicago, Elgin, Cicero, and Arlington Heights in Illinois, as well as Minneapolis, St. Paul, Bloomington, Duluth, Brooklyn Park, Woodbury, Lakeville, Plymouth, and Blaine in Minnesota. In Wisconsin, the development has also upgraded the lands and buildings of Milwaukee, Madison, and Racine. The update lands just as one of the world's largest enthusiast flight simulation conventions, FlightSimExpo, kicks off in downtown St. Paul, Minnesota, on June 14. The Flight Sim development team's 40-minute keynote at the event can be watched here. At the same time, Microsoft is bringing the 6-seat, single-engine, multi-use light civil airplane Piper M600 into the game as a part of its Expert Series 2 program. This premium plane can be purchased from the in-game marketplace for $24.99. City Update 15: The United States Midwest is now available in Microsoft Flight Simulator, as well as the newer Microsoft Flight Simulator 2024, as an optional download. It can be accessed across Steam and the Microsoft Store for PC, Xbox Series X|S, and PlayStation 5, as well as Xbox and PC Game Pass subscriptions. Xbox One, mobile, and PC players can also jump into the new content using Xbox Cloud Gaming if they have a Game Pass Ultimate membership. The game must be updated to the latest version to download this free update from the in-game marketplace.
  • Recent Achievements

    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
    • Rookie
      Rimplesnort went up a rank
      Rookie
    • One Year In
      Markus94287 earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      179
    3. 3
      PsYcHoKiLLa
      140
    4. 4
      ATLien_0
      91
    5. 5
      Steven P.
      78
  • Tell a friend

    Love Neowin? Tell a friend!