WSL 2 should automatically release disk space back to the host OS
**Is your feature request related to a problem? Please describe.** I occasionally have workloads that consume large amounts of disk space for temporary use in `/tmp`. For example, transcoding large video files or processing large datasets exported from a database. Since WSL2 stores its filesystem on a `.vhdx`, that file grows when the dataset is processed and never releases that space. Also, it doesn't appear to re-use released disk space in the `.vhdx` when files are deleted... it seems to prefer to grow the file rather than re-use existing empty space. (I haven't explicitly tested that theory, but my workload deletes temporary files as they are used and I never had enough of them existing simultaneously to reach 250GB, but the size of the `.vhdx` eventually expanded to that size. When I'm done with that workload, I have to: ``` wsl --shutdown optimize-vhd -Path .\ext4.vhdx -Mode full ``` This is annoying since it basically means that my system backups include a huge `.vhdx` file that is mostly empty. Also, until about 2 weeks ago, it was consuming the entire remainder of my system disk. I had only 50GB free, which was enough to handle the workload, but since it continued to grow even after files were removed, that didn't matter. (I figured it was time to upgrade the disk size anyway) **Describe the solution you'd like** Automatic compaction of the `.vhdx`, or a way to do so while WSL2 is still running so that I can schedule it for frequent cleanups. **Describe al
Posted by dsmaher on Nov 20, 2019, 2:00 PM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
WSL 2 should automatically release disk space back to the host OS
**Is your feature request related to a problem? Please describe.** I occasionally have workloads that consume large amounts of disk space for temporary use in `/tmp`. For example, transcoding large video files or processing large datasets exported from a database. Since WSL2 stores its filesystem on a `.vhdx`, that file grows when the dataset is processed and never releases that space. Also, it doesn't appear to re-use released disk space in the `.vhdx` when files are deleted... it seems to prefer to grow the file rather than re-use existing empty space. (I haven't explicitly tested that theory, but my workload deletes temporary files as they are used and I never had enough of them existing simultaneously to reach 250GB, but the size of the `.vhdx` eventually expanded to that size. When I'm done with that workload, I have to: ``` wsl --shutdown optimize-vhd -Path .\ext4.vhdx -Mode full ``` This is annoying since it basically means that my system backups include a huge `.vhdx` file that is mostly empty. Also, until about 2 weeks ago, it was consuming the entire remainder of my system disk. I had only 50GB free, which was enough to handle the workload, but since it continued to grow even after files were removed, that didn't matter. (I figured it was time to upgrade the disk size anyway) **Describe the solution you'd like** Automatic compaction of the `.vhdx`, or a way to do so while WSL2 is still running so that I can schedule it for frequent cleanups. **Describe al
Comments (0)
No comments yet. Start the discussion.