How to fully backup hard drive on Linux intelligently without using ddBy angsuman, Gaea News Network
Sunday, December 5, 2010
dd, while an excellent tool to back drive / partition images, copies entire hard drive including unused blocks and even bad blocks (where possible). I have found another way to backup which not only creates an exact duplicate as far as operating system is concerned but also allows you to elongate and extract the remaining life out of your existing hard drive or, if you want, to retire it gracefully.
1. Create RAID-1 with a single drive, your defective hard drive or hard drive you want to backup
2. Add the new hard drive to the RAID-1 array. Read my previous articles for details on the process:
a. How to parition a new drive before adding to RAID array in Linux
b. How to format a new partition as ext3 on Linux
c. How to add a new partition to RAID array in Linux using mdadm
The new drive will be automatically syncrhonized to contain the full data of the previous drive. Just leave the computer on for several hours. You can find the status of synchronization at any time by the following command:
watch cat /proc/mdstat
Note: Don’t forget to transfer mbr from old drive to new drive. This will allow you to boot from either drive.
Converting your bad drive to be part of the RAID1 array means that you can continue to use it through its failing health. Read accesses / seeks are reduced by 50% when a drive is in a RAID1 array which should potentially increase its lifespan. On the other hand, all writes are written to both the drives which may be problematic if the drive is in really bad state. Nevertheless when it finally dies, the other drive will automatically take over without you even realizing that something is amiss unless you check: cat /proc/mdstat