GNU ddrescue, ridiculous learning curve

d3v

Member
Reaction score
8
Location
Nottingham, UK
I'm trying to image a badly damaged 3.5" SATA hard drive using the free Ubuntu Rescue Remix 11.5 live CD and have printed off all the DD rescue documentation and have the thing running in a virtual machine for practice, but there's not a single damm word on how one would actually list all devices and paritions connected the the PC.

Why would such a basic and fundamentally important step not be covered in the literature? This is why I never bothered to learn Linux becuase it's shell commands fetish and the program makers' infuriating habbit of only telling you half of what you need to know is downright bloody ridiculous, why the hell havn't they developed a UI yet? ARRRRRRRGH so infuriating :mad:
 
Last edited:
righteo thanks for that, I knew I could trust this place for basic sanity. Excellent, I will now attempt to recover the data from this drive and will let you know how it goes :D
 
Why would such a basic and fundamentally important step not be covered in the literature?

Linux is based on the Unix philosophy of many small tools working together, and official documentation for Linux tools tends to assume basic Linux experience. This can be infuriating to people coming from the Windows world. In this case, the ddrescue documentation would not outline how list devices and partitions because that's not handled by this particular utility.

If you're going to use ddrescue, you should search for a new user tutorial (like the one linked above). But you will have to learn the basics of a Unix-style command line. If you want Windows-style tools, you should try a Windows-based rescue disk.
 
if you're running it from a rescue disk like parted magic or whatever then those normally have tools like file managers that allow you to browse to find the volume you need and then look at the path to see which name the disk has. Or gparted shows you a Disk Manager like view which might help. For sure you need to be very careful about getting the volume right!
 
Ok I'm learning this tool now and beginning to understand the way it works thanks to you guys putting me in the right direction.

The drive in question is mechanically faulty and when connected to the PC it causes intemittent freezing of the PC and while I can access the drives partitions in windows, navigation is painfully slow.

Based on that information, what method of cloning/recovery would you guys reccomend I perform in DDrescue, including the actual code string that I should type, so I can print it off and obviously replace the "dev/***" bits with my own.
 
Based on that information, what method of cloning/recovery would you guys reccomend I perform in DDrescue, including the actual code string that I should type, so I can print it off and obviously replace the "dev/***" bits with my own.

I would do this in two passes.

Pass 1:

Code:
ddrescue /dev/*** hdimage.img rescue.log

This will attempt to image the entire drive. Any unreadable sectors will be skipped after the initial attempt to copy them.

  • Replace "/dev/***" with the failing hard drive (normally /dev/sda if you're booting from a live CD).
  • "hdimage.img" is the name of the image file you're creating. If you're not in the location you want to save the image to, you'll need to put the full path here (usually /media/<name of external hardrive>/ for a USB-connected hard drive).
  • "rescue.log" is the log file. This allows ddrescue to keep track of what it has already done. Very useful for doing multiple passes or dealing unexpected interruptions. Always use a log file! Like the mage file, you'll need the full path if you're not in the directory you want to save the fle to.

Pass 2:

Code:
ddrescue -d -r3 /dev/*** hdimage.img rescue.log

This will attempt to re-read and copy any sectors that were missed by the first pass, and it will skip all sectors that were successfully copied. -d means it will attempt direct disc access (bypassing the kernal cache) and -r3 means it will attempt to read each bad sector 3 times. Use the same image and log file as the first pass; otherwise it will attempt to mage the entire drive again.
 
Wow, now that is exactly what I wanted, thank you for being so clear and helpful, but I'm still not sure about how to create a path location to save the recovered image and logfile to. It's nothing like the way Windows is!!

The faulty drive is connected to the SATA bay that is built-in to my PC case chassis and is connected directly to my motherboards SATA controller. This is a god send for quick and easy backups/recoveries. The chassis SATA bay is connected to the 2nd SATA channel, and my internal hard drive is connected to the 1st SATA channel.

My internal hard drive will be where I want the image to be saved to, so how would I go about typing the correct line of code for this? I'm guessing...

ddrescue /dev/faultydrive /dev/internaldrive hdimage.img rescue.log

??
 
Please insert the faulty drive into the bay, boot from the live CD, and paste the results of these commands:

fdisk -l
df

I can give you more specific help once I see that info. You have to be very careful to write the data to the right place. In Linux, you do not write files to a raw storage device (like /dev/sda), but to a mounted filesystem.
 
qu543bxuwp70sfm6g515.jpg



The 500 and 640GB drives are both my internal hard drives. The damm faulty drive has not been detected properly! Dammit, how do I proceed?
Oh and before I hit the terminal window there were hundreds of I/O errors being reported!

and the other image...

2sxdoicmm18dhp9xhcv.jpg
 
Last edited:
Just to clarify, my PC storage devices are connected as follows...

HDD 1 (windows): SATA channel 0
HDD 2 (data, backups): SATA channel 1
Optical drive: SATA channel 2
PC chassis SATA bay: SATA channel 3

The faulty drive is 160GB and has two Windows paritions.
 
You cannot use DD-Rescue on a drive that the BIOS does not pick-up/communicate with. If the BIOS cannot see it, the Operating System (Windows, Linux, etc...) cannot see it either..

If it is not listed, you can't do anything with it besides perhaps replacing the logic board on the drive to make it recognizable again... For this you usually need special training (or at least a website that sells logic boards for your EXACT drive)... Usually, you have to send them the old board.

^^^ This is what a recovery place like Knoll Ontrack would do. They would try specialized software with a specialized OS written in assmebly, and if they cannot communicate or even see a connected drive, they would replace teh electronics on the back and try to spin-it up and communicate.

Provided there is not too much physical damage and the motor still works... you wouldn't need a clean room.


*******************************************

DD Rescue seems to work the same as DD (at least as far as its syntax goes)... Obviously, it continues where DD gives up.
 
You cannot use DD-Rescue on a drive that the BIOS does not pick-up/communicate with. If the BIOS cannot see it, the Operating System (Windows, Linux, etc...) cannot see it either..

If it is not listed, you can't do anything with it besides perhaps replacing the logic board on the drive to make it recognizable again... For this you usually need special training (or at least a website that sells logic boards for your EXACT drive)... Usually, you have to send them the old board.

^^^ This is what a recovery place like Knoll Ontrack would do. They would try specialized software with a specialized OS written in assmebly, and if they cannot communicate or even see a connected drive, they would replace teh electronics on the back and try to spin-it up and communicate.

Provided there is not too much physical damage and the motor still works... you wouldn't need a clean room.


*******************************************

DD Rescue seems to work the same as DD (at least as far as its syntax goes)... Obviously, it continues where DD gives up.

My BIOS does agknowledge the drive during POST, and I would of thought if Windows could recognize and allow me to browse the drive then this ddrescue wouldn't have any trouble. I'm confused:confused:

brb going for a run to de-stress. would appreciate any further help, though!!
 
OK. You need to mount one of your internal drives so that Linux can write the image file to it. So, if you want to write the file to a folder on your 640 GB drive:

Code:
sudo mkdir /media/storage
sudo mount -t ntfs-3g /dev/sdb1 /media/storage

Linux can now write to your 640gb drive. Change /dev/sdb1 with /dev/sda2 if you want to write to a folder on the 500 gb drive instead.

Code:
cd /media/storage
ls

You should see the list of folders on the drive. Use the "cd" command to move to the folder you want to save the rescue image and log file to. Use "mkdir" to create a new folder if needed. Once you're in the right place:
Code:
ddrescue /dev/sdc hdimage.img rescue.log

Let that run its course, and then:

Code:
ddrescue -d -r3 /dev/sdc hdimage.img rescue.log

I saw that fdisk is throwing an error trying to read the partition table on the damaged drive. However, the drive itself is beng recognized. ddrescue does a sector-by-sector copy and doesn't work with the filesystem, so it may be able to get an image. You'll still have to do filesystem recovery after that.

if you do get the image, and you need help mounting it and recovering files and/or partitions, let me know.

PLEASE NOTE: ddrescue is very powerful, but also dangerous. It is possible to overwrite your own data if you are not careful. I'm happy to help, but I can't take any responsibility if things don't go as planned. ;)
 
You cannot use DD-Rescue on a drive that the BIOS does not pick-up/communicate with. If the BIOS cannot see it, the Operating System (Windows, Linux, etc...) cannot see it either..

True. However, the disk is being recognized. Linux sees the drive as /dev/sdc, but fdisk is unable to read the partition table.
 
I think he is saying he has a third drive that doesn't show up in fdisk with fdisk -l.

Now, apparently, that is not at all what he is saying. :p

Being new to Linux, he might not know that some shells are very particular and this might not work:
Code:
ddrescue /dev/sdc hdimage.img rescue.log

With many shells, to run a program you need ./ in front of it to Verify you want to run an executable binary. It does not presume necessarily you want to run executables in the working directory depending upon the shell and the configuration files for the shell.

If not, this would likely work (if dd-rescue is in your current directory and marked execute):
Code:
./ddrescue /dev/sdc hdimage.img rescue.log


Also, that said, the Working Directory must be to a writable place like /media/storage

For example:
Code:
cd /media/storage
ddrescue /dev/sdc hdimage.img rescue.log

You can check your working directory with this:
Code:
pwd

This would be another way to do the same thing:
Code:
ddrescue /dev/sdc /media/storage/hdimage.img /media/storage/rescue.log



When all done, make sure to unmount, so the file-system will commit its changes properly.

Code:
umount /dev/sdb1

Of course, you can see any mounted filesystems with:
Code:
mount
 
codegreen you are a saint! I printed off your email and keyed in each line of code pretty much exactly how you stated and I'm very relieved that the image is finally being created. It seems to be stuck at 119000 megabytes and the drive is getting very warm. Should I cancel and resume the process later or wait in hope that the remaining 41000 megabytes gets cloned before the drive gets proper trashed?

@NETWizz thanks for your input, I will make sure to unmount the drive before rebooting, thanks for the tip :)

thank god I had a customer today, so I'm on his laptop now and can ask for advice while ddrescue does it's magic on my PC :D

edit: it's been "splitting failed blocks" for the past hour!
 
Last edited:
I use to use ddrescue but i have found imaging software that does basically the same thing call hdclone and has a very small learning curve it first does a data recovery skipping over the bad sectors when it gets to end it gives you the option to skip or try to recover the data on the bad sectors.

Its not cheap 83.19 € but its worth it it is pretty fast compared to ddrescue and has a nice easy menu system, i have done quite a bit of data recovery and got fantastic results with the software.

sat.hdclone.4.1.pe.en.png
 
Last edited:
Ok just went upstairs and it had finished cloning!

Now there was some sort of yes/no prompt asking me something along the lines of "show all possiblities?" So I chose YES and then the entire terminal filled up with commands and I could not scroll back up to read the succesful clone results in more detail.

I've just tried to unmount the drive that the clone was saved to, but was told it was busy and could not unmount, no idea what to do now, will check google while awaiting response here.

@Galdorg thanks for the tip, anyone else know if this software is as good/better than ddrescue??
 
Last edited:
Back
Top