Last active
August 28, 2023 18:34
-
-
Save marhensa/e295e443d0ae4e4104c99912be3abca7 to your computer and use it in GitHub Desktop.
Compacting Virtual HD of WSL (VHDX)
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
# Without Hyper-V Enabled | |
# Powershell (As Administrator) | |
wsl --shutdown | |
diskpart | |
# Diskpart Compacting Operations | |
select vdisk file="E:\LABS\DockerWSL\docker-desktop-data\ext4.vhdx" | |
attach vdisk readonly | |
compact vdisk | |
detach vdisk | |
exit |
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
# With Hyper-V Enabled | |
# Powershell (As Administrator) | |
Optimize-VHD -Path "E:\LABS\DockerWSL\docker-desktop-data\ext4.vhdx" -Mode Full |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment