http://mbrwizard.com/

I designed MBRWizard as a Master Boot Record management utility program to directly update and modify the MBR.  In order to make certain you are able to perform MBR operations regardless of the Operating System you choose, I have versions available for Windows XP/2K/2003/PE/x64, DOS as well as Linux.  The following is a quick list of functionality provided by MBRWiz:

Partition Modification
Delete Partitions
Hide/Unhide Partitions
Set Bootable/Active Partition
Change Partition Type

MBR Operations
Backup/Save MBR, Head, or individual sectors
Restore MBR, Head, or other sectors from file
Delete MBR, or Wipe all sectors on first head
Fix MBR due to damage or corruption
Copy Sectors
Clear or write a new disk signature 
Sort partition table entries. Designed to match Windows boot.ini entries

Additional Functionality
Mount volumes within Windows
DisMount volumes
Modify Volume Label
Securely wipe entire disk 
Boot Menu- Quick menu allowing user to select bootable partition
Shutdown/Reboot the machine 
Create ini file containing the structured contents of the MBR
Read/Write a Status byte in the MBR
--------------------------------
The following is a list of available Command Line Options for MBRWizard.        Items in Blue are Windows options only.  
/List - Display the partitions listed in the MBR, their order in the MBR, partition type, size, and whether active or hidden. The Pos field indicates the order the partitions are laid out on disk, while MBRndx shows them as they're listed in the MBR. 
/Disk=# - Selects the disk to use for all operations. This switch is always processed first, verifying that all operations specified on the command line will use the disk specified here. If not specified, Disk 0 will be used by default. 

/Part=# - Selects the partition to use for all partition based operations. If not specified, partition '0' will be used by default. All operations use the physical location of the partition on the disk (the first column in /list), not the MBRndx field which simply identifies the current position of the partition entry in the MBR.   Certain commands allow the action to be perfomed on all partitions, in this case /Part=* (asterisk) performs this functionality.

/Sector=# - Selects the sector to use with sector based operations. Sector 0 (MBR) will be used by default if not specified. 

MBR Options 

/Save=filename - Saves the current MBR to a file, where filename is the path+filename used to store the file.  Specifying /Sector=# on the command line will save the sector # specified rather than the MBR (Sector 0).  Additionally, specifying /sector=head will save the entire first head to file.  

/Restore=filename - Reads an MBR file from filename, where filename is an existing path+filename containing the backed up contents of the MBR sector. Optionally, specifying the /Sector=# parameter will restore the file to sector # rather than 0 (MBR).  Additionally, the entire first head will be resotred if the specified file contains 64 sectors.    

/Repair=# - Designed to fix a damaged, corrupt, or missing MBR.  Specifying an option of '1' will repair a PE/XP/2003 MBR. This may be expanded to other OS formats if the need exists. 

/Show=x - Shows the partition structure from a backed up MBR.  Available options for x are a filename, the sector number containing the backup, or the word SECTOR if the contents have been previously saved to the hidden sector. 

/Wipe=x - Selecting an option of 'mbr' will wipe the MBR clean, 'head' will wipe the first head or 63 sectors, and a range of sectors from x to y can be wiped by specifying /Wipe=x-y.  This will effectively remove all information from the specified sectors of the disk. 

/Sort - It isnt uncommon for the partition entries in the MBR to be unsorted after reinstalling Windows or restoring a Ghost image.  This means that the partition order in the MBR won't match the order on disk. Normally this wasnt a problem until Windows NT/2K/XP came along with its new boot loader, and the requirement that each partition entry in the boot.ini must point to the actual partition number. This option will sort the entries in the MBR to match their physical order on disk.

/IsSorted - Queries the partition entry order in the MBR and  returns an ErrorLevel code based on the status of the partition entries: '0' = Sorted, '1' = Not Sorted 

/Signature=x - Reads or Writes a new disk signature to the MBR.  Specifying 'Zero' will clear the existing signature, otherwise an 8 digit hex entry can be entered for the signature.  For example, /Signature= Zero, or /Signature= AC87AD87. Specifying /Signature with no options will display the existing disk signature. 

/Copy=x - Copies the contents of one sector to another.  The /Sector=x command will specify the source sector, and will be copied to the sector specified by /Copy.  Please note, typically only the first 64 sectors (0-63) should be used as the destination, otherwise existing data on the hard disk may be overwritten. Selecting 0 as the target will overwrite and erase the contents of the MBR.

Partition Entry Options 

/Hide=# - Hides or Unhides the specified partition to the operating system. An option of '1' or 'Yes' will hide the partition, while selecting '0' or 'No' will set the partition visible. If /Part=* is specified all partitions will be hidden/unhidden. 

/Active=# - Sets the specified partition eithe active (bootable) or inactive. An option of '1' or 'Yes' will set the partition active, while an option of '0' or 'No' will set the partition non-bootable.  /Part=* can be selected to set all partitions inactive.  If setting the a hidden partition active, it will first be unhidden then set active. DOS and Win9x do not properly recognize multiple visible primary partitions, make certain any remaining primary partitions are unhidden if necessary.

/Type=# - Allows the partition type to be modified.  This is most useful if a partitioning or backup/restore program modifies the partition type and it needs to be restored back to the original type.  The # specified must be directly followed by either a d (decimal) or h (hexadecimal) in order to properly identify the new type.  This option must be used with /Partition in order to identify the partition being modified. 

/Del - Deletes the specified partition.  Specifying /Part=* removes all partitions on selected disk, while specifying both /Disk=* /Part=* removes all partitions on all disks 

The following items have been removed in order to remain OS independant, but will shortly be included in a new application. 


/Mount=x: - Mounts selected volume with a specified drive letter. 'x:' identifies the drive letter to use for the mount.  The desired partition to mount can be selected either by /Part=# or /Vol=label 
/UnMount=x - UnMounts the drive letter from the selected volume.  'x' identifies the partition #, volume label, or drive letter (x:) for the volume to unmount. 


/Label=x - Modifies the Volume Label.  The new label is identified by 'x', and the correct volume is specified by either /Part or /Vol.

Miscellaneous Options 

/Shutdown=# -An entry of '1' will force Windows to shutdown, '2' will force Windows to shutdown and reboot. '3' shuts down without force, and '4' reboots without force. Note, using the Force options may cause data loss if open programs contain unsaved data. NT/2K/XP/2003 version only. 

/WipeDisk=# - Wipes (overwrites) each sector on the disk in order to securely erase all data. Selecting an option of '1' write zeros to all sectors. Additional methods coming. Wiping the System partition (C: drive) is not recommended under Windows as it will effectively crash Windows with a BSOD!  This option is currently only available under the Windows version, but will be expanded to DOS and Linux in the future.

/Status=x - Stores or Retrieves the status byte located at offset 0x1b0 in the MBR, which is widely recognized as an unused section of the MBR.  Specifying a value for 'x' will set the status byte, valid options are 0-255.  Selecting /Status with no options will return the current byte upon program exit.

/Confirm - Any operation that performs a change to the MBR will now ask for user confirmation before making the change.  Specifying /confirm on the command line overrides this request and defaults to Yes for each operation without prompting. 

/BootMenu -This option will list the available, bootable partitions to the user, and set one active by secting from the menu 

/Msg=# - Hides the status messages shown upon program exit.  An entry of '1' indicates that no messages should be shown, '2'=No error messages, and '3'=No status messages displayed on success. 

/Ignore - Attempts to continue the specified operation if an error occurs. 

/Result - Displays the return code for visual verification of success/failure. 

/HideErrors - Hides the display of any errors that may occur. See /Msg. 

/? - Show command line options


--------------------------------------------------------------------------------

CommandFile - If no switches are specified on the command line, and a file by the name of mbrwiz.opt exists in the same folder as the executable, then the mbrwiz.opt file will be parsed for possible switches. Switches can be located on the same line, or dispersed across multiple lines. This option can be used when it's not possible to pass switches on the commandline. The following is a sample option file to save the disk 1 mbr to hidden sector, then reboot the machine 
---------------------------- 
/disk=1 /save=sector 
/shutdown=2 
---------------------------- 
 
--------------------------------
v 2.0  Pre-release version
Added Repair Mode, which will repair a missing or corrupt Windows XP/2K3/PE boot record
Added disk signature read/write capability
Added feature to write Disk and Partition information to an ini file
Added ability to save/restore entire first head in addition to mbr
Added ability to mount and dismount a volume in Windows version 
Added ability to directly change the partition type
Added Status read/write functionality
Changed general behavior to always show the operation status upon program exit.  Previous versions would only show an error message upon failure.  This status message can be hidden using /Msg=#
Improved Error handling 

v 1.53  August 3, 2004
Added option to delete all partitions on single disk, or all partitions on all disks
Added /Ignore option, to allow operation to continue if an error occurs 

v 1.52  Nov 13, 2003
Minor release to resolve an issue sorting on disks other than disk 0 (zero). Fixed issue where DOS version would not properly read multiple disks Added a feature to Auto-backup the MBR if a command to sort, delete, or restore an MBR is specified. Windows version will write the file to the Temp folder specified by Windows, DOS version will write file to c:\, Linux stores file to /usr/tmp. The filename will be Disk-0.mbr, Disk-1.mbr, etc. for each physical disk in the system

v 1.5  Sep 16, 2003
Added feature to read and display the partition table from a backed up mbr file. Added feature to read command options from a text file. Added ability to deactivate all partitions using * 

v 1.4.1  Sep 5, 2003
Minor release to fix display problem in DOS version

v 1.4  Sep 2, 2003
Added a version for Linux, including support for IDE, SCSI, and RAID devices

v 1.3  August 12, 2003
Added support for multiple disks. Added Bootmenu option. Added ability to hide/unhide all partitions on a disk. Added functionality to save the MBR to a hidden sector on disk

v 1.2  July 7, 2003
Added Wipe functionality.  Added Shutdown and Reboot functionality under 32 bit

v 1.1  May 25, 2003
Added support for a 32 bit version Windows version.

v 1.0  March 2003
Added functionality to activate, hide, delete,  and sort partitions.  Save and Read the MBR from a file was also included here.

 