Ubuntu – Repair whole NTFS filesystem


I'm searching for useful tools for repairing a whole NTFS partition / drive, not only specific files.

My usecase: I'm trying to clone a netbook drive via partimage. Unfortunately the NTFS partition has errors and partimage says it could not properly read from the device and finally quits. It would save a great amount of work if I would be able to capture a disk image and copy it to a functional, new drive and reassemble the netbook.

Tools I already gave a try:

  • ntfsfix – run, but no improvement
  • chkdsk on Windows XP – generating output, obviously repairing, but then quitting and leaving me with an unknown error

On the partition is not really revelant data. Just preventing a Windows XP install and avoiding copying other files is worth trying a few things (or would it be just elegant to tackle the big problems with a few terminal commands..?). Please don't hesitate to recommend tools that may break something.

I'm medium confident to save the partition because Palimpsest (aka Disk Utility) suggests me that the disk has a few bad sectors, but is still "healthy" (green knob).

I'm running natty and have limited, but at least sufficient terminal knowledge.

Best Answer

Windows' chkdsk is the authoritative NTFS repair tool. If it can't fix it, then you're out of luck. You can try to wipe the whole disk and start over, and the disk may turn out to be ok, or you may need to replace it. Start by zeroing out the whole disk ( assuming it is sda ):

sudo dd if=/dev/zero of=/dev/sda

If that completes without errors, check the SMART stats in the disk utility again. The pending and offline_uncorrectable counts should be zero. If the reallocated sector count is still zero, then the drive is fine, and you can format it and continue to use it. If the reallocated count has gone up, then the drive has some physical damage that may grow worse over time. If it is under warranty, have it replaced. If not, then run the long smart self test once a week or so to make sure no additional bad sectors develop. If more bad sectors do pop up, then you will want to replace the drive.

Related Question