Question: I’m trying to recover files on a dying hard drive, using GNU’s ddrescue. The drive is rather large (1TB), and all I have to store the image is another 1TB drive.

ddrescue fails near the end, with an error about disk space, even with the -S option.

Why isn’t it possible to compress the image as it is created ? It is possible with dd and dd_rescue.

Also, man ddrescue says that the -S option doesn’t work on all systems, but how can I know if it works on mine ?

Answer: gddrescue dosen’t image the file in order – it goes back and retries, and fills in the blanks, and I suspect this is why you can’t effectively pipe it into something else. The man page goes into that in detail

?

GNU ddrescue manages efficiently the status of the rescue in progress ?and tries to rescue the good parts first, scheduling reads inside bad ?(or slow) areas for later. This maximizes the amount of data that can ?be finally recovered from a failing drive.

?

The standard dd utility can be used to save data from a failing drive, ?but it reads the data sequentially, which may wear out the drive ?without rescuing anything if the errors are at the beginning of the ?drive.

?

Other programs switch to small size reads when they find errors, but ?they still read the data sequentially. This is a bad idea because it ?means spending more time at error areas, damaging the surface, the ?heads and the drive mechanics, instead of getting out of them as fast ?as possible. This behavior reduces the chances of rescuing the ?remaining good data.

Its by design, and the solution, unfortunately, is to get a bigger drive. For the -S argument to work, I believe the used space on the source drive must be smaller than the destination drive.