HOWTO+-+Disk+Clone+by+Using+ddrescue

Part of the following text was taken from here: https://wiki.archlinux.org/index.php/disk_cloning The same applies for ddrescue.

The dd utility technically has an "input block size" (IBS) and an "output block size" (OBS). When you set bs, you effectively set both IBS and OBS. Normally, if your block size is, say, 1M, dd will read 1M bytes and write 1M bytes. But if a read error occurs, things will go wrong. Many people seem to think that dd will "fill up read errors with zeroes" if you use the noerror,sync options, but this is not what happens. dd will, according to documentation, fill up the OBS to IBS size, which means adding zeroes at the end of the block. This means, for a disk, that effectively the whole 1M would become messed up because of a single 512 byte read error in the beginning of the read: ERROR6789 would become 678900000 instead of 000006789.

If you are positive that your disk does not contain any errors, you could proceed using a larger block size, which will increase the speed of your copying manyfold. For example, changing bs from 512 to 64K changed copying speed from 35MB/s to 120MB/s on a simple Celeron 2.7GHz system. But keep in mind, that read errors on the source disk will end up as block errors on the destination disk, i.e. a single 512 bytes read error will mess up the whole 64k output block.

Note:
 * To regain unique UUIDs, use "tune2fs /dev/sdbX -U random" on every partitions. (works for ext* file systems only)
 * Partition table changes from dd are not be registered by the kernel. To notify of changes without rebooting, use a utility like partprobe (part of GNU parted).
 * If you plan to remove the old hard disk and use the new one that you just copied the data to, you don't need to change the UUIDs. Also, keep in mind that if you change the UUIDs, you have to reconfigure grub and most likely fstab.

Use system-rescue-cd to dd (ddrescue) your old hard disk to the new one. (Some examples on ddrescue here: http://wiki.gentoo.org/wiki/Ddrescue)
 * Read the manual of ddrescue for an explanation of the options: https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html
 * Do not use -d for files. Only for block devices or partition.
 * A block size of 64 KiB will improve the read/write a lot <- however, it might cause greater corruption if your hdd has some seriously bad blocks
 * /dev/sda is the defective or input device and /dev/sdb is the new or output device

code ddrescue -d -f -r3 -b 64Ki /dev/sda /dev/sdb rescue.logfile code

After the ddrescue has finished, if you want to update the grub (not necessarily needed if you plan to remove the old hard disk) follow the procedure described here. Note, that if you plan to keep both hard disks on, you need to update the UUID of the partitions in the new hard disk.