using the dd command on linux

Score
0
Vote Up
stallion March 26, 2001 at 04:35:12 Pacific

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

Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
March 26, 2001 at 04:59:54 Pacific

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


Reply ↓  Report •
Reply to Message Icon Start New Discussion
Related Posts

« Cable Modem help Linux vs. UNIX »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC