check this out:
http://www.techrepublic.com/blog/linux- ... s-with-dd/
If you wanted to duplicate an existing drive to another, you would obtain a drive of the same (or larger) size. Assuming the drive to copy is /dev/sda and the destination drive is /dev/sdb, first use fdisk to recreate the appropriately-sized partitions, then use dd to do the actual cloning:
# sfdisk -d /dev/sda | sfdisk /dev/sdb
# fdisk -l /dev/sda; fdisk -l /dev/sdb
Compare the output of the two fdisk commands and make sure the partitions on /dev/sdb match those on /dev/sda. Once this is done, you can copy each partition using:
# dd if=/dev/sda of=/dev/sdb bs=446 count=1
# dd if=/dev/sda1 of=/dev/sdb1
# dd if=/dev/sda2 of=/dev/sdb2
The first dd call copies the MBR from the first disk to the second. This will allow the second disk to be booted, when it replaces the first. The first 446 bytes are copied with this command; that is the boot code we need.
Depending on the size of the disk and partitions, this could take some time, but the end result will be a perfectly cloned system. For best results, if you do intend to replace the one drive with another, use a LiveCD or USB boot instead of booting off of /dev/sda; this will ensure that nothing changes on-disk during the copy.