Skip to main content
data-recovery-headCOMP

ddrescue vs dd: One of Them Stops at the First Bad Sector

dd halts on a read error and can pad what it could not read. ddrescue maps the unreadable regions, keeps going, and comes back for them. On a dying drive that difference decides how much survives.

By Eric Gerard · Editor · Save My Disk4 min readPhoto via Pexels

Both copy a block device. On healthy hardware they do the same job and dd is fine.

On a drive that is failing, they behave so differently that the choice decides how much of your data survives.

What dd does at a bad sector

dd reads in order. When a read fails, it stops.

Told to continue with conv=noerror,sync, it does something worse for recovery purposes: it writes zeros in place of what it could not read, so the offsets stay aligned. The image is the right size and the damaged regions are silently filled with plausible-looking nothing.

Afterwards you cannot tell those zeros from real ones. The information about what failed existed for a moment, in the error output, and was never recorded anywhere the image could carry.

What ddrescue does instead

Three things, in an order that is the whole design:

  1. Copy everything readable, fast, skipping trouble. No fighting bad regions on the first pass.
  2. Write a map file recording exactly which regions succeeded, which failed, and which are untried.
  3. Then go back and retry the failed regions with progressively smaller reads.

The map file is the most valuable artefact of the operation, more than the image itself in the early stages. It makes the job resumable: if the drive drops off the bus, you restart with the same map and it continues instead of re-reading everything from the start.

On a drive with limited life left, not re-reading the good parts is the difference between finishing and not finishing.

Two people in orange high-visibility vests working an archaeological excavation along an old stone wall, one standing at a survey instrument mounted on a yellow tripod, the other crouched in a red helmet and yellow ear defenders beside a backpack.
Two people in orange high-visibility vests working an archaeological excavation along an old stone wall, one standing at a survey instrument mounted on a yellow tripod, the other crouched in a red helmet and yellow ear defenders beside a backpack.

They survey before they dig, and they record where they have already been. That is the entire difference between the two tools, and the photograph cannot show the part that matters: the notebook. dd does the digging without the notebook.

The ordering is the point

It looks like a small optimisation and it is not.

A failing drive has a budget: a number of hours, or a number of read attempts, before it stops responding for good. Nobody knows the size of that budget in advance.

dd spends it in physical order, which means it may exhaust itself grinding on a bad region at 5 percent while 90 percent of your data, sitting further along the disk, is still readable and never gets copied.

ddrescue spends the budget on the easy data first. If the drive dies at the same moment, you have 90 percent instead of 5.

When dd is the right tool

Healthy media. Writing an installer image to a USB stick. Cloning a working disk. Wiping. Reading a fixed number of blocks from a known-good source. It is smaller, it is everywhere, and it does not need a map file for any of that.

The rule is about the state of the source, not about preference. Healthy source: either works. Suspect source: ddrescue, always.

What neither of them does

Neither recovers files. They produce a block-for-block copy. Getting files out of that image is a separate step with separate tools, and a filesystem repair on the image is another one again.

Neither tells you whether the drive is dying. You have to have decided that already, which is uncomfortable, because the decision has to be made before the tool can help.

A still life of sepia family photographs, one showing four women in period dress, resting on a gilded book cover lettered in gothic script, beside a large rusted iron key and two white daisies.
A still life of sepia family photographs, one showing four women in period dress, resting on a gilded book cover lettered in gothic script, beside a large rusted iron key and two white daisies.

This is what the argument is about. Not the drive, which is replaceable and insured, and not the tool. The reason to image before repairing is that the things on the disk usually exist in exactly one copy.

The order that protects you

  1. Stop using the drive. Minutes cost data on failing hardware.
  2. Image with ddrescue, to healthy storage, keeping the map file.
  3. Work on the image. Repair, recover, analyse. Never on the original.
  4. Retry the bad regions later if you need them, using the same map, on a second pass.

The whole method fits on that list. The hard part is not the commands, it is deciding early enough that this is the situation you are in, and that decision has to happen while the drive still answers.

Editorial pick
4.5 / 5

Recover your deleted files → EaseUS

Free scan · deleted, formatted & lost files · Windows & Mac

Founded in 200430-day guaranteeFree 2 GB version
See the offer

Frequently asked questions

What is the difference between dd and ddrescue?

dd copies blocks in order and stops when a read fails, unless you tell it to continue, in which case it can write zeros in place of what it could not read. GNU ddrescue is built for failing media: it copies everything readable first, records the position and size of every region it could not read in a map file, and only then goes back to retry those regions with smaller reads. The result is that ddrescue gets the good data off the drive before spending the drive's remaining life on the hard parts.

Can I use dd to image a failing hard drive?

You can, and it is usually the wrong choice. On a drive with bad sectors, dd will either stop at the first one or, with conv=noerror,sync, keep going while padding the unreadable areas with zeros so the offsets stay aligned. Those zeros are indistinguishable from real zeros in the image afterwards, and you have no record of which parts are genuine. ddrescue keeps that record in its map file, which is the single most valuable artefact of the whole operation.

What is the ddrescue map file and why does it matter?

It is a plain text record of which regions have been read successfully, which failed, and which are still untried. It means the operation is resumable: if the drive drops off the bus or you have to stop, you restart with the same map file and it picks up where it left off instead of re-reading everything. On a drive with limited life remaining, not re-reading the good parts is the difference between finishing and not.

How long does ddrescue take on a failing drive?

The first pass runs close to the drive's normal speed, because it skips trouble rather than fighting it. The retry passes are the slow part, and they can take hours or days depending on how many bad regions there are and how the drive behaves. This is why the ordering matters: by the time the slow phase starts, everything easily readable is already safely copied.

Should I run ddrescue on the original drive or a clone?

On the original, because ddrescue is the tool that makes the clone. That is the point of it. Everything after this step, the filesystem repair, the file recovery, the analysis, runs on the image and never touches the failing drive again. If the drive dies during imaging, a partial image is still worth far more than a drive nobody imaged.