on-demand mount network drive - fstab, x-systemd.automount - fail!
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
on-demand mount network drive - fstab, x-systemd.automount - fail!
setup: Ras-Pi with an ext4 USB SSD wired to router
Manjaro-KDE laptop wired to router
goal: i want to mount, on-demand, the R-Pi SSD from the laptop without using SMB/CIFS - i want the mount to activate when i enter the directory using graphical file manager (Dolphin) and have read/write access - i want to mount this way because a) i don't want/like SAMBA/Windows and b) i want to be able to play video directly from Dolphin (using VLC, etc.) without the KIO problems
i can SSH into the R-Pi fine and
Code:
sshfs root@kodi.lan:/ /home/atom/kodi
works fine, however i cannot get this working using fstab
here are just a few of this things i've tried in /etc/fstab ...
Code:
# arch wiki - https://wiki.archlinux.org/index.php/SSHFS#On_demand
# result when cd to /kodi: bash: cd: kodi: Too many levels of symbolic links
#root@kodi.lan:/ /home/atom/kodi fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# result when cd to /kodi: bash: cd: kodi: Too many levels of symbolic links
#sshfs#root@kodi.lan:/ /home/atom/kodi fuse noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# drive is not mounted - /kodi is empty
#root@kodi.lan:/ /home/atom/kodi fuse.sshfs noauto,systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# drive is not mounted - /kodi is empty
#root@kodi.lan:/ /home/atom/kodi fuse.sshfs noauto,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# drive is not mounted - /kodi is empty
#sshfs#root@kodi.lan:/ /home/atom/kodi fuse noauto,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# result when cd to /kodi: bash: cd: kodi: Too many levels of symbolic links
#root@kodi.lan:/ /home/atom/kodi fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
# result when cd to /kodi: bash: cd: kodi: Too many levels of symbolic links
#root@kodi.lan:/ /home/atom/kodi sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/user/.ssh/LibreELEC_root_id_rsa,allow_other,reconnect 0 0
the "Too many levels of symbolic links" error is erroneous i believe since there are no symlinks in play - the folder /home/atom/kodi is not a symlink and is empty
note that in /etc/fuse.conf i have uncommented "user_allow_other" since "allow_other" is sometimes used in fstab - this is something no other tutorial or the Arch wiki page i read has mentioned
adding 'x-systemd.automount' results in "Too many levels of symbolic links" when cd'ing to /home/atom/kodi (or "Could not enter folder /home/atom/kodi." in Dolphin)
if i add 'device-timeout=10' in addition to 'x-systemd.automount' there are no errors, but /home/atom/kodi is empty (which it should not be and, in fact, is not when i
I'm not sure why automount isn't working. Are you restarting the automount daemon per the arch wiki article or restart your system after modifying the fstab file?
The OS does not read the config file and even though I have a local DNS automount does not work unless I use the IP address in my fstab file.
not sure if this is a relevant question, but i don't understand what you mean when you say the OS doesn't read the config file (i assume you're referring to /.ssh/config) - if i ssh from a terminal and use kodi.lan, it works fine because that hostname is converted to its IP in the config file, though i'm guessing that the OS doesn't read it directly - maybe that's what you meant?
Hi there, not sure if this will be of help but I encountered this exact same problem on Linux Mint 20.1. The error message is very unhelpful, and I found this thread (amongst many others, all without solutions) while searching for more information about the problem.
The actual solution was hinted at here (link removed as I can't post it, but the page was on vassox dot com).
The solution was to use the command line to open an ssh connection to the destination as the root user (or use sudo) which prompts to add the host fingerprint to the cache, to which you say yes. Having done this once, like magic, the automount will work as expected.
Not sure if this is a "bug" in systemd or not, but it sure would be awfully nice if the error message was somewhat more useful!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.