Custom Search

Backup your PC with ddrescue

ddrescue let you create a complete copy of all sectors of your hard drive in one single file or into another hard drive.

Failed hard drive

The difference between ddrescue and dd is that it specializes in recovering data from damaged hard drives. If it encounters a bad sector, it takes a note, bypass the sector, continues the backup and try again to copy bad sectors at the end of the backup. It is so effective at this task that he can perform miracles. It is then possible to clone the hard drive or to restore files with testdisk from this backup.

Clone a PC

Since ddrescue does a perfect copy of a hard drive, it can also be used to clone an hard drive into another. This way, you can replace a hard drive on a PC without needing to reinstall your operating system. You can even replace a failed hard drive that prevents a PC from booting and the computer is likely to be able to start again. The only thing that needs to be met is that the destination hard drive size should be equal or above the hard drive to be cloned.

On Ubuntu only

ubuntu logo
ddrescue only exist for Ubuntu (Linux). Anyway, Ubuntu is the operating system that is the more stable against a failed hard drive and also the only operating system that is able to write to any filesystem from any hard drive. In addition, it is also the only operating system that can be started at any time on any computer from a bootable CD even if that computer can no longer boot because of a failed hard drive.

Careful no blunder

You must be careful and never reverse the destination and the source, otherwise it will erase your hard drive rather than save it, oops! Therefore, very important to perform this step with concentration!

Prerequisities

Installation, To install ddrescue on Ubuntu, you must enable the universe repository and install gddrescue package.

Directory tree, You must have a general idea of how a directory tree works to be able to type the correct path and filename of the file in which you want to backup your hard drive.

Enough space, You need to have enough space on the destination, the size of the copied data will be equal to the size of the hard drive. If you copy into a file, the filesystem on the destination should not be FAT32 as this system is unable to create large size files as we will need here. You can use the disk utility or gprated to check and re-create (erase) required file systems on your destination.

Exclusive access to the hard drive, you must always boot from the bootable Ubuntu CD or plug the hard drive you want to backup as a secondary idle hard drive to proceed because otherwise softwares can write on this hard drive. If this point is not met, your backup will be immediately corrupted and useless.

Proceed

  1. Open the Terminal, among the applications in the Ubuntu menu in the top left corner.
  2. Type sudo bash and press the Enter key. If you are asked for it, type your administrator password and press Enter. This command line gives you the permissions to perform next tasks of the system.
  3. You must know the path to the hard drive you want to backup. Type fdisk -l to see existing hard drives, they will show with names such as /dev/sda or /dev/sdb. /dev/sda1 means the first partition on the hard drive, that is not what you want, there should be no number in your hard drive path.
  4. Type ddrescue -r 1 source destination logfile. Example #1 : ddrescue -r 1 /dev/sda /media/backup/backup.dd /media/backup/backup.log make a copy of /dev/sda hard drive to the file /media/backup/backup.dd and writes a logfile on /media/backup/backup.log. Example #2, ddrescue -r 1 /dev/sda /dev/sdb make a clone of /dev/sda hard drive in /dev/sdb hard drive without using a logfile. The logfile is a little file in which ddrescue notes the progress of its work, it allows you to stop ddrescue and restart it later without starting from scratch again.
  5. Wait. The progress is displayed on the screen. The operation time varies depending on the size of data to be copied and the speed of your hard drives. If there are bad sectors, try to make sure not to interrupt the process and be patient event if the operation takes more than a day and sometimes seems to progress very slowly, that is normal.