Skip to content

Capture an NTFS partition unresized when ntfsresize cannot adjust its bad sector list - #174

Merged
mastacontrola merged 1 commit into
masterfrom
fix/fogproject-762-badclust-fallback
Sep 2, 2026
Merged

Capture an NTFS partition unresized when ntfsresize cannot adjust its bad sector list#174
mastacontrola merged 1 commit into
masterfrom
fix/fogproject-762-badclust-fallback

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

For FOGProject/fogproject#762.

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. 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.sh gains a fifth case; it fails against the old library and passes with the change.
  • Full suite: 20 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby

… 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
@mastacontrola
mastacontrola merged commit 736470d into master Sep 2, 2026
1 check passed
@mastacontrola
mastacontrola deleted the fix/fogproject-762-badclust-fallback branch September 2, 2026 19:48
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.

1 participant