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

Document how to shrink Docker/WSL size on Windows #368

Closed
patrick-5546 opened this issue Oct 19, 2023 · 2 comments · Fixed by #374
Closed

Document how to shrink Docker/WSL size on Windows #368

patrick-5546 opened this issue Oct 19, 2023 · 2 comments · Fixed by #374
Assignees
Labels
docs Improvements or additions to documentation

Comments

@patrick-5546
Copy link
Member

Purpose

Because the vdisks automatically grow, but do not automatically shrink.

Changes

  • Outline problem
  • How to shrink vdisk

Resources

@patrick-5546 patrick-5546 self-assigned this Oct 19, 2023
@polarathene
Copy link

polarathene commented Nov 21, 2023

My comments on WSL2 experience with this issue may be informative. They're focused around Docker which has some additional gripes with storage management.

The third comment link responds to a user who used diskpart advice you linked which they said corrupted their disk.

wslcompact works well, but due to the pipe usage is not ideal if you're low on memory (some report corruption but lacking details), regardless you still need enough disk for the exported disk copy to replace the original.

Personally VMware guest seems easier to deal with than WSL2, but you can probably get away with configuring the disk to be sparse VHD (needs to be done early IIRC, otherwise the min size may not drop below the current size). For the most part, when data is removed from the vdisk then it should be reclaimed as free disk space again. It does seem to build up over time/use, so wslcompact or purging via Docker Desktop GUI (if lacking resources for wslcompact) seem to be eventually necessary to fully reclaim disk back.


Update: New summary that links back to this comment for deeper dive comments.

@patrick-5546
Copy link
Member Author

Thanks @polarathene for the update!

@patrick-5546 patrick-5546 transferred this issue from UBCSailbot/docs May 3, 2024
@patrick-5546 patrick-5546 added the docs Improvements or additions to documentation label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants