Capture an NTFS partition unresized when ntfsresize cannot adjust its bad sector list - #174
Merged
Merged
Conversation
… bad sector list ntfsresize shrinks $BadClus:$Bad as part of every resize, and on some Windows 11 volumes that truncate fails with "Could not adjust the bad sector list" while chkdsk finds nothing wrong (fogproject #762). The dry run failed there and the capture aborted. The real resize would fail the same way, so record the partition as fixed size and capture it at its present size: the "not resizable" image type, the workaround people were already using, applied to one partition instead of the whole image. tests/checks/ntfs-shrink-retry.sh gains a fifth case that fails on the old code. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For FOGProject/fogproject#762.
ntfsresize shrinks
$BadClus:$Badas part of every resize, and on some Windows 11 volumes that truncate fails withCould not adjust the bad sector listwhile chkdsk finds nothing wrong. The dry run failed there and the whole capture aborted. That code path is unchanged upstream since the 2022.10.3 release FOS ships, so a package bump would not change it, and no local volume reproduces it.The real resize would fail the same way, so when the dry run ends with that message the partition is recorded as fixed size and captured at its present size. That is the "not resizable" image type, the workaround people were already using, applied to the one partition instead of the whole image.
Behavior change worth noting: a capture that used to abort now succeeds with a console line saying the partition was not shrunk, so that image cannot deploy to a smaller disk.
tests/checks/ntfs-shrink-retry.shgains a fifth case; it fails against the old library and passes with the change.🤖 Generated with Claude Code
https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby