Include the NTFS Boot Record backup in the cloned image #54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Include the NTFS Boot Record backup in the cloned image
This one depends on your view. A NTFS file system is 1 block smaller than the partition and a copy of the Boot Record is stored in the last sector of the partition. When we clone a NTFS file system, this extra block is not cloned. However, that block is created/modified by mkfs.ntfs, so it seem logical to include it in the image.
This commit update the code to include the extra block in the clone, by increasing the totalblock count and setting the last bit of the bitmap. This have the following effect: the restored file system have the same checksum than the original one. And if we restore the image on a partition with identical geometry than the original, we do not need to run ntfsfixboot.