i want to make an image of the linux bootsect,using the dd command, i was wondering how to use it and what would be the commands i would use.and how i would use this command to clone the linux bootsect.
if anyone can help me that would be great thankyou
The bootsector is placed in the first 512 bytes of the drive. The first 446 bytes contain the actual boot code. The remaining 66 bytes is the partition table.
I don't know what you want to use this for but if you just want to copy the bootcode into a file you can do that using the following command (Assuming /dev/hda is your primary drive containing the bootsector):dd if=/dev/hda of=bootsector.img bs=446 count=1
To restore the bootsector from an image-file you would use the command:
dd if=bootsector.img of=/dev/hda bs=446 count=1
You could also get the first 512 bytes including the partition table. But when restoring the boot sector you usually don't want to overwrite the partition table so I would recommend only the first 446 bytes.
The bootsector is kind of important so make sure you have a bootfloppy in case anything goes wrong. And don't blame me for any screwups on your bootsector.
Mik
| « Cable Modem help | Linux vs. UNIX » |