Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm an Italian Windows programmer. I know almost nothing of Linux, so please be patient if the question is dumb and pardon my bad english.

I need to clone a NTFS partition from a damaged, near to die hard disk (SCSI, if this matters) to a new one (SATA).

I've installed the last version of Hiren's Boot CD utilities on a USB stick, and tried with GParted, which told me that it can't copy/paste the partition because it's damaged and "flagged" by windows to run CHKDSK. I followed the Warning advice and tried to repair it using CHKDSK /f (it took 9 hours and exited with an error after "phase 3") and a Linux program I can't recall right now, without success.

I tried to clone using Clonezilla, and it failed as well, for the same reasons. In the HBCD there's dd_rescue, but it failed again because it can't find "ntfs.something".

In the end, all that I want is to clone that partition as it is, with his errors and everything. I can repair it on the new drive.

So, what should I do?

share|improve this question
What was the error message returned by CHKDSK /f after "phase 3"? –  Evan Teitelman Jun 22 '13 at 18:19

4 Answers 4

An alternative to ddrescue is regular dd using conv=noerror,sync options.

dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync

If it hits an error, it will skip the block (4k in case of 4k blocksize as in this example), and it will write binary zeroes on the target. So errornous regions of the old disk will be zeroed out on the new disk.

A larger blocksize like bs=1M may speed the process up considerably as many HDDs react badly to and slow down on read errors; on the other hand it could mean a 1M hole in the copy even if there was only a single bad 4k sector. This is okay for large consecutive bad areas, not so great for isolated bad sectors.

Unfortunately dd does not tell you exactly where the errors were in this copy process. There is also no direct way to retry reading defective zones (although personally, I did not yet have a case of defective disk where such retries would have helped any).

share|improve this answer
Why is the conv=sync option useful in this case? I looked at man dd, but it's very cryptic. –  landroni Jan 27 '14 at 16:52
@landroni: sync writes zeroes in place of bad blocks so source and target data will be written to the same offsets. without sync, the copy is corrupt starting from the first bad block encountered on the source disk. –  frostschutz Jan 27 '14 at 17:50
After reading the gddrescue docs, I come to believing that ddrescue has a superior strategy in trying to deal with bad sectors. The dd approach is probably fine in case of some bad sectors, but less so for very problematic hard-drives. –  landroni Feb 2 '14 at 19:21

You can of course try to repair the NTFS partition on the original drive, but I cannot recommend to do so, as the problems might be caused by hardware failure and repairing could make things worst.

Make a block for block copy with ddrescue to a file first. If there are any block that cannot be copied ddrescue will continue with the rest of the disc.

If ddrescue doesn't find any bad blocks then you can try to use repair software on the file (mounted via loopback). If there are problems with the SCSI drive or you just want to be sure to be able to start over from scratch, make a copy of your file and try to repair the NTFS filesystem on the second copy. As copying a disk with errors can be time consuming process, you might have to interrupt the process (because you need the computer, to let the drive cool down, or to restart the firmware of the drive).

That is why in my experience ddrescue is far superior in problematic cases than is dd with conv=noerror. ddrescue keeps a log about what it has done and restarts based on that information, a feature unavailable to dd. ddrescue is also smarter in reading blocks starting from the end, if it encounters a problem area. It will arrive much quicker at an image copy state that you can use as the basis for a filesystem check (and you can continue to ddrescue the original copy). You can only do something like that with dd if you are willing to spent a lot of time calculating offsets by hand.

You can also copy the file to a NTFS partition of the right size, put the drive in a windows machine and use the native repair tools from there.

share|improve this answer
Very useful! Could you add an exact command-line example of ddrescue in action, similar to the dd example in the other answer? –  landroni Jan 27 '14 at 10:43
@landroni I could (basically ddrescue /dev/sdX driveimage logfile) but you really should spent the effort on reading ddrescue documentation. If your system is broken, there are a lot of reasons to read the manual before potentially making things worse. –  Anthon Jan 27 '14 at 12:29
I am now looking at the man page, but some of the options are cryptic. What would be the most conservative ddrescue equivalent of dd if=/dev/olddisk of=/dev/newdisk bs=4k conv=noerror,sync? Keeping in mind that it would be run on a damaged (and dying) disk, and that "trying hard to rescue data in case of read errors" isn't really an option. Thanks! –  landroni Jan 27 '14 at 16:44
@landroni with the options given in my previous comment each sector in a block is only tried once. The only way I know of that you can improve on that is if you know which areas are OK for sure and use -i and -s to recover those. –  Anthon Jan 27 '14 at 17:06
Well, last time I tried ddrescue /dev/sr0 driveimage.iso (on a scratched CD), the programme tried to read again a lot of bad sectors, a lot of times. I may be wrong, but I would be skittish about running ddrescue with no other limiting options on a dying disk. –  landroni Jan 27 '14 at 17:21

I would attempt to repair the disk with either HDAT (freeware) or possibly Spinrite (Commercial). I've used both of these tools to recover disks that were failing and they have both worked well in the past.

Until the drive is in a usable state I don't anticipate you getting too far in your recovery efforts. Once the disk has been cleared I'd use Clonezilla to replicate it as quickly as you can to an alternate HDD.

share|improve this answer

I feel this question should have a working example so this is how I used ddrescue

0) Installed an identical size (and brand) replacement drive under warranty and moved the old drive to a second slot

1) I used an ubuntu boot cd

I tried the simple option but it immediately produced a lot of errors and hung

dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
root@ubuntu:~# dd if=/dev/sdb of=/dev/sda bs=512 conv=noerror,sync
dd: error reading ‘/dev/sdb’: Input/output error
57496+0 records in
57496+0 records out
29437952 bytes (29 MB) copied, 6.02927 s, 4.9 MB/s
dd: error reading ‘/dev/sdb’: Input/output error
57496+1 records in
57497+0 records out
29438464 bytes (29 MB) copied, 8.86693 s, 3.3 MB/s
dd: error reading ‘/dev/sdb’: Input/output error
57496+2 records in
57498+0 records out
29438976 bytes (29 MB) copied, 11.7068 s, 2.5 MB/s
dd: error reading ‘/dev/sdb’: Input/output error
57496+3 records in
57499+0 records out

2) Read these articles:

Note the latter recommended using -d direct disc access, but I didn't use it

3) Installed ddrescue

sudo apt-get install gddrescue
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
sudo apt-get update
sudo apt-get install gddrescue
man ddrescue

May also need (?)

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

4) Finally ran (if you are copying and pasting, stop, sda is my new drive... pay attention and do your homework)

ddrescue -v -r3 /dev/sdb /dev/sda ~/ddrescue.log
  • -v verbose
  • -r 3 retries
  • ~/xx log file which can be used to retry apparently. Note this is only stored in memory but could be copied to a usb drive


GNU ddrescue 1.17
About to copy 1000 GBytes from /dev/sdb to /dev/sda
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 128 sectors       Initial skip size: 128 sectors
Sector size: 512 Bytes

Press Ctrl-C to interrupt
rescued:    22555 MB,  errsize:    196 kB,  current rate:   91815 kB/s
   ipos:    22555 MB,   errors:       5,    average rate:   68975 kB/s
   opos:    22555 MB,    time since last successful read:       0 s
Copying non-tried blocks...

5) Booted windows and reactivated ... tbc

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.