0
Copying Your Bootsector to a Harddrive
First, you should read the Copying Your Bootsector to a Floppy Disk tutorial if you haven't yet.The requirements for a bootsector that's installed on a harddrive are the same as those for a bootsector on a floppy:
- Your bootsector is exactly 512 bytes long.
- Your bootsector ends with 0xAA55.
- Your bootsector is compiled as a flat binary.
Copying Under Windows With PartCopy
This is is pretty much the same as copying a bootsector to a floppy disk with PartCopy(in this example the bootsector is called bootsec.bin):partcopy bootsec.bin 0 200 -h0
We start at the very beginning of the first harddrive(the first harddrive is specified with the -h0) and continue to the 512 byte mark(512 bytes = 0x200).
Before you do that, you might want to back up the old bootsector so that you can restore it. The command below saves the old bootsector into a file called oldboot.bin:
partcopy -h0 0 200 oldboot.bin
Copying Under Linux With dd
First, our bootsector is called bootsec.bin. Under Linux, the first harddrive is /dev/hda. We want to write our bootsector as one block of 512 bytes. bs=512 sets up the size of 1 block and count=1 specifies that we want to only write 1 block:dd if=bootsec.bin of=/dev/hda bs=512 count=1 Before you do that, you might want to back up the old bootsector so that you can restore it. The command below saves the old bootsector into a file called oldboot.bin:
dd if=/dev/hda of=oldboot.bin bs=512 count=1
0Awesome Comments!