User Tools

Site Tools


other:win10wsl

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
other:win10wsl [2022/08/25 13:39]
jypeter [Computer CPU and memory]
other:win10wsl [2022/08/25 14:59]
jypeter [Disk space] started improving the section
Line 47: Line 47:
  
  
-==== Disk space ====+==== Disk usage ==== 
 + 
 +=== Overview === 
 + 
 +  * ''​WSL''​ is part of the Windows operating system and will be installed (and updated) on ''​C:​\''​ 
 +  * The Linux installation(s) will be installed (and updated) on ''​C:​\''​ 
 +    * They can only be relocated to other partitions afterwards 
 + 
 +  * => We should **start with at least 10 Gb of free space on ''​C:​\''​** (but more space is always better and safer) 
 +    * The initial installation will not use much space (2-3 Gb), but we always need space on ''​C:​\''​ for other applications and Windows maintenance (temporary files, updates, ...) 
 + 
 +=== How does it work? === 
 + 
 +WSL+Linux seems to use a combination of actual Windows files/​folders and ''​ext4''​ Linux partitions stored in ''​.vhdx''​ ([[https://​docs.microsoft.com/​en-us/​openspecs/​windows_protocols/​ms-vhdx/​83f6b700-6216-40f0-aa99-9fcb421206e2|Dynamic Virtual Hard Disk]]) files. The Linux disk (of type ''​ext4''​) is stored in a single ''​some_name.vhdx''​ Windows file that will automatically grow until it reaches a predefined maximum size of 256 Gb (if there is enough space on the Windows disk...) 
 + 
 +  * Check [[https://​docs.microsoft.com/​en-us/​windows/​wsl/​vhd-size|Expand the size of your WSL 2 Virtual Hard Disk]] if you need more than 256 Gb 
 +  * Check the following threads if you want to reduce the size of the ''​vhdx''​ file: 
 +    * [[https://​superuser.com/​questions/​1606213/​how-do-i-get-back-unused-disk-space-from-ubuntu-on-wsl2|How do I get back unused disk space from ubuntu on wsl2?]] 
 +    * [[https://​github.com/​microsoft/​WSL/​issues/​4699#​issuecomment-1136319012|WSL 2 should automatically release disk space back to the host OS]] 
 +      * [[https://​docs.microsoft.com/​en-us/​powershell/​module/​hyper-v/​optimize-vhd?​view=windowsserver2019-ps|Optimize-VHD]]
  
 <​code>​stdu@sadira034:​~$ ls -lh /​mnt/​c/​Users/​jypeter/​AppData/​Local/​Temp/​swap.vhdx <​code>​stdu@sadira034:​~$ ls -lh /​mnt/​c/​Users/​jypeter/​AppData/​Local/​Temp/​swap.vhdx
other/win10wsl.txt · Last modified: 2023/12/06 13:24 by jypeter