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
In scripts, if you going to check for free space, before writing, you can't use the standard df $PWD or df $write_target as a check. According to the sequence below in WSL2, a script checking for free space will fail.
The script write until its filled up all the free space on the laptop/PC C:\ drive. This laptop only had WSL in its C:\ location.
If its a company server it could be a potential big problem for sysadmins.
$ df -h $PWD
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 1007G 5.3G 951G 1% /
$ df -h /mnt/c
Filesystem Size Used Avail Use% Mounted on
C:\ 931G 815G 116G 88% /mnt/c
$uname -a
Linux fred 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
The first df tells me I have 951 GB of free space to play with in my WSL2 home directory.
The second df tells me I have 116 GB of free space where WSL2 and everything else lives on the C:\ drive
The reality is WSL has only 116 GB cause its VHD will dynamically grow until used up everything on the C:\ drive
This was reported earlier but the folks didn't realize the consequences #9757
Having WSL on a non-OS drive [D:] is interesting the drive size (1007G) is the same as previous but doesn't resemble any drive on both installations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In scripts, if you going to check for free space, before writing, you can't use the standard df $PWD or df $write_target as a check. According to the sequence below in WSL2, a script checking for free space will fail.
The script write until its filled up all the free space on the laptop/PC C:\ drive. This laptop only had WSL in its C:\ location.
If its a company server it could be a potential big problem for sysadmins.
This was reported earlier but the folks didn't realize the consequences #9757
Having WSL on a non-OS drive [D:] is interesting the drive size (1007G) is the same as previous but doesn't resemble any drive on both installations.
Beta Was this translation helpful? Give feedback.
All reactions