You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to mention that it worked great for me, using latest commit 44613af.
Note: Before running the script I ran: wsl --shutdown
Script output:
PS C:\Users\anon\Src> .\Move-WSL2NewDrive.ps1
Which distro do you want to move?
1 Ubuntu-20.04 (Location: C:\Users\anon\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState)
2 docker-desktop (Location: \\?\C:\Users\anon\AppData\Local\Docker\wsl\distro)
3 docker-desktop-data (Location: \\?\C:\Users\anon\AppData\Local\Docker\wsl\data)
Chose wisely: 1
Enter the full parent path to the new distro (the path used will be: <path you enter>\<distro-name>): G:\WSL
Moving distro Ubuntu-20.04. Please save and close all work in WSL2 before proceeding, as a WSL shutdown is required to
move a distro.
Current Path:
C:\Users\anon\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState
New Path: G:\WSL\Ubuntu-20.04
Would you like to proceed (Y/n)?
[Y] Yes [N] No [?] Help (default is "Y"):
It's cleanup time!
The original file now appears out of date, based on the last write times of the old and new VHDX files. Which means it
should be safe to delete the old VHDX file and free up some space.
Do you want to be 100% certain first!
Go to the original and new locations and compare the Date Modified time on the VHDX files. The time on the new file
should have a newer Date Modified time.
The old VHDX file should not have a Date Modified time much newer than around 6/25/2023 11:09:19 AM. That is roughly
the time when the script stopped wsl.
The original VHDX file is in:
C:\Users\anon\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState
The new VHDX file is in:
G:\WSL\Ubuntu-20.04
You can use "wsl --shutdown" followed by relaunching the WSL2 distro to force a change of the Date Modified time. The
new file time should change, the old file should remain the same.
If that's what happened then it should be safe to delete the old file.
Remove the original file?
[Y] Yes [N] No [?] Help (default is "Y"):
PS C:\Users\anon\Src>
The text was updated successfully, but these errors were encountered:
Thank you for sharing this. I found your repo by way of MicrosoftDocs/WSL#412
Just wanted to mention that it worked great for me, using latest commit
44613af
.Note: Before running the script I ran:
wsl --shutdown
Script output:
The text was updated successfully, but these errors were encountered: