mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
268 stars 145 forks source link

mounted drives in /media or /home/<user> appears twice in Caja (and MATE desktop) #742

Open kyrios123 opened 7 years ago

kyrios123 commented 7 years ago

When I mount shares in /media or in /home/user, the mounted share appears twice in caja (and on the MATE desktop). If I disable the "Mounted Volumes" in MATE Tweak, nothing at all appears on the MATE desktop, but still I see the mounted volumes twice in Caja.

image

It seems the drive is mounted twice... once as autofs and another time as fuse.ssh :

py@solus-laptop ~ $ mount | grep py-nas
systemd-1 on /home/py/py-nas type autofs (rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
py@192.168.1.31:/home on /home/py/py-nas type fuse.sshfs (rw,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,default_permissions,allow_other)

However I added it only once in /etc/fstab :

py@192.168.1.31:/home /home/py/py-nas fuse.sshfs noauto,x-systemd.automount,_netdev,noatime,user,nonempty,idmap=user,uid=1000,gid=1000,identityfile=/home/py/.ssh/id_rsa,allow_other,default_permissions,reconnect 0 0

I added this entry in the fstab file based on the "On demand" example of the SSHFS page of the ArchWiki.

PS: When I plug a USB stick, the icon appears only once.

FYI: this behavior occurs on Solus MATE edition. They advised me to report the problem here:

This is specifically because you have systemd doing the on-demand bit. With it set up like this, systemd is mounting a "fake" filesystem first and then when you try to access it, it mounts the actual file system if it isn't already mounted.

This is pretty common for autofs, but I guess Caja must be oblivious to it. I'm not seeing anything that we can do to fix this, but I encourage you to report this to the MATE devs

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42362671-mounted-drives-in-media-or-home-user-appears-twice-in-caja-and-mate-desktop?utm_campaign=plugin&utm_content=tracker%2F651521&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F651521&utm_medium=issues&utm_source=github).
raveit65 commented 7 years ago

It seems the drive is mounted twice... once as autofs and another time as fuse.ssh :

than 'systemctl stop autofs.service' should stop it. Is this service enabled? The config files are /etc/autofs.master and /etc/autofs.*

FYI: this behavior occurs on Solus MATE edition. They advised me to report the problem here:

Link to downstream report please. Why should this a upstream problem if you mounted it twice with autofs and fstab?

kyrios123 commented 7 years ago

Link to the downstream report was on the "advised" word : https://dev.solus-project.com/T2658#47090

The thing is that I don't know why it is mounted twice; it is only specified once in /etc/fstab and the type is sshfs.fuse and not autofs. If I update /etc/fstab to mount the drive anywhere else (i.e.: in /mnt) with the same command it doesn't appears two times in Caja.

In case it can help, here are the auto* files from /etc: auto.zip

ikeydoherty commented 7 years ago

Is there an autofs entry for sshfs?

kyrios123 commented 7 years ago

@ikeydoherty no, there isn't any!

ikeydoherty commented 7 years ago

OK I only asked... :) Does the problem only persist when you have autofs installed? Looks like it could be a borky autofs package.

With both of them "mounted", please paste your /proc/self/mounts here. Thanks.

kyrios123 commented 7 years ago

Here it is: sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,noexec,relatime 0 0 devtmpfs /dev devtmpfs rw,nosuid,size=8065596k,nr_inodes=2016399,mode=755 0 0 securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 tmpfs /dev/shm tmpfs rw 0 0 devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0 cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 cgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0 cgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0 cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 cgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0 cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 cgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0 cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 /dev/nvme0n1p4 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0 systemd-1 /mnt/nas/public autofs rw,relatime,fd=20,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 tmpfs /tmp tmpfs rw 0 0 hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0 debugfs /sys/kernel/debug debugfs rw,relatime 0 0 mqueue /dev/mqueue mqueue rw,relatime 0 0 /dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0 /dev/nvme0n1p5 /home ext4 rw,noatime,data=ordered 0 0 systemd-1 /home/py/py-nas autofs rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 tracefs /sys/kernel/debug/tracing tracefs rw,relatime 0 0 fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=1622076k,mode=700,uid=1000,gid=1000 0 0 gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 py@192.168.1.31:/home /home/py/py-nas fuse.sshfs rw,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,default_permissions,allow_other 0 0 nas@192.168.1.31:/Public /mnt/nas/public fuse.sshfs rw,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0

ikeydoherty commented 7 years ago

I see 3 mounts there unless I'm mistaken..

kyrios123 commented 7 years ago

There are "only" two. There is another sshfs mount point for a different share (/mnt/nas/public).

cat mounts | grep py-nas systemd-1 /home/py/py-nas autofs rw,relatime,fd=32,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 py@192.168.1.31:/home /home/py/py-nas fuse.sshfs rw,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,default_permissions,allow_other 0 0

kyrios123 commented 7 years ago

I also tried to stop the autofs service as advised by @raveit65 but it's not running

root@solus-laptop /proc/self # systemctl stop autofs.service Failed to stop autofs.service: Unit autofs.service not loaded.

kyrios123 commented 7 years ago

I made a test on a Linux Mint MATE 18.1 VM -> same problem. I have the feeling it occurs only with fuse.sshfs filesystems

image

lukefromdc commented 7 years ago

I've never used shares, but can confirm that ordinary flash drives and encrypted (LUKS) flash drives and internal drives appear only once. EDIT: at least in Debian Unstable and with any version of Caja built with GTK3

L3P3 commented 7 years ago

I have the same problem using caja 1.16.2.

My fstab entry is: root@domain.com:/media/x /media/x fuse.sshfs noauto,x-systemd.automount,_netdev,users,allow_other,reconnect 0 0

mount command gives me: systemd-1 on /media/x type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9573) root@domain.com:/media/x on /media/x type fuse.sshfs (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,allow_other,_netdev)

(domain.com is a placeholder here!)

I think the problem here is just that caja displays actual mounts. It should display every mount directory once.

L3P3 commented 2 years ago

I agree, caja should not list automount entries if the actual mount is present! I still have that issue, 5 years later!

wxgeo commented 2 years ago

Same issue for me, but I use nautilus and gnome-shell. So, this is not specific to mate nor caja.

systemd-1 /media/nicolas/serveur autofs rw,relatime,fd=50,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3045 0 0
famille@192.168.1.21:/media/storage /media/nicolas/serveur fuse.sshfs rw,nosuid,nodev,noexec,noatime,user_id=0,group_id=0,allow_other 0 0
lukefromdc commented 2 years ago

Wondering if this is a GVFS issue?