Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntfsclone: support writing a ddrescue domain mapfile #40

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from

Conversation

jbosboom
Copy link

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.

@Neustradamus
Copy link

@jpandre: Have you looked this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants