« SystemRescueCD to the rescue | Main | Fitness Software for Linux »

Backup Your MBR on Linux

Use this command to backup your MBR:

dd if=/dev/hda of=/home/hda.boot.mbr bs=512 count=1

To restore the MBR (from a Live CD), use this command:

dd if=/mnt/hda1/home/hda.boot.mbr of=/dev/hda bs=512 count=1

About the dd command:

dd if=<source> of=<target> bs=<byte size>("USUALLY" some power of 2, not less than 512 bytes(ie, 512, 1024, 2048, 4096, 8192, 16384[/b], but can be ANY reasonable number.) skip= seek= conv=<conversion>.

Source is the data being read. Target is where the data gets written.

Warning!! If you reverse the source and target, you can wipe out a lot of data. This feature has inspired the nickname "dd" Data Destroyer.
Warning!! Caution should be observed when using dd to duplicate encrypted partitions.

Posted on Thursday, April 2, 2009 by Registered CommenterJared in , , | Comments2 Comments

Reader Comments (2)

What sort of problems might arise from using dd on a encrypted partition? Thanks.

October 9, 2009 | Unregistered CommenterLeo Romanovsky

Hi there, sorry about not getting back to you right away. I was on vacation for the past number of weeks. I am unsure what problems may arise if dd is used on an encrypted partition. From what I know of dd, it creates an exact replica of what you point it to. The only problem I'd foresee is if the system somehow "registers" the encrypted partition and that it would "know" if the partition was "tampered" with should you "reload" the partition.

I found one resource that suggests dd works fine with encrypted partitions. It just states to unmount the partition before running dd.

If I found out more, I'll add a followup to my post.

November 9, 2009 | Registered CommenterJared

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>