WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Cannot create a directory that does not exist

Open aliaugmenta opened this issue 4 years ago • 6 comments

Version

Microsoft Windows [Version 10.0.19043.2006]

WSL Version

  • [X] WSL 2
  • [ ] WSL 1

Kernel Version

5.10.102.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

I have not been able to find what exact steps caused the issue, but I had some files and directories created in docker (wsl) on a bind mounted directory and then removed them in windows powershell.

Expected Behavior

If a directory cannot be seem by dir it should not exist!

Actual Behavior

mkdir fails with an error that says "File exists" but neither dir in wsl shows the directory nor the directory can be seen in Windows File Explorer.

Diagnostic Logs

No response

aliaugmenta avatar Sep 28 '22 14:09 aliaugmenta

Try unmounting the dir:

$ unmount -f /path/to/dir

-f Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.)

tusharsnx avatar Sep 29 '22 08:09 tusharsnx

A restart fixed the problem. But, I still think this is a bug.

aliaugmenta avatar Sep 29 '22 15:09 aliaugmenta

Can you provide concise repro steps? Or else this issue should be marked as solved.

tusharsnx avatar Sep 29 '22 16:09 tusharsnx

Unfortunately, I can't. If you let me know what diagnostic information I can provide, I'll do it next time if it happens again.

aliaugmenta avatar Sep 29 '22 21:09 aliaugmenta

Yep, seeing this exact thing right now.

ls -lh .
ls: cannot access 'dir': No such file or directory
total 0
d????????? ? ?         ?        ?            ? dir

After deleting it from windows:

mkdir dir
mkdir: cannot create directory ‘dir’: File exists
rm -r dir
rm: cannot remove 'dir': No such file or directory

rohan-shah-nearmap avatar Apr 18 '23 04:04 rohan-shah-nearmap

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

Thank you!