microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.29k stars 814 forks source link

Add progress to --export #5161

Open KevinHake opened 4 years ago

KevinHake commented 4 years ago

Exporting a distro to a tar file with wsl.exe --export can take a long time, during which there is no feedback to the user. It would be nice to optionally see something like a progress bar, so the user knows the command is not stalled, and can estimate how much more time is needed to complete the task.

thomasaull commented 4 years ago

As a workaround, you can check how big the exported .tar file is and compare it with the size of your vhdx I guess?

tautomer commented 3 years ago

Another workaround is to check the disk usage and network usage (only when the backup is stored on a remote disk). image

b-hayes commented 3 years ago

The thing is mine appears like it should be finished with the tar file being 17gig, no disk usage etc but the export has not finished. How can I reliably tell if it is finished and that the export is safe to re-use on another system? Any kind of feedback would be nice.

EvidentlyCube commented 2 years ago

Another reason to have ANY kind of feedback - my Win 11 broke overnight and I am preparing to reinstall the system and I don't know if the export is happening (in which case I'll wait for it to finish) or if it's just there happily doing nothing.

agarwalvaibhav0211 commented 2 years ago

A much needed feature. My vhdx is 20gb, but the tar file shows zero mb size after waiting for 2 hours. When I cancel the command thinking the export is not working, the tar file suddenly becomes 15GB in size. Thus a progress bar would be a good feature

gsusI commented 2 years ago

A much needed feature. My vhdx is 20gb, but the tar file shows zero mb size after waiting for 2 hours. When I cancel the command thinking the export is not working, the tar file suddenly becomes 15GB in size. Thus a progress bar would be a good feature

This is exactly the issue I encountered, the tar file size is not updated until the process is killed or finished.

My WHDX is 75GB, so exporting becomes a painful process.

Also, errors can occur, so a process that doesn't give feedback for hours can become very frustrating.

Using the trick suggested by @tautomer helps as, at least, I can see that the export process is writing something.

gsusI commented 2 years ago

So... in terms of figuring out the size of the exported tar to understand the progress of the export process:

But, when I ran WinDirStat for that folder... tachan!

image

Then, the even more interesting part, ls now shows the size

image

🤷‍♂️

ezrag26 commented 2 years ago

As a workaround, you can check how big the exported .tar file is and compare it with the size of your vhdx I guess?

I wasn't able to see it update when refreshing the folder (which usually helps other times) but I was able to see it change after double clicking on the file, in case this helps anyone else.

jepdavidson commented 1 year ago

I know this is an old issue, but in case it helps anyone:

On Windows11, I also see 0 KB reported as the tar file size in Windows explorer. However, I found that right-clicking the file and choosing 'properties' from the context menu will show the file size.

image

The property window can be closed and the process repeated to monitor progress.

eburnette commented 5 months ago

Why is it so slow anyway? My docker-desktop-data vhdx is 642GB, and it's... taking... forever.... Task manager shows 12% CPU, and the C: drive (SSD) shows 142MB/s reads. I could have copied the vhdx file many times over by now (over an hour). I know there's a regedit workaround, but I'm wary of going that route.

KevinHake commented 5 months ago

Why is it so slow anyway? My docker-desktop-data vhdx is 642GB, and it's... taking... forever.... Task manager shows 12% CPU, and the C: drive (SSD) shows 142MB/s reads.

Well, 642GB at 142MB/s is something like 75 minutes, and presumably you're writing the copy out to the same drive, so add to that the size / write speed (it'll depend on your hardware if/how much reading and writing can happen in parallel). Do you know how long it did take to finish?

For comparison, my big old spinning disk drive does a ~53MB/s copy of sequential data, and my 980 Pro SSD copying a big git repo (lots of randomly sized files) averages ~100MB/s (in native linux)... so an hour 50 minutes is right around what I'd expect on my SSD.

According to this: https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md we have some tools available to get logs about what's happening when the command is issued, so that might make the solution (adding a progress bar) obvious (and might also make it more clear it's not stalled). Not sure if anyone with access to the code will see this, considering I opened it 4 years ago, but if someone wanted to post logs maybe it would help (I'm no longer using Windows, so it probably won't be me).