Fixmbr, Backup your MBR using MBRwizard or MBRFix (Rev: 1.2)


Situation

I had a computer that used the GRUB boot loader to load either Fedora Core (FC) 5 or Windows XP Operating System (OS) during boot up. In Windows XP, I deleted the FC 5 partition to free up the hardisk space as I did not want to run the FC 5 anymore. During rebooting of the computer, the computer failed to load the Windows XP OS and it always stopped at the GRUB prompt.


Solution

The GRUB boot loader had installed itself as the master boot code to load the respective OS during the installation of FC 5. As I have deleted the FC 5 partition in Windows XP, the GRUB partition was deleted as well. Hence, the GRUB boot loader does not know how to load the OS because the GRUB files are deleted. We can perform the below steps to correct the Master Boot Record (MBR) problem using fixmbr:

  1. Boot the computer from the Windows XP installation CDROM. At the "Welcome To Setup screen" blue screen, kindly press r to run the Recovery Console.

  2. At the Recovery Console menu, kindly press the menu number to log on to your Windows OS. Please enter the administrator password if prompt.

  3. Assume that your Windows XP OS was installed at the C:\ drive. In the Recovery Console, kindly type fixmbr

    ** CAUTION **
    This computer appears to have a non-standard or invalid master boot record.
    FIXMBR may damage your partition tables if you proceed.
    This could cause all the partitions on the current hardisk to become inaccessible.
    If you are not having problems accessing your drive, do not continue.
    Are you sure you want to write a new MBR ? y
    -> Writing new master boot record on physical drive
    \Device\Hardisk0\Partition0.

    The new master boot record has been successfully written.


  4. Kindly type exit to quit from the Recovery Console and your computer will automatically reboot. Your computer should be able to boot to the Windows XP OS now.



Backup your MBR using MBRwizard or MBRFix

You can backup your MBR using
  • MBRwizard CommandLine
  • MBRFix
    • v1.0.9 for Windows NT/2000/XP/Server2003/Vista/PE
      MbrFix_v1.0.9.rar (including 1mbrfix.bat and 2mbrfix64.bat), 136100 bytes
      MbrFix_v1.0.9.rar md5 checksum: a5fe93bbaf37288f6c2fcec2fa23b895
    • v1.3.0.0 or higher version for Windows NT/2000/XP/Server2003/Vista/7/Server2008/PE

After downloading and unzipping the software, kindly open a Command Prompt window to run the software.

At the Command Prompt window, kindly type
mbrwiz /? or
mbrfix /?

to display the help page and license.


I have created a 1mbrwiz.cmd file (included inside MbrWiz_v1.53.rar) to run the MBRwizard. You can copy and paste the below 1mbrwiz.cmd codes, and save it as 1mbrwiz.cmd file at the same directory with the MBRWiz.exe file in order to run it.

------------- BEGIN 1mbrwiz.cmd codes -----------------------

@echo off

rem 1mbrwiz.cmd
rem To backup the MBR using MBRWiz.exe
rem Created by Jack, Rev: 1.0, August 2008

setlocal

%~d0
cd "%~dp0"

set MBRWIZFILE=mbrwiz.exe
if not exist %MBRWIZFILE% goto _ERROR1


:MENU
title MBRWizard Menu
set _choice=
cls
echo.
echo *********************************************
echo Please select which MBRWizard options to run
echo *********************************************
echo.
echo 1 List MBR entries
echo 2 Hides the Partition number
echo 3 Unhides the Partition number
echo 4 Activates the Partition
echo 5 De-activates the Partition number
echo 6 Deletes the partition
echo 7 Wipes the MBR or wipes the first 63 sectors of disk
echo 8 Saves the MBR to filename
echo 9 Reads and restores the Disk MBR from filename
echo 10 Shows contents of an existing MBR backup file
echo 11 Sort MBR Entries by disk location
echo.
echo Press [ENTER] to exit
echo.
echo.
set /p _choice="Enter choice number: "
echo.
if "%_choice%" == "" goto EXIT
cls
if "%_choice%" == "1" goto ListMBR
if "%_choice%" == "2" goto HidePartition
if "%_choice%" == "3" goto UnhidePartition
if "%_choice%" == "4" goto ActivatePartition
if "%_choice%" == "5" goto InactivatePartition
if "%_choice%" == "6" goto DeletePartition
if "%_choice%" == "7" goto WipeMBR
if "%_choice%" == "8" goto SaveMBR
if "%_choice%" == "9" goto RestoreMBR
if "%_choice%" == "10" goto ShowMBR
if "%_choice%" == "11" goto SortMBR


:ListMBR
title MBRWizard - List MBR entries
echo.
echo Running: mbrwiz.exe /list
echo.
mbrwiz.exe /list
echo.
goto EXIT


:HidePartition
title MBRWizard - Hides the Partition number
set DriveNumber=
set PartitionNumber=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter the partition ID to hide ("0" for 1st,
echo "1" for 2nd, ... or "*" for all).
echo.
echo Press [ENTER] to abort.
echo.
set /p PartitionNumber="Enter partition number to hide: "
if "%PartitionNumber%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /hide=%PartitionNumber% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /hide=%PartitionNumber% /list
if "%errorlevel%" == "0" goto SUCCESS
echo.
goto EXIT


:UnhidePartition
title MBRWizard - Unhides the Partition number
set DriveNumber=
set PartitionNumber=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter the partition ID to unhide ("0" for 1st,
echo "1" for 2nd, ...; "*" for all).
echo.
echo Press [ENTER] to abort.
echo.
set /p PartitionNumber="Enter partition number: "
if "%PartitionNumber%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /unhide=%PartitionNumber% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /unhide=%PartitionNumber% /list
if "%errorlevel%" == "0" goto SUCCESS
echo.
goto EXIT


:ActivatePartition
title MBRWizard - Activates the Partition
set DriveNumber=
set PartitionNumber=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo If you do not know which HDD to choose,
please enter
echo 'bm' to call the bootmenu.
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
if "%DriveNumber%" == "bm" goto BOOTMENU
echo.
echo Please enter the partition ID to activate ("0" for 1st, "1" for 2nd, ...).
echo.
echo Press [ENTER] to abort.
echo.
set /p PartitionNumber="Enter partition number: "
if "%PartitionNumber%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /active=%PartitionNumber% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /active=%PartitionNumber% /list
if "%errorlevel%" == "0" goto SUCCESS
echo.
goto EXIT


:InactivatePartition
title MBRWizard - De-activates the partition number
set DriveNumber=
set PartitionNumber=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter the partition ID to deactivate ("0" for 1st,
echo "1" for 2nd, ...; "*" for all).
echo.
echo Press [ENTER] to abort.
echo.
set /p PartitionNumber="Enter partition number: "
if "%PartitionNumber%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /inactive=%PartitionNumber% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /inactive=%PartitionNumber% /list
if "%errorlevel%" == "0" goto SUCCESS
echo.
goto EXIT


:DeletePartition
title MBRWizard - Deletes the partition
set DriveNumber=
set PartitionNumber=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter the partition ID to delete ("0" for 1st, "1" for 2nd, ...).
echo.
echo Press [ENTER] to abort.
echo.
set /p PartitionNumber="Enter partition number: "
if "%PartitionNumber%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /del=%PartitionNumber% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /del=%PartitionNumber% /list
goto EXIT


:WipeMBR
title MBRWizard - Wipes the MBR or wipes the first 63 sectors of disk
set DriveNumber=
set OPTION=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter "1" for wipes the MBR, "2" for wipes of first 63 sectors of disk.
echo.
echo Press [ENTER] to abort.
echo.
set /p OPTION="Enter option: "
if "%OPTION%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /wipe=%OPTION% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /wipe=%OPTION% /list
goto EXIT


:SaveMBR
title MBRWizard - Save the MBR to filename
set DriveNumber=
set Filename=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter filename to save (eg: hd0.mbr)
echo.
echo Press [ENTER] to abort.
echo.
set /p Filename="Enter filename: "
if "%Filename%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /save=%Filename%
echo.
mbrwiz.exe /disk=%DriveNumber% /save=%Filename%
echo.
goto EXIT


:RestoreMBR
title MBRWizard - Reads and restores the Disk MBR from filename
set DriveNumber=
set Filename=
echo.
echo Please enter the HDD to use ("0" for 1st, "1" for 2nd, ...)
echo.
echo Press [ENTER] to abort.
echo.
set /p DriveNumber="Enter drive number: "
if "%DriveNumber%" == "" goto EXIT
echo.
echo Please enter filename to restore (eg: hd0.mbr)
echo.
echo Press [ENTER] to abort.
echo.
set /p Filename="Enter filename: "
if "%Filename%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /disk=%DriveNumber% /restore=%Filename% /list
echo.
mbrwiz.exe /disk=%DriveNumber% /restore=%Filename% /list
echo.
goto EXIT


:ShowMBR
title MBRWizard - Shows contents of an existing MBR backup file
set Filename=
echo.
echo Please enter filename to display (eg: hd0.mbr)
echo.
echo Press [ENTER] to abort.
echo.
set /p Filename="Enter filename: "
if "%Filename%" == "" goto EXIT
echo.
cls
echo Running: mbrwiz.exe /showfile=%Filename%
echo.
mbrwiz.exe /showfile=%Filename%
goto EXIT


:SortMBR
title MBRWizard - Sort MBR Entries by disk location
echo.
echo Running: mbrwiz.exe /issorted /list
echo.
mbrwiz.exe /issorted /list
if "%errorlevel%" == "1" goto NotSort
echo The partition entries in the MBR are already sorted.
goto EXIT


:NotSort
set INPUT=
echo The partition entries in the MBR are not sorted.
echo Do you want MBRWizard to sort the partition entries ?
echo.
echo Press [ENTER] to abort.
echo.
set /p INPUT="Enter [y]es or [n]o: "
echo.
if /I "%INPUT%" == "" goto EXIT
if /I "%INPUT%" == "n" goto EXIT
cls
echo Running: mbrwiz.exe /sort /list
echo.
mbrwiz.exe /sort /list
if "%errorlevel%" == "0" goto SUCCESS
goto EXIT


:SUCCESS
echo Operation completed successfully.
echo.
goto EXIT


:EXIT
set _exit=
echo.
echo Do you want to exit MBRWiz ?
echo.
set /p _exit="Enter [y]es or [n]o: "
if /I "%_exit%" == "" goto EXIT
if /I "%_exit%" == "n" goto MENU
if /I "%_exit%" == "y" goto END


:BOOTMENU
cls
echo Running: mbrwiz.exe /bootmenu
echo.
mbrwiz.exe /bootmenu
echo.
if "%errorlevel%" == "0" goto SUCCESS
echo.
goto EXIT


:_ERROR1
echo.
echo ERROR: %MBRWIZFILE% file not found
echo Kindly check if you have downloaded the MBRWiz from
echo http://www.mbrwizard.com
goto END


:END
endlocal
------------- END 1mbrwiz.cmd codes --------------------------


References:

[1] MBRWizard Reference Guide

[2] "Operating System Not Found" or "Missing operating system" error message when you start your Windows XP-based computer

3 comments:

Hulkbuster said...

Hello i am interested in this blog, i just want to backup my pc's mbr,and i found out this tool MbrWiz_v1.53, you also made a nice bat file to go with it.

Right now , i have already downloaded MBRWizard.Command.Line.3.0.83 can you make a bat file that goes along with this tool too.
I tried to follow there commandline for v3.0.83 but i couldn't follow them, please check them out here.
http://firesage.com/mbrwizard.php?x=5#t1

Or can u provide working command for MBRWizard.Command.Line.3.0.83.

Thank you.
Desktopuser.

Jack Ng said...

Dear Hulkbuster,

mbrwiz v3.0.83 command examples
Reference from http://firesage.com/mbrwizard.php?x=5#t1

Assumption
---------------
%MBRWIZFILE%=MBRWiz64.exe
[Assume your Operating System (OS) is 64 bits.
If your OS is 32-bits, please use MBRWiz.exe]

%DriveNumber%=0
("0" for 1st HDD, "1" for 2nd HDD, ...)

%OPTION%=mbr
["mbr" to save the Master Boot Record (MBR),
"gpt" to save the GUID Partition Table (GPT),
"track0" to save the entire first head of the disk,
"disk" to save the entire DISK]

%Filename%=hd0.mbr
(hd0.mbr for HarDisk 0 in MBR mode)

%PartitionNumber%=1
("1" for 1st partition, "2" for 2nd partition, ...)

Jack Ng said...

01a) List disk and partition details on disk 0
(If no disk is specified, a default value of 0 will be used)
%MBRWIZFILE% /list
[To list all partitions detail on disk 0]

01b) List disk and partition details on disk 1
%MBRWIZFILE% /disk=1 /list
[To list all partitions detail on disk 1]


02) Save the disk MBR/GPT/Track0/DISK to filename
%MBRWIZFILE% /disk=%DriveNumber% /save=%OPTION% /filename=%Filename%
[To save disk 0 MBR as filename hd0.mbr]


03) Restores the disk MBR/GPT/Track0/DISK from filename
%MBRWIZFILE% /disk=%DriveNumber% /restore=%OPTION% /filename=%Filename% /list
[To restore disk 0 MBR from hd0.mbr backup]


04) Activates a partition as bootable
%MBRWIZFILE% /disk=%DriveNumber% /part=%PartitionNumber% /active /list
[To activate disk 0 partition 1]


05) De-activates a partition as unbootable
%MBRWIZFILE% /disk=%DriveNumber% /part=%PartitionNumber% /inactive /list
[To de-activate disk 0 partition 1]


06) Deletes the selected partition
%MBRWIZFILE% /disk=%DriveNumber% /part=%PartitionNumber% /del /list
[To delete disk 0 partition 1]


07) Wipes the MBR/GPT/Track0/DISK
%MBRWIZFILE% /disk=%DriveNumber% /wipe=%OPTION% /list
[To wipe the MBR of disk 0]


08) Hides selected partition
%MBRWIZFILE% /disk=%DriveNumber% /part=%PartitionNumber% /hide /list
[To hide disk 0 partition 1]


09) Unhides selected partition
%MBRWIZFILE% /disk=%DriveNumber% /part=%PartitionNumber% /unhide /list
[To unhide disk 0 partition 1]


10) Shows contents of an existing MBR backup file
%MBRWIZFILE% /show=file /filename=%Filename%
[To show contents of an existing MBR backup file, hd0.mbr]


11) Sort MBR partition entries to match physical location on disk
%MBRWIZFILE% /sort /list



12) Repair MBR for WinXP
%MBRWIZFILE% /disk=%DriveNumber% /repair=xp
[To repair disk 0 MBR for WinXP OS]


13) Repair MBR for Win7
%MBRWIZFILE% /disk=%DriveNumber% /repair=win7
[To repair disk 0 MBR for Win7 OS]


14) Repair MBR on disk 0
%MBRWIZFILE% /disk=%DriveNumber% /repair
[To repair disk 0 MBR]

Please donate. Thanks.


paypal.me/jackngch
(PayPal-to-Paypal account only)

Popular Posts