Honor --no-size-check in CLI volume creation#1756
Open
damianrickard wants to merge 1 commit into
Open
Conversation
The text-mode volume creation path clamps the maximum allowed volume size to the available free disk space and never consults ArgDisableFileSizeCheck, so the documented --no-size-check switch has no effect when creating a file-hosted container with `--text --create`. The flag is honored by the GUI wizard (Forms/VolumeSizeWizardPage.cpp) but was missing from the text UI, making it impossible to create a (sparse) container larger than the current free space from the command line -- even though such a container is perfectly valid on filesystems with sparse-file support (e.g. APFS, ext4, NTFS) and is exactly what the flag exists to allow. Skip the free-space clamp when --no-size-check is set, mirroring the GUI behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
|
Thanks for the sharing the fix for this issue. That being, I can't merge this PR in its current state because of the following:
Could you update both max paths to use: options->Size = min (maxVolumeSize, AvailableDiskSpace);This preserves current behavior when --no-size-check is absent (maxVolumeSize is already clamped) and uses AvailableDiskSpace when the check is disabled. Please also update the stale comment that says maxVolumeSize is guaranteed to be ≤ AvailableDiskSpace. Once the commit is amended to include these changes and remove Claude Fable 5 co-author (if you take full responsability and ownership of the changes), I will merge this PR. |
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.
Problem
The documented
--no-size-checkswitch ("Disable check of container size against disk free space") has no effect when creating a file-hosted container via--text --create. Creating a container larger than current free space fails withError: Incorrect volume size, even though that's a valid request on sparse-capable filesystems (APFS, ext4, NTFS) and is exactly what the flag exists to permit.Root cause
In
TextUserInterface.cpp, the volume-creation path clampsmaxVolumeSizeto available free disk space and never consultsCmdLine->ArgDisableFileSizeCheck. The flag is honored by the GUI wizard (Forms/VolumeSizeWizardPage.cpp) but was never wired into the text UI.Fix
Skip the free-space clamp when
--no-size-checkis set, mirroring the GUI behavior. One-line guard; no change to default behavior.Verification
Built on macOS arm64;
--text --create --size 3500G --quick --no-size-check ...now succeeds, producing a sparse 3.42 TiB container (256 KB physical on APFS). Without the flag, the free-space check still applies as before.