Recover Data From a dead hard drive using ddrescue


Install dd_rescue in Debian

Install ddrescue using the following command

#apt-get install ddrescue

Install ddrescue in Ubuntu

sudo apt-get install ddrescue

This will complete the installation

ddrescue Syntax

dd_rescue [options] infile outfile

Now we will see how to use ddrescue under damaged disk

If you have a damaged hard disk /dev/sda1 and you have an empty space hard disk /dev/sda2 Now if you want to copy data from /dev/sda1 to /dev/sda2 use the following commnd

# dd_rescue /dev/sda1 /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo dd_rescue /dev/sda1 /dev/sda2/backup.img

This copies an image of /dev/sda1 to sda2

Now you need to check the backup image consistency this will check for is there any problems with this image.

#fsck -y /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo fsck -y /dev/sda2/backup.img

After finishing this checking you need to mount your disk image in to your other hard disk

#mount /dev/sda2/backup.img /mnt/recoverydata

If you are using ubuntu linux use the following command

sudo mount /dev/sda2/backup.img /mnt/recoverydata

This will mount all the data from the backup.img under /mnt/recoverydata now you can try to access the data it should work without any problem.

Restore image

If you want to restore this image use the following command

#dd_rescue /dev/sda2/backup.img /dev/sda1

If you are using ubuntu linux use the following command

sudo dd_rescue /dev/sda2/backup.img /dev/sda1

Copy Disk Image to remote machine using SSH

If you want to copy your disk image to remote machine over ssh you need to use the following command

#dd_rescue /dev/sda1 – | ssh username@machineip ‘cat /datarecovery/backup.img’

If you are using ubuntu linux use the following command

sudo dd_rescue /dev/sda1 – | ssh username@machineip ‘cat /datarecovery/backup.img’

This will be prompetd for password of the username you have menctioned in the above command after entering the password dd_rescue strats copying obviously it will take some time to copy over the network.

Possible Error

If you see the following error at the time of copying you can ignore this error

dd_rescue: (warning): output file is not seekable!
dd_rescue: (warning): Illegal seek

If you want to take this image in compressed format you can use the following command format

#tar zcvf – /dev/sda1 | ssh username@machineip ‘cat@@>/tmp /datarecovery/backup.tar.gz’

If you are using ubuntu linux use the following command

sudo tar zcvf – /dev/sda1 | ssh username@machineip ‘cat@@>/tmp /datarecovery/backup.tar.gz’

If you want to know more available options check dd_rescue man page

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: