//View Tip #803
Similar Tips
» Connect your mic to a remote speaker
» Wipe deleted files with dd
» Convert nrg to iso
» Make an iso image of cd
» Create a file of specific size

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Backup your MBR:
dd if=/dev/sda of=/root/mbr.img bs=1 count=512

Restore MBR:
dd if=/root/mbr.img of=/dev/sda bs=1 count=512

Restore only bootstrap (part of MBR):
dd if=/temp/mbr.img of=/dev/sda bs=1 count=446

Restore only partition table (part of MBR):
dd if=/temp/mbr.img of=/dev/sda skip=446 seek=446 bs=1 count=64

If you want to learn more about mbr check here: http://en.wikipedia.org/wiki/Master_boot_record


View Comments »




Comments 

Add your comment

Comments are currently disabled
Josh
If doing on a regular file add conv=notrunc to the options list. Otherwise you'll wipe out your old data and be left with only the MBR.
Posted 2009-05-13 22:32:19
Josh,
Could you explain this? I have used the procedure given here lots of times and not lost data.
Perhaps you are referring to using the dd command to image a whole drive?
Posted 2009-05-17 21:21:08
Blake
When your backing up the MBR shouldn't it be bs=512 and count=1? Because your gathering 512 bytes of info only once (why count should be 1)
Posted 2009-05-24 16:14:29

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit