Skip to content
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

WSL writes to mounted windows drive increases wsl drive size #11491

Closed
1 of 2 tasks
jujugoboom opened this issue Apr 20, 2024 · 6 comments
Closed
1 of 2 tasks

WSL writes to mounted windows drive increases wsl drive size #11491

jujugoboom opened this issue Apr 20, 2024 · 6 comments

Comments

@jujugoboom
Copy link

jujugoboom commented Apr 20, 2024

Windows Version

Microsoft Windows [Version 10.0.19045.4291]

WSL Version

WSL version: 2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Kernel version: 5.15.146.1-2

Distro Version

Ubuntu 22.04.2

Other Software

rclone v1.53.3-DEV, go version: go1.18.1

Repro Steps

Setup rclone to write to a mounted windows drive. All writes from rclone to this drive seem to be replicated on the Ubuntu VHD

Expected Behavior

Writes only occur on the target mounted disk, the Ubuntu VHD does not grow.

Actual Behavior

Writes occur on the target mounted disk as well as on the VHD

Diagnostic Logs

df -h gives

Filesystem      Size  Used Avail Use% Mounted on
none             16G  4.0K   16G   1% /mnt/wsl
none            922G  896G   27G  98% /usr/lib/wsl/drivers
none             16G     0   16G   0% /usr/lib/modules
none             16G     0   16G   0% /usr/lib/modules/5.15.146.1-microsoft-standard-WSL2
/dev/sdc       1007G  455G  502G  48% /
none             16G   80K   16G   1% /mnt/wslg
none             16G     0   16G   0% /usr/lib/wsl/lib
rootfs           16G  1.9M   16G   1% /init
none             16G  808K   16G   1% /run
none             16G     0   16G   0% /run/lock
none             16G     0   16G   0% /run/shm
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup
none             16G  100K   16G   1% /mnt/wslg/versions.txt
none             16G  100K   16G   1% /mnt/wslg/doc
C:\             922G  896G   27G  98% /mnt/c
D:\             932G  365G  568G  40% /mnt/d
E:\             1.9T  359G  1.5T  20% /mnt/e
F:\              30T  9.5T   20T  33% /mnt/f
G:\             1.9T  1.3T  628G  67% /mnt/g
snapfuse        128K  128K     0 100% /snap/bare/5
snapfuse         92M   92M     0 100% /snap/gtk-common-themes/1535
snapfuse         75M   75M     0 100% /snap/core22/1122
snapfuse         75M   75M     0 100% /snap/core22/1033
snapfuse         40M   40M     0 100% /snap/snapd/21184
snapfuse         41M   41M     0 100% /snap/snapd/20671
snapfuse        131M  131M     0 100% /snap/ubuntu-desktop-installer/1284
snapfuse        132M  132M     0 100% /snap/ubuntu-desktop-installer/1286

ncdu --exclude /mnt

ncdu 1.15.1 ~ Use the arrow keys to navigate, press ? for help                                                          --- / ------------------------------------------------------------------------------------------------------------------
    6.4 GiB [##########] /usr                                                                                        
.   2.0 GiB [###       ] /var
    1.9 GiB [###       ] /snap
  800.2 MiB [#         ] /home
.   3.7 MiB [          ] /etc
    1.8 MiB [          ]  init
. 808.0 KiB [          ] /run
.  32.0 KiB [          ] /tmp
!  16.0 KiB [          ] /lost+found
    8.0 KiB [          ] /Docker
e   4.0 KiB [          ] /srv
!   4.0 KiB [          ] /root
e   4.0 KiB [          ] /opt
e   4.0 KiB [          ] /media
e   4.0 KiB [          ] /boot
.   0.0   B [          ] /proc
.   0.0   B [          ] /sys
    0.0   B [          ] /dev
@   0.0   B [          ]  libx32
@   0.0   B [          ]  lib64
@   0.0   B [          ]  lib32
@   0.0   B [          ]  sbin
@   0.0   B [          ]  lib
@   0.0   B [          ]  bin
<   0.0   B [          ]  mnt


 Total disk usage:  11.2 GiB  Apparent size: 128.0 TiB  Items: 237495                                                   

sudo umount /mnt/c-g && ncdu tracks it down to /mnt/wslg/distro/mnt/f, whereas rclone has been running with the destination set to /mnt/f

ncdu 1.15.1 ~ Use the arrow keys to navigate, press ? for help                                                         
--- /mnt/wslg/distro/mnt -----------------------------------------------------------------------------------------------
                         /..                                                                                              
  449.8 GiB [##########] /f                                                                                             
e   4.0 KiB [          ] /wslg
e   4.0 KiB [          ] /wsl
e   4.0 KiB [          ] /g
e   4.0 KiB [          ] /e
e   4.0 KiB [          ] /d
e   4.0 KiB [          ] /c


 Total disk usage: 449.8 GiB  Apparent size: 443.6 GiB  Items: 232                                                                                                     

This also seems to be detached from the actual F:\ drive, as creating a file does not create it in F:\.

mount | grep ext4

/dev/sdc on / type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
/dev/sdc on /mnt/wslg/distro type ext4 (ro,relatime,discard,errors=remount-ro,data=ordered)
/dev/sdc on /snap type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)

I cannot seem to remount /dev/sdc as rw, and am completely unable to free up space on my C:\

Copy link

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@jujugoboom
Copy link
Author

Copy link

Diagnostic information
.wslconfig found
Detected appx version: 2.1.5.0

@OneBlue
Copy link
Collaborator

OneBlue commented Apr 22, 2024

@jujugoboom: What files were created in the Windows drive before and after the command ?

@jujugoboom
Copy link
Author

I'm currently trying to reproduce the issue, but seem to be unable to. The general use case is that I run a basic rclone ftp copy on a regular basis using the task scheduler. This invokes wsl.exe with nohup to call the script. The issue seems to have stopped on April 19th, though that also coincides with the C:\ drive running out of space. My biggest issue currently is trying to free up the C:\ drive without having to recreate my Ubuntu VHD. I have been unable to mount /mnt/wslg as anything other than read-only, and help there would be greatly appreciated

Copy link
Contributor

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@jujugoboom @OneBlue and others