ntfsclone's rescue mode has (at least) two shortcomings:
It doesn't skip ahead when encountering errors or slow reads, putting more wear on damaged regions of the drive before saving the undamaged parts.
It isn't resumable if the drive stops responding and has to be power-cycled.
ddrescue does those things, but it has no knowledge of the volume structure, so it can't save just the allocated sectors. But it does support using a "domain mapfile" to denote the sectors to read. This commit adds a -D option to ntfsclone that writes a domain mapfile covering the allocated sectors.
partclone can also write a domain mapfile, but it only looks at $Bitmap, so if there are allocated clusters not in the bitmap (which I've found to be oddly common) it won't save all the data. (Also it has other problems with NTFS.) The unmaintained ddrutility package can also write a domain mapfile, but it's unmaintained.
I can't recommend merging this. The way I implemented this is pretty dumb, so after walking the volume, ntfsclone spends nearly all of its time in lseek (once seeking to where it wants to read, then calling it again to get the current file position). Adding another mode also adds more tricky conditionals to a program already full of them. A "proper" implementation would or any extra allocated clusters into the main bitmap and just scan through it. But this may still be useful to others.
ntfsclone's rescue mode has (at least) two shortcomings:
ddrescue does those things, but it has no knowledge of the volume structure, so it can't save just the allocated sectors. But it does support using a "domain mapfile" to denote the sectors to read. This commit adds a
-D
option to ntfsclone that writes a domain mapfile covering the allocated sectors.partclone can also write a domain mapfile, but it only looks at
$Bitmap
, so if there are allocated clusters not in the bitmap (which I've found to be oddly common) it won't save all the data. (Also it has other problems with NTFS.) The unmaintained ddrutility package can also write a domain mapfile, but it's unmaintained.I can't recommend merging this. The way I implemented this is pretty dumb, so after walking the volume, ntfsclone spends nearly all of its time in lseek (once seeking to where it wants to read, then calling it again to get the current file position). Adding another mode also adds more tricky conditionals to a program already full of them. A "proper" implementation would or any extra allocated clusters into the main bitmap and just scan through it. But this may still be useful to others.