I am trying to mount a webdav server in /etc/fstab with davfs, but when i try open this in my file manager (Thunar) i will get the error:
Failed to mount "My Folder"
/sbin/mount.davfs: different URL in /etc/fstab
The entry in /etc/fstab looks like this:
http://<server_url>/my/path/Doe\054\040John/ /home/john/My\040Folder davfs user,noauto 0 0
But i am still able to mount it successfully with:
sudo mount -t davfs http://<server-url>/my/path/Doe,\ John/ /home/john/My\ Folder
Any ideas what am i doing wrong in /etc/fstab?
Thanks for your help!
TL;DR aka the fun part:
In the
/etc/fstab
file, you should NOT escape the comma character while spaces and tabs must be escaped using zero-padded octal numbers preceded by backslash\
as it stated in fstab's man page. In your case, the URL string should look like this:The boring part:
First of all, you should take a look at this one: https://superuser.com/a/527503/938480
I'll cite the last sentence of the post above here which is essential for the answer in my opinion:
And the davfs2 man states:
And finally let's look at the fstab manual itself:
As we can see above, there is actually no mentioning of anything but spaces and tabs.
I've tested the issue with one of the free online Nextcloud instances (Nextcloud natively comes with a built-in WevDAV support) and I got the same error using the same folder name as in your example
Doe, John
and the same escaping sequence\054\040
. Then I removed escaping of the comma and it mounted ok.Too few information to give a hint on whats going wrong here but after installing davfs2 my fstab entry:
works very well... just after changing the content of the fstab you can check if it is working by entering
or by entering
but keep in mind - the fodler has to exist before mount can be initilaized...