djgpp, and MinGW-w64 compiled executables with sources [DOS 32-bit, windows 32+64-bit]).
mbrsave and mbrrestore are tools that save and restore the master boot
record of a hard disk.
mbrprint shows the partition records. You specify the physical disk number starting
with 0 as outlined in
control panel|administrative tools|computer management|disk management
on an 2000/XP/Vista/7 box.
They can be downloaded as a single mbrsaverestore.zip file, diskwipe.exe floppy image (includes diskwipe), and diskwipe.img rawrite floppy image (includes diskwipe). It is under the GPL3 license. lsm file.
floppy images are contained on the diskwipe page, may take me a day or two to update them after releasing mbr.
06/02/2011 04:19 AM 15,967,684 mbrsaverestore.zip %%%% HASHDEEP-1.0 %%%% size,md5,sha1,sha256,filename ## Invoked from: C:\prj\mbr ## C : \ > hashdeep -c md5,sha1,sha256 mbrsaverestore.zip ## 15967684,9449eddb6949d043a1995dfe6ec9da67,48f0f0492fc643ec822ac0f387c4cc82fef3e798,9c97ceec113bd968662329c6b6b5106c73c54bb74970ba98fac92b6fb570305b,C:\prj\mbr\m brsaverestore.zip
The windows version is compiled with Borland C++ 5.5 free version. The DOS version is compiled with djgpp.
News: DOS version added, and mbrprint has been added.
They are command-line programs to be run under the CMD shell, or command.com. A disk geometry report is displayed both before saving and restoring. brfore restoring, there is confirmation asked after the disk geometry report.
these are not toys. With mbrrestore you can lose the partition table of
your hard disk. Iif you do happen to lose it, I suggest getting it back
with testdisk, available at http://www.cgsecurity.org/wiki/TestDisk
The MBR is the first sector of the hard disk.
you can find information about it at http://en.wikipedia.org/wiki/Mbr
The dos version is compiled with DJ Delorie's djgpp (gcc for DOS). It can be obtained at DJDelorie.com/djgpp.
The windows version was compiled with Borland C++ 5.5 (free edition). It is available at article free compiler (requires regisration).
mbrrestore/mbrrstor
mbrrestore will give the disk geometry of the disk and ask for confirmation before it restores the MBR.
These tools only work on hard disks. I do not have the libraries for working on floppy disks.
DOS version: mbrrstor - Restores Master Boot Record of a *hard disk* (the first sector) usage: mbrrstor [-?] [-v] [BIOSdrivenumber filename] -v gives version information and exits. -? or -h or --help gives this help and exits. The MBR includes partition information, so be careful on restore! disk geometry will be displayed before anything is done and confirmation will be asked. Physical drive 0 is first hard disk - it *may not* be C:. it isn't on my box because the PATA drives come first before the SATA drives, so on my box 0=F: and 1=C:. Since this goes by physical disk number, you can find out which disk is which by looking it up in 'Control Panel|Administrator Tools|Computer Management|Disk Management' on 2000/XP/Vista boxen. Copyright 2008 Jim Michaels. under GPL3 License. windows version: mbrrestore - Restores Master Boot Record of a hard disk (the first sector) mbrrestore [-?] [-v] [physicaldrivenumber filename] -v gives version information and exits. -? or -h or --help gives this help and exits. The MBR includes partition information, so be careful on restore! Physical drive 0 is first hard disk - it *may not* be C:. it isn't on my box because the PATA drives come first before the SATA drives, so on my box 0=F: and 1=C:. Since this goes by physical disk number, you can find out which disk is which by looking it up in 'Control Panel|Administrator Tools|Computer Management|Disk Management' on 2000/XP/Vista boxen. Copyright 2002 Sreejith S., 2007,2008 Jim Michaels. under GPL3 License. example: mbrrestore 0 0MBR.bin example: mbrrestore 1 BOOTSECT.FD
mbrsave
Windows version: mbrsave - Saves Master Boot Record of a disk. Basically the first sector. usage: mbrsave [-?] [-v] [physicaldrivenumber [filename]] -v gives version information and exits. -? or -h or --help or no arguments gives this help and exits. The MBR includes partition information, so be careful on restore! Physical drive 0 is first hard disk - it *may not* be C:. it isn't on my box because the PATA drives come first before the SATA drives, so on my box 0=F: and 1=C:. Since this goes by physical disk number, you can find out which disk is which by looking it up in 'Control Panel|Administrator Tools|Computer Management|Disk Management' on 2000/XP/Vista boxen. DOS version: mbrsave - Saves Master Boot Record of a disk. Basically the first sector. usage: mbrsave [-?] [-h] [-v] [BIOSdrivenumber [filename]] -v gives version information and exits. -? or -h or --help or no arguments gives this help and exits. The MBR includes partition information, so be careful on restore! Physical drive 0 is first hard disk - it *may not* be C:. it isn't on my box because the PATA drives come first before the SATA drives, so on my box 0=F: and 1=C:. Since this goes by physical disk number, you can find out which disk is which by looking it up in 'Control Panel|Administrator Tools|Computer Management|Disk Management' on 2000/XP/Vista boxen. default filename is <drivenumver>MBR.bin Copyright 2007,2008 Jim Michaels. under GPL3 license. example: C:\prj\mbr\mbrsave>win\mbrsave 0 30401 Cylinders, 255 tracksPerCylinder, 63 sectorsPerTrack, 512 bytesPerSector, 250GB writing default filename '0MBR.bin' C:\prj\mbr\mbrsave>win\mbrsave 0 myfile.bin 30401 Cylinders, 255 tracksPerCylinder, 63 sectorsPerTrack, 512 bytesPerSector, 250GB C:\prj\mbr\mbrsave> example: mbrrestore 0 0MBR.bin example: mbrrestore 1 BOOTSECT.FD
mbrprint
C:\prj\mbr\mbrprint\win>mbrprint 1
38913 Cylinders, 255 tracksPerCylinder, 63 sectorsPerTrack, 512 bytesPerSector,
320GB
----------Partition 1:---
partition type: 0xDE
start: cyl=0000 head=001 sector=01 | last: cyl=0003 head=254 sector=63
32-bit LBA first Sector: 0000000063 (32.3KB)
32-bit number of sectors: 0000064197 (32.9MB)
----------Partition 2:---bootable (0x80)
partition type: 0x07
start: cyl=0004 head=000 sector=01 | last: cyl=1023 head=254 sector=63
32-bit LBA first Sector: 0000064260 (32.9MB)
32-bit number of sectors: 0616365855 (315.6GB)
----------Partition 3:---
partition type: 0xDB
start: cyl=1023 head=254 sector=63 | last: cyl=1023 head=254 sector=63
32-bit LBA first Sector: 0616430115 (315.6GB)
32-bit number of sectors: 0008707230 ( 4.5GB)
----------Partition 4:---
partition type: 0x00
start: cyl=0000 head=000 sector=00 | last: cyl=0000 head=000 sector=00
32-bit LBA first Sector: 0000000000 (0B)
32-bit number of sectors: 0000000000 (0B)
----------------end 4-partition list----------------
C:\prj\mbr\mbrprint\win>mbrprint 0
30401 Cylinders, 255 tracksPerCylinder, 63 sectorsPerTrack, 512 bytesPerSector,
250GB
----------Partition 1:---
partition type: 0x07
start: cyl=0000 head=001 sector=01 | last: cyl=1023 head=254 sector=63
32-bit LBA first Sector: 0000000063 (32.3KB)
32-bit number of sectors: 0488392002 (250.1GB)
----------Partition 2:---
partition type: 0x00
start: cyl=0000 head=000 sector=00 | last: cyl=0000 head=000 sector=00
32-bit LBA first Sector: 0000000000 (0B)
32-bit number of sectors: 0000000000 (0B)
----------Partition 3:---
partition type: 0x00
start: cyl=0000 head=000 sector=00 | last: cyl=0000 head=000 sector=00
32-bit LBA first Sector: 0000000000 (0B)
32-bit number of sectors: 0000000000 (0B)
----------Partition 4:---
partition type: 0x00
start: cyl=0000 head=000 sector=00 | last: cyl=0000 head=000 sector=00
32-bit LBA first Sector: 0000000000 (0B)
32-bit number of sectors: 0000000000 (0B)
----------------end 4-partition list----------------
C:\prj\mbr\mbr-1.5\mbrprint\dos>mbrprint
mbrprint - Shows partition report of Master Boot Record of a disk or file.
usage: mbrprint [-?] [-h[elp]] [-v[ersion]]
mbrprint BIOSdrivenumber
mbrprint -f[ile] filenameToRead
if BIOSdrivenumber is specified, shows a report from that disk of the partition
information from the MBR based on standard 4-partition 16-bit IBM partitioning m
odel.
-f if filenameToRead is specified, shows a report from a file of the partition i
nformation from the MBR based on standard 4-partition 16-bit IBM partitioning mo
del.
-v or -version or --version gives version information and exits.
-? or -h or --help or no arguments gives this help and exits.
The MBR includes partition information, so be careful when using mbrrstor!
Physical drive 0 is first hard disk - it *may not* be C:. it isn't on my box be
cause the PATA drives come first before the SATA drives, so on my box 0=F: and 1
=C:.
Integer drive number can be decimal, hexadecimal (starts with 0x), octal (starts
with 0 or 0q or 0o), or binary (starts with 0b).
Since this goes by physical disk number, you can find out which disk is which by
looking it up in 'Control Panel|Administrator Tools|Computer Management|Disk Ma
nagement' on 2000/XP/Vista boxen.
default filename is <drivenumer>MBR.bin
biosdisk.c Copyright 1995 DJ Delorie, derived biosdsk2.* library by Jim Michaels
also under LGPL2 license.
Program Copyright 2007,2008,2009 Jim Michaels. under GPL3 license.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
mbrrestore, mbrsave, mbrprint:
biosdisk2.* is a library based on djgpp's biosdisk.c and comes under the LGPL2.1 license. You can find the license in the file COPYING.lib
these 3 programs use that library and come under the GPL3 license. You can find that license in the file gpl.txt.