Created
August 13, 2022 07:20
-
-
Save cmpute/e8a3ee05ddeda157175663d168f2310c to your computer and use it in GitHub Desktop.
Shrink WSL2 virtual hard drive
This file contains 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
wsl --shutdown | |
diskpart :: opening a separate window | |
select vdisk file="C:\Users\{user}\AppData\Local\Packages\…\ext4.vhdx" | |
attach vdisk readonly :: this step is necessary to prevent process conflict | |
compact vdisk | |
detach vdisk | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just for example, the hard drive file in my laptop is located at: