4

What I am trying to do?

making the https://dav.example.com/ automount on startup and without asking user credentials.

what steps I've undertaken?
I followed official archlinux wiki to setup my davs
steps:

  • installed davfs2
  • added myself to group "network":
    usermod -a -G network myusername

  • added webdav server to /etc/fstab:

https://webdav.example.com /home/username/webdav davfs user,noauto,uid=username,file_mode=600,dir_mode=700 0 1

  • created secret file in my /home/username/ and added credentials:
    mkdir ~/.davfs2/
    echo "https://webdav.example.com webdavuser webdavpassword" >> ~/.davfs2/secrets
    chmod 0600 ~/.davfs2/secrets
  • mounted my dav
    mount ~/MyDav

what happens?
When restart my pc and when startup has been completed I open nautilus but webdav server is not mounted. I have to mount it manually from the terminal on each restart. This is normal because I set noauto in fstab line. However, If I set auto instead, it will mount but fail in the process and return error on boot because mounting require internet connection therefore return error "failed mounting". So both auto and noauto have the same results for me.
What I need now is to make webdav server automount when internet connection has been established.
some suggested using _netdev on fstab line. I did, but no change.
Maybe worthmentioning that when I run mount ~/MyWebDav from the terminal it mount without asking credintials, but when run mount -a it ask for credintials and mount if they are correct.

I need to make the webdav server https://dav.example/ automount on startup only when internet connection has been occurred.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Stephan rog
  • 71
  • 2
  • 8
  • You said you tried the `_netdev` option, can you post exactly what you tried? – fooot Dec 20 '16 at 15:53
  • nevermind friend. I just fixed it somehow. I enabled `NetworkManager-wait-online.service` , and set `noauto` to the fstab line... this solution for who search google and find this question. also do not forget to copy secrets file from /etc/davfs2/secrets to ~/.davfs2/secrets...and not just creating it instead because it won't work. and insert you keys in the copied file. – Stephan rog Dec 20 '16 at 20:03
  • also do not forget to make group `davfs2` and add yourself to it, reboot pc, and should work. also I followed this guide https://doc.owncloud.org/server/latest/user_manual/files/access_webdav.html – Stephan rog Dec 20 '16 at 20:09
  • 1
    Glad you got it worked out, feel free to post your solution as an answer. – fooot Dec 20 '16 at 20:13
  • @Stephanrog As fooot says, please consider posting an explanation of your solution as an answer to your own question (and accept it as a correct answer) as users might not read the comments – tim-oh May 17 '20 at 21:07

0 Answers0