1.在WSL中执行命令`fstrim -a`,以清理不必要的文件。 2.关闭WSL,在PowerShell中执行命令`wsl shutdown`。 3.使用Diskpart工具选择虚拟硬盘文件。 4.执行`compact vdisk`命令,等待完成。 请注意,在执行这些操作之前,请确保已经备份了重要数据,并且在进行任何硬盘操作时都需要谨慎。此外,对于WSL2,由于其使用虚拟硬...
之前在跑数据时产生了大体积文件, 占据了C盘的大量空间, 删除文件后C盘空间并不能得到释放。这是因为WSL的虚拟硬盘可以自动扩容但不能自动收缩释放。找了很多办法后最终解决[1][2], 现将过程整理如下: 首先需要将虚拟硬盘空间写零, 回收WSL中未使用的空间,在Linux命令窗口下: wsl>fstrim -a 随后使用Diskpart工...
ChGen commented Mar 26, 2024 • edited @yangyang233333 , for me performance was about the same, but it is still experimental feature, and I've got host & guest filesystem corruption after using it for some time (and calling fstrim inside VM). So I'd stick to the old method for t...
NOTE: I am sure this is not a bug with WSL2's memory handling, more on this later in the issue. Running Windows 10 build 19044, with Docker Desktop v4.12.0 has a problem where the memory consumption eventually eats up until it hits the W...
From within a Linux VM (be it the Docker-provided or any other you installed yourself), you can run sudo fstrim -a (or sudo fstrim -av if you want details) and let the hypervisor deallocate the empty blocks of the virtual disk. This is managed by the hypervisor itself and works on ...
I ended up nuking both files, and did a fresh distro install. Went fine but at some point it started throwing corruption errors too, this timedpkgwouldn't run because of corrupted files. I've now spent the last two days uninstalling and reinstalling WSL and testing out distros, but have ...