[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

    • Microsoft released Windows 11 KB5094149 / KB5095971 / KB5094156 Setup, Recovery updates by Sayan Sen Earlier this week Microsoft released its newest Patch Tuesday updates (KB5094126 / KB5093998 on Windows 11 and KB5094127 on Windows 10). Alongside those, Microsoft also released new dynamic updates. These Dynamic Update packages are meant to be applied to existing Windows images prior to their deployment. Dynamic Updates also help preserve Language Pack (LP) and Features on Demand (FODs) content during the upgrade process. VBScript, for example, is currently an FOD on Windows 11 24H2. This time both recovery and setup updates were released for Windows 11 as well as Windows 10. The company writes: "KB5095185: Safe OS Dynamic Update for Windows 11, version 26H1: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.28000.2269. KB5094149: Safe OS Dynamic Update for Windows 11, versions 24H2 and 25H2: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.26100.8655 KB5095971: Setup Dynamic Update for Windows 11, version 23H2: June 9, 2026 This update makes improvements to Windows setup binaries or any files that setup uses for feature updates in Windows 11, version 23H2. KB5094156: Safe OS Dynamic Update for Windows 11, version 23H2: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.22621.7219 KB5098815: Windows Recovery Environment update for Windows 10, version 21H2 and 22H2: June 9, 2026 This update automatically applies Safe OS Dynamic Update (KB5094154) to the Windows Recovery Environment (WinRE) on a running PC. The update installs improvements to Windows recovery features. KB5094154: Safe OS Dynamic Update for Windows 10, versions 21H2 and 22H2: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.19041.7417. KB5094153: Safe OS Dynamic Update for Windows 10, version 1809 and Windows Server 2019: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.17763.8880. KB5094152: Safe OS Dynamic Update for Windows 10, version 1607 and Windows Server 2016: June 9, 2026 This update makes improvements to the Windows recovery environment (WinRE). After installing this update, the WinRE version installed on the device should be 10.0.14393.9234." Microsoft notes that both the Recovery and Setup updates will be downloaded and installed automatically via the Windows Update channel.
    • Quantum Error Correction Validated in Nature: Microsoft and Quantinuum Log 800-Fold Improvement Two years after the original press-release announcement, independently peer-reviewed results published in Nature on June 10, 2026, have confirmed that Microsoft and Quantinuum achieved an 800-fold reduction in quantum error rates on real trapped-ion hardware — the largest gap between physical and logical error rates ever independently validated.    What Quantum Error Correction Actually Does — and Why Breaking Even Is Hard https://www.techtimes.com/articles/318329/20260613/quantum-error-correction-validated-nature-microsoft-quantinuum-log-800-fold-improvement.htm   Quantum Computing Wiring Bottleneck Cracked by HKU Silicon Carbide Chip at Qubit Temperature Engineers at the University of Hong Kong have built the first cryogenic control chip that operates at the same temperature as superconducting qubits — 10 millikelvin, or just one-hundredth of a degree above absolute zero — without generating the heat that has forced every competing approach to park its electronics hundreds of meters of cable away. https://www.techtimes.com/articles/318325/20260613/quantum-computing-wiring-bottleneck-cracked-hku-silicon-carbide-chip-qubit-temperature.htm  
    • RevPDF 4.5.0 by Razvan Serea RevPDF is a free, fully offline PDF editor for Windows, macOS, and Linux that lets you edit text and images directly inside PDF files — no internet connection, no account, and no cloud uploads required. Unlike bloated alternatives that demand subscriptions and constant connectivity, RevPDF fits in under 60MB on desktop while delivering a complete editing toolkit: annotate, redact, sign, compress, split, merge, convert, and reorganize pages, all processed locally on your device. Smart font matching ensures edited text blends seamlessly with the original, and multi-language support includes RTL scripts such as Arabic and Hebrew. Where most PDF editors force you to choose between features and simplicity, RevPDF manages both. You can build interactive forms from scratch with text fields, checkboxes, and dropdowns, permanently redact sensitive data before sharing, draw freehand on contracts and diagrams, and add custom watermarks — all without a single file leaving your machine. Edit Text and Images Directly Inside PDFs RevPDF supports true inline PDF editing — not just annotation layers on top of a document, but actual modification of existing text and images within the file. A smart font-matching engine identifies the font used in the original document and applies it automatically when you make edits, so changes blend naturally with the surrounding content. You can reposition elements, resize images, and update text across single pages or entire documents. RevPDF 4.5.0 release notes: This is one of the biggest updates to RevPDF yet. A lot of things people have been asking for are finally here. New Features Auto Redaction Permanently redact sensitive text and areas from your PDFs before sharing. Clean, irreversible, and fully offline. Comments, Links & Bookmarks Add comments for review, insert clickable links, and create bookmarks to jump around long documents without scrolling forever. Find & Replace Search across the whole document and replace text in one go. Long overdue. Split Pages Vertically or Horizontally Split any page down the middle, vertically or horizontally. Perfect for scanned books or double-page spreads. New Drawing Tools More tools for freehand drawing and markup, better for annotations, sketches, and detailed notes. Continuous Scrolling in Editor The editor now scrolls continuously through pages instead of jumping between them. Working through long documents is a lot smoother now. PDF Metadata Editor View and edit the metadata stored inside your PDFs, including title, author, subject, and keywords. Better Font Matching Text edits now blend in more naturally by doing a better job of matching the original font. Tabbed PDF Viewer Open multiple PDFs at once in tabs and switch between them without going back to the home screen. Add Links Insert hyperlinks anywhere in your PDF, to external URLs or to other pages within the document. Share & Print Shortcuts Share or print directly from the editing screen, home screen, and viewer. No extra steps. Minor Updates Paste images directly from clipboard into your PDF New image editing tools for more control over images inside documents Bug Fixes Fixed file saving issues on Windows and Linux Everything still works fully offline. No login, no cloud, no account. Your files stay on your device. Download: RevPDF 4.5.0 | 58.0 MB (Open Source) Links: RevPDF Home Page | Github | Screenshots 1 | 2 Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Interesting. I'm not using a VPN with my phone. I tried though my home internet (Rogers) and my cellular internet (Telus) using their respective DNS servers and both trigger the dialog above.
    • Three days after Anthropic launched Claude Fable 5 as the most capable AI model it had ever released to the public, the United States government ordered it switched off — and now the company is refunding customers who paid to use a product that vanished almost overnight https://www.techtimes.com/articles/318342/20260613/us-government-pulls-anthropics-fable-5-offline-now-come-refunds-vanished-ai.htm  
  • Recent Achievements

    • Week One Done
      agatameier earned a badge
      Week One Done
    • One Month Later
      agatameier earned a badge
      One Month Later
    • Week One Done
      ssd21345 earned a badge
      Week One Done
    • Contributor
      MarkHughes4096 went up a rank
      Contributor
    • Dedicated
      jordanspringer earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      507
    2. 2
      +Edouard
      175
    3. 3
      PsYcHoKiLLa
      139
    4. 4
      ATLien_0
      91
    5. 5
      Steven P.
      76
  • Tell a friend

    Love Neowin? Tell a friend!