You are not logged in.

#1 2012-11-15 15:36:17

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

[SOLVED] Systemd and Sshfs Automount

Hi,

I'm trying to set up automount on an sshfs drive. From other posts I already concluded this line for my /etc/fstab:

schnitzl@prokyon.math.rwth-aachen.de:/users/schnitzl /home/ben/data/mnt/uni/  fuse.sshfs noauto,x-systemd.automount,users,idmap=user,IdentityFile=/home/ben/.ssh/id_rsa,allow_other,reconnect 0 0

But yet it does not work. Whilst logging into the remote Host from command line is no problem:

ssh schnitzl@prokyon.math.rwth-aachen.de,

automounting fails:

-- cd uni/
bash: cd: uni/: No such device.

journalctl -b | grep uni tells me:

Nov 15 16:31:31 mario systemd[1]: Mounting /home/ben/data/mnt/uni...
Nov 15 16:31:31 mario systemd[1]: Mounted /home/ben/data/mnt/uni.
Nov 15 16:31:31 mario systemd[1]: home-ben-data-mnt-uni.mount mount process exited, code=exited status=1
Nov 15 16:31:31 mario systemd[1]: Unit home-ben-data-mnt-uni.mount entered failed state. 

Any Ideas?

Benjamin

Edit: Which services do I have to restart, in order to let systemd reload the /etc/fstab configuartion?

Last edited by Lord Bo (2012-11-15 17:06:55)

Offline

#2 2012-11-15 16:36:03

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Systemd and Sshfs Automount

You need to add the mount option _netdev - otherwhise it tries to mount it before the network is available.

EDIT: sorry, I oversaw the noauto. So you want on-demand, right? https://bbs.archlinux.org/viewtopic.php?id=146674

Last edited by teekay (2012-11-15 16:46:38)

Offline

#3 2012-11-15 16:48:16

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: [SOLVED] Systemd and Sshfs Automount

Thank you very much! That was the right option! I already had it there, but as it did not work yet, I altered the line and forgot to add this option... . However: one last thing: Which services do I have to restart, after having altered /etc/fstab in order to take changes into effect? It is a bit annoying always having to restart the whole system.

Edit:

teekay wrote:

EDIT: sorry, I oversaw the noauto. So you want on-demand, right? https://bbs.archlinux.org/viewtopic.php?id=146674

Well it is now mounted on demand (as soon, as I try to access the directory).
And the link you provided: I already found that during my researches, but the crucial point was, as you mentioned, the missing _netdev option. However: Thanks again smile .

Last edited by Lord Bo (2012-11-15 16:54:52)

Offline

#4 2012-11-15 16:59:06

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Systemd and Sshfs Automount

(Forget my EDIT above, _netdev is needed also for noauto ondemand mounting)

Check that you do not have any stale .automount links in /etc/systemd/system/remote-fs.target.wants
and run:

systemctl --system daemon-reload

Offline

#5 2012-11-15 17:06:37

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: [SOLVED] Systemd and Sshfs Automount

teekay wrote:

Check that you do not have any stale .automount links in /etc/systemd/system/remote-fs.target.wants
and run:
systemctl --system daemon-reload

That works great! Thank you for your great help smile !

Offline

#6 2012-11-15 17:49:27

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED] Systemd and Sshfs Automount

Great it worked. I updated the wiki a bit: https://wiki.archlinux.org/index.php/Sshfs#Automounting (still quite messy, though)

Offline

#7 2012-11-15 18:16:37

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: [SOLVED] Systemd and Sshfs Automount

teekay wrote:

I updated the wiki a bit: https://wiki.archlinux.org/index.php/Sshfs#Automounting (still quite messy, though)

Very good Idea indeed!

Offline

Board footer

Powered by FluxBB