[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

    • Ocenaudio 3.19.3 by Razvan Serea  Ocenaudio is a full featured, fast and easy to use audio and music editor. It is the ideal software for people who need to edit and analyze audio files without complications. Ocenaudio also has powerful features that will please more advanced users. To assist ocenaudio development, a powerful toolset of audio editing, analysis and manipulation called Ocen Framework was created. ocenaudio is also based on Qt framework, a well known library for cross-platform development. Cross-platform support ocenaudio is available for all major operating systems: Microsoft Windows, Mac OS X and Linux. Native applications are generated for each platform from a common source, in order to achieve excelent performance and seamless integration with the operating system. All versions of ocenaudio have a uniform set of features and the same graphical interface, so the skills you learn in one platform can be used in the others. VST plugins support Ocenaudio supports VST (Virtual Studio Technology) plugins, giving its users access to numerous effects. Like the native effects, VST effects can use real-time preview to aide configuration. Real-time preview of effects Applying effects such as EQ, gain and filtering is an important part of audio editing. However, it is very tricky to get the desired result by adjusting the controls configuration alone: you must listen the processed audio. To ease the configuration of audio effects, ocenaudio has a real time preview feature: you hear the processed signal while adjusting the controls. The effect configuration window also includes a miniature view of the selected audio signal. You can navigate on this miniature view in the same way as you do on the main interface, selecting parts that interest you and listening to the effect result in real time. Multiselection for delicate editions To speed up complex audio files editing, ocenaudio includes multi-selection. With this amazing tool, you can simultaneously select different portions of an audio file and listen, edit or even apply an effect to them. For example, if you want to normalize only the excerpts of an interview where the interviewee is talking, just select them and apply the effect. Eficient edition of large files With ocenaudio, there is no limit to the length or the quantity of the audio files you can edit. Using an advanced memory management system, the application keeps your files open without wasting any of your computer's memory. Even in files several hours long, common editing operations such as copy, cut or paste happen almost instantly. Fully featured spectrogram Besides offering an incredible waveform view of your audio files, ocenaudio has a powerful and complete spectrogram view. In this view, you can analyze the spectral content of your audio signal with maximum clarity. Advanced users will be surprised to find that the spectrogram settings are applied in real time. The display is updated immediately when altering features such as the number of frequency bands, window type and size and dynamic range of the display. Ocenaudio 3.19.3 changelog: Fixes issues with MP4 files with more than 8 channels Fixes incorrect VBR detection for some CBR MP3 files Other bug fixes and improvements Download: Ocenaudio 64-bit | Portable | ~40.0 MB (Freeware) Download: Ocenaudio for Linux and Mac OS View: Ocenaudio Homepage | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • DiskGenius 6.2.0.1829 - All Versions: Free, Lite & Portable by Razvan Serea DiskGenius is a full-featured partition manager, which is designed to optimize disk usage for Windows users. It will efficiently help you recover lost data, resize/split partition, backup files, edit hex data, check bad sectors, manage virtual disks, erase data, etc.. Create a system image backup for current Windows with simple clicks to keep the operating system under protection. DiskGenius key features: Partition Management - It can create format, resize, extend, backup, split, hide and clone partition, both MBR and GPT are supported. Disk and partition conversion - Convert dynamic disk to basic, convert virtual disk format and convert MBR to GPT, convert primary partition to logical. File recovery - It can recover files deleted or emptied form recycle bin, recover files from damaged partition or disk and recover files by file type and supports file preview and file filter. Partition recovery - It is the best partition recovery program in that it can recover files from damaged, corrupted and RAW partitions, search for lost partition and recover files from it, besides, it can fix partition table. RAID recovery - It can reconstruct Virtual RAID and recover files from it, and all RAID types are supported. Sector Editor - A Hex editor is embedded to help users edit raw hex data and recover data manually. Backup and Restore - It can backup and restore partition including system partition, hard disk and partition table. Bad Tracks - It can check and repair bad sectors for all storage devices; check hard disk S.M.A.R.T. information. Delete files permanently - It can delete files permanently so that they can't be recovered by any data recovery software. Virtual Disk - It supports virtual disks, including VMware, Virtual PC and Virtual Box. Create WinPE bootable disk and you can manage disk partition when system crashes or there is no operating system on your computer. Support FAT12/FAT16/FAt32/exFAT/NTFS/EXT2/EXT3/EXT4 file system format. DiskGenius 6.2.0.1829 changelog: Add the "Disk Speed Test" feature. Add the "Windows Boot Repair and Conversion" feature. Add the BMB21-2019 erase standard to the "Erase Sectors" feature. Add support for restoring an individual partition from a PMFX disk image file. Enhanced The "Verify Or Repair Bad Sectors/Blocks" feature displays disk read speed in the detection window during scanning. The "Quick Partition" dialog box allows users to quickly select the number of partitions by pressing the numeric keys 1, 2, 7, 8, or 9. The "Set Volume Name" dialog box supports selecting preset volume labels provided by the software. The "Copy Sectors" feature supports resuming copy tasks after modifying the number of skipped bad sectors. Add the "TRIM Optimization" option to the format dialog box. The "Clone Partition" and "Clone Disk" features perform TRIM optimization on target partitions or disks before cloning. Add support for Not Equal To search conditions (prefixed with "!") when searching hexadecimal data in the sector editor. Optimize the display of capacity values in the program interface to show two decimal places. Add a minimize button to dialogs that may require long processing time. Enhance support for the ReFS file system. Enhance support for newer HIF and MP4 formats when recovering files by type. Enhance support for the EXT4 file system. Enhance compatibility of the "File Recovery" feature with special data structures. Fixed Fixed the issue that the selected file system type automatically reverted to NTFS after changing it to exFAT or EXT4 in the "Quick Partition" dialog box. Fixed inaccurate Unicode string search results in the "Sector Editor" feature. Fixed the issue that exceptions might occur when adding multiple disks in the "Erase Sectors" feature. Fixed the issue that insufficient target disk space was incorrectly reported in some cases when cloning, backing up, or restoring disks. Fixed the issue that folder modification timestamps were not preserved when copying files from ReFS partitions. Fixed the issue that Excel-format reports generated by features such as file copying or bad sector checking could not be opened when the report contained more than one million rows. Fixed the issue that folders were not displayed in the exclude-folder dialog box when backing up partitions to image files. Fixed the issue that the "Erase Sectors" feature could not be executed in some cases. Download: DiskGenius 6.2.0.1829 | 63.9 MB (Freeware, paid upgrade available) Download: DiskGenius Portable 64-bit | 40.0 MB Download: DiskGenius Portable 32-bit | 36.0 MB Download: DiskGenius Lite 64-bit | 13.4 MB Download: DiskGenius Lite 32-bit | 11.6 MB View: DiskGenius Home Page | DiskGenius Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Really? Use a better search engine https://www.google.com/search?...ourceid=chrome&ie=UTF-8
  • 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
      513
    2. 2
      +Edouard
      184
    3. 3
      PsYcHoKiLLa
      144
    4. 4
      ATLien_0
      95
    5. 5
      Steven P.
      75
  • Tell a friend

    Love Neowin? Tell a friend!