This is about XP is it?
debug edits boot sectors. Load it into memory.
This is similar
Backup & Restore Boot Sectors
Warning - Read This - Warning
If you don't know why you'd want to restore or backup a boot sector then don't do it. If you get it wrong you may render all your drives on this disk unusable.
This is used by people who have multiple operating systems or wierd requirements. It's not useful for 99.9999% of computers.
To repair a boot sector use Scandisk, Sys command, or FDisk /mbr. If your partition table (part of the boot record) gets scrambled only scandisk might help. Don't run Sys or FDisk /mbr with a damaged partition table.
Backing up is safe enough (as long as you follow the instructions exactly, then check each line before pressing enter), but restoring is dangerous.
If you are thinking of doing this because you think it's an extra safety step then it's not needed as Fat32 drives back up their own boot sectors.
And again, you may notice the lack of warnings on this site compared to other similar sites, so this warning should be considered important rather than a general disclaimer.
Readme Next
The boot sector contains a computer program that loads Dos or Windows. It also contains the partition table.
Virus checking in the BIOS or by programs must be disabled to write to a boot sector. Windows also prevent programs writing to the boot sector.
To Create a Backup Boot Sector and Partition Table
To create a backup of your boot sector and partition table type the following lines at in MSDos mode. Bold text shows the prompt and should not be typed but is what you can expect to see. Text in italics also aren't typed but are instructions or explainations to you.
C:\WINDOWS>lock c:
WARNING: The LOCK command enables direct disk access by programs
that can CORRUPT file names and/or DESTROY disk data, resulting in the
loss of files on your disk.
Are you sure (Y/N)?Y
C:\WINDOWS>debug
-L 0100 3 0 1 The second parameter is the drive we're backing up, we're doing C here, 3=C 1=A 2=B 4=D ect
-rcx
CX 0000
:200 enter 200 (200 hex = 512 bytes the size of the boot sector, CX control how many bytes we'll write to file)
-n a:\bootsect.bak the name of the file to backup the boot sector to
-w write 200h or 512 bytes to a:\bootsect.bak
-q quit debug
C:\WINDOWS>unlock c:
To view your boot sector press D<enter> 4 times after the L 0100 3 0 1 line. All boot sectors end with 55 AA in hex.
To check that the file is probably OK make sure it's size is 512 bytes exactly, then view it in Edit with the following command line;
edit /78 /r a:\bootsect.bak
the last two characters should be U (55) followed by a right angle (AA) with the corner in the upper right.
To Restore a Backedup Boot Sector and Partition Table
To restore a backup of your boot sector and partition table type the following lines in MSDos mode. Bold text shows the prompt and should not be typed but is what you can expect to see. Text in italics also aren't typed but are instructions or explainations to you.
C:\WINDOWS>lock c:
WARNING: The LOCK command enables direct disk access by programs
that can CORRUPT file names and/or DESTROY disk data, resulting in the
loss of files on your disk.
Are you sure (Y/N)?Y
C:\WINDOWS>debug
-n a:\bootsect.bak the name of the file that contains backedup the boot sector
-L load the file specified by n
-rcx
CX 0200 check that it says 0200, if not quit (press enter, the Q, then enter) - something is wrong with the file or it wasn't loaded (200 hex = 512 bytes the size of the boot sector, CX contains how many bytes we read from the file)

ress enter this leaves CX unchanged
-W 0100 3 0 1 The second parameter is the drive we're restoring to, we're doing C here, 3=C 1=A 2=B 4=D ect
-q quit debug
C:\WINDOWS>unlock c:
To view your boot sector before writing it press D<enter> 4 times after the L line. All boot sectors end with 55 AA in hex.