WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Weird lists of mounted lxfs filesystem

Open sunjoong opened this issue 9 years ago • 5 comments

  • Your Windows build number: (Type ver at a Windows Command Prompt) Microsoft Windows [Version 10.0.15063]

  • What's wrong / what should be happening instead:

This might be a normal and expected lists;

root@SUNJOONG-DESKTOP:~# mount -t lxfs
rootfs on / type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
root@SUNJOONG-DESKTOP:~#

Make some directories and then...

root@SUNJOONG-DESKTOP:~# mkdir cache data home mnt root rootfs
root@SUNJOONG-DESKTOP:~# mount -t lxfs
/root/rootfs on / type lxfs (rw,noatime)
/root/data on /data type lxfs (rw,noatime)
/root/cache on /cache type lxfs (rw,noatime)
/root/mnt on /mnt type lxfs (rw,noatime)
/root/root on /root type lxfs (rw,noatime)
/root/home on /home type lxfs (rw,noatime)
root@SUNJOONG-DESKTOP:~#

I had thought rootfs, data, cache, mnt, root and home as labels but they seem not.

sunjoong avatar Jun 01 '17 00:06 sunjoong

Wow, that is absolutely bizarre. It happens if and only if one of those directories exists in the pwd.

It even happens like this:

$ pwd
/home/fpqc
$ mount -t lxfs
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
$ mkdir data
$ mount -t lxfs
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
/home/fpqc/data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
$ rm -rf data
$ mount -t lxfs
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)

There doesn't seem to be any negative effect from it per se, but it's spooky.

Also, if you do like cd /some/other/dir, those mounts will go back to normal unless there is a directory in the pwd with the name of one of them.

fpqc avatar Jun 01 '17 01:06 fpqc

@fpqc - Yeah, we don't have mount lxfs manually yet so no negative effects :).

sunjoong avatar Jun 01 '17 11:06 sunjoong

Adding @SvenGroot as FYI.

sunilmut avatar Jun 06 '17 23:06 sunilmut

The "mount" command is interpreting those labels as paths because we don't return the "nodev" option in /proc/self/mouninfo. Since they don't start with a /, they're treated as relative paths and resolved to an absolute path if they happen to exist. This is all done by the "mount" binary, not by WSL.

It's entirely harmless, but we'll consider whether we can add the "nodev" option to prevent this behavior.

SvenGroot avatar Jun 07 '17 00:06 SvenGroot

This is all done by the "mount" binary, not by WSL.

It's entirely harmless, but we'll consider whether we can add the "nodev" option to prevent this behavior.

Thanks @SvenGroot and @sunilmut. I see.

Hmm... It could be better to save issue tickets... I'll close this.

sunjoong avatar Jun 07 '17 00:06 sunjoong