Copy one disk to another using Linux and DD

The following will copy two disks, partition table and all, with forensic quality, and pad the destination disk with zeroes if any data is unreadable on the source disk. Be sure you’ve identified which disk is which using combinations of dmesg and ‘fdisk -l’. The destination disk must also be equal or greater in size.

sudo dd bs=512 if=/dev/sda of=/dev/sdb conv=noerror,sync

bs=512   = Block size 512 bytes
if=/dev/sda   = Source disk /dev/sda (found in dmesg and verified with fdisk -l)
of=/dev/sdb   = Target disk /dev/sdb (found in dmesg and verified with fdisk -l)
conv=noerror,sync   = Ignore errors, pad missing data with zeroes

Grab some coffee or take a drive, as the source disk and overall copy process can be VERY slow if it has medium errors.

Be careful, you will INSTANTLY and completely wipe out the destination disk, partitions and all, so build your command line carefully.

No Comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Anti-Spam Quiz: