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:
- 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.
- At the Recovery Console menu, kindly press the menu number to log on to your Windows OS. Please enter the administrator password if prompt.
- 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. - 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
- v1.53 for Windows XP/PE/Server2003
MbrWiz_v1.53.rar (including 1mbrwiz.cmd), 66287 bytes
MbrWiz_v1.53.rar md5 checksum: eefdacbbca21804513250023ef56dbee - v3.0 build 83 or higher version for Windows XP/PE/Server2003/Vista/7/Server2008
- v1.53 for Windows XP/PE/Server2003
- 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
- v1.0.9 for Windows NT/2000/XP/Server2003/Vista/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
No comments:
Post a Comment