dd_rescue (also known as ddrescue) is a program that copies data from one file or block device to another, it is a tool to help you to save data from crashed partition.
It tries to read and if it fails it will go on with the next sectors, where tools like dd will fail. If the copying process is interrupted by the user it is possible to continue at any position later. It can copy backwards.
Install dd_rescue or ddrescue
If you are using Debian / Ubuntu Linux, type the following command to install ddrescue:
# apt-get install ddrescue
If you are using RedHat /Fedora /CentOS Linux, type the following command:
# yum -y install ddrescue
Or directly download ddrescue from official GNU web site.
Please note that Debian install ddrescue binary as /bin/dd_rescue and other distribution as /usr/bin/ddrescue
How do I use dd_rescue (ddrescue)?
To make exact copy of /dev/sda (damaged) to /dev/sdb (make sure sdb is empty) you need to type following command:
# ddrescue /dev/hda /dev/hdb
Naturally next step is to run fsck on /dev/sdb partition to recover/save data. Remember do not touch originally damaged /dev/sda. If this procedure fails you can send your disk to professional data recovery service. For example if /home (user data) is on /dev/sda2, you need to run a command on /dev/sdb2:
# fsck /dev/sdb2
Once fsck run, mount /dev/sdb2 somewhere and see if you can access data:
# mount /dev/sdb2 /mnt/data
Next take backup using tar or any other command of your own choice.
ddrescue command supports tons of options, read man page for more information:
# man ddrescue
# man dd_rescue
This program is useful to rescue data in case of I/O errors, because it does not necessarily abort or truncate the output. This is why you need to use this program and not dd command.
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop