A hard drive is going bad and I need to back it up (or, backup as much as possible) before it totally dies. I’ll clone the drive, to a new, working hard drive. This is also a handy way of completely duplicating a drive for backup or other purposes.

I’m going to use the command dd. This is an old UNIX command to convert and copy files. It will mirror the two drives for me. Of course, I can’t be logged in to the OS on the drive that I want to copy, so I’m going to use a live CD. I’m using an Ubuntu disc, because it’s what I have laying around.

  1. Boot into the live CD.
  2. Open a terminal, or use Ctrl+Alt+F1 to change virtual screens (Ctrl+Alt+F7 gets you back).
  3. Find where your drives are located. You can do this by typing “fdisk -l” or looking around in /dev. The drive I want to copy is /dev/sda and the destination drive is /dev/sdb
  4. Use the command “dd if=/dev/sda of=/dev/sdb conv=noerror,sync bs=1024″ where the “if” stands for “input-file”, “of” is “output-file”, “conv” gives a list of conversion options (in this case I’m saying to ignore read errors and “sync” tells dd to pad the blocks on the new drive with zeros), and “bs” gives the byte-size for incremental copying.
Now, sit back and wait a while.