-
Notifications
You must be signed in to change notification settings - Fork 19
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
wslcompact fails destructively and destroys distro #6
Comments
The image was compacted from 195 GB to 88 GB. The problem during copy can be related to the reliability of the H: or C: drive. Any lock on the original image would have prevented the overwrite of the image, so the loss of the image is quite intriguing. That is a simple PS Copy-Item instruction that should not cause any issues. I will include a safety check after copy just to avoid the removal of the temp folder in case of problems during the replacement of the image. Were you using this or any other distro during the process? |
No, the distro was not in use (and could not be in use, since it didn't exist). After running wslcompact and receiving the above error, it doesn't appear in
The original vhdx still exists with a plausible filesize at I still wouldn't expect an error during a file move to result in blowing away the distro. |
If you still have the image, there are two ways to import it again. The fastest and simple one is the import-in-place. Just type: wsl --import-in-place Ubuntu C:\WSL\ext4.vhdx Ensure you have the latest WSL. |
In version v8.0 I have added a safe exit in case of a failure during the image replacement, leaving the compacted image intact as a backup in the event of a failure while moving the compacted image to the new place. |
After the failure, wslcompact continues running for other images as if nothing happened. The Ubuntu distro no longer appears in
wsl -l
and can't be used. The only file remaining in the temp directory is a 12MiB vhdx.The text was updated successfully, but these errors were encountered: