10

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?

1
  • What was the error message returned by CHKDSK /f after "phase 3"?
    – user26112
    Jun 22, 2013 at 18:19

5 Answers 5

5

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.

8
  • 1
    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, 2014 at 10:43
  • 2
    @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, 2014 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, 2014 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, 2014 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, 2014 at 17:21
4

Had the same problem: Disk that is about to die,
with NTFS partition that I wanted to rescue first and fix after
(before the disk is totally gone).

Was able to resolve it with ntfsclone:

  1. Connect the two disks - old and new
  2. Boot with Live-Linux from USB
    (can use Parted Magic for that as well)
  3. Create a big-enough partition on the new disk
    (use gparted for that)
  4. Note the name of the partitions, as they are named in gparted
    (/dev/sdaX, /dev/sdbX)
  5. Open a terminal window and run the following command:
    ntfsclone --force --ignore-fs-check --rescue --overwrite NEW-part OLD-part
    (replace NEW-part and OLD-part with the names from step '4.' - /dev/sd...)
    ntfsclone will complain about you overlooking the inconsistencies
    but should continue with the copy of the partition

-- when done --

  1. Turn-off the PC
  2. Disconnect the faulty disk
    (you want to use it as little as possible, now)
  3. Boot the PC again - either to Windows or Linux,
    and try to fix the partition on the new disk

EDIT:

-- NOTE --
Faulty (unstable) power-supply can cause disk-controllers to go crazy,
and are much more likely to fail than disks, so it is best to check this as well.
You may experience a behavior that everything works fine for a few minutes
(or seconds) and then the systems starts going crazy, as soon as it warms-up, literally.

(fixing the power supply will not restore the lost data, of course, but prevent you from losing more of it)

1

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.

0

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

Output:

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

0

Good day!

The point is how much your source disk is damaged. If it is almostly ruined, the only way to clone data is to use professional hardware data recovery suites. Like Atola Insight

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .