Solved davfs in fstab: Invalid fstype

I am trying to mount a webdav at boot using fstab, I read a couple articles and I must miss something obvious...

I have installed fusefs-davfs2 and I got fusefs_load="YES" in my /boot/loader.conf (not sure it is needed, at least it is not when I manually mount).

I have added this line to my /etc/fstab:
https://webdav.mydomain /mnt/webdav davfs rw,user,uid=myusername,noauto 0 0

I am using noauto to avoid dropping into root shell during boot as I have an error I am not able to solved, it can be reproduce doing a manual : doas mount /mnt/webdav :
mount: https:/webdav.mydomain: Invalid fstype: Invalid argument

Mounting manually is working : doas mount.davfs https://webdav.mydomain /mnt/webdav

Any idea?
Many thanks
 
Maybe give this fsfab option a chance, also late option may work too, idk.

From mount(8):
Code:
mountprog=<program>
         Force mount touse thespecified program to mount the
         file system, instead of calling nmount(2) directly.
         For example:

         mount -tfoofs -o mountprog=/mydir/fooprog /dev/cd0 /mnt
 
Rename is just for testing. If it works, the port should be fixed up. But yes, as a temp fix a symlink/hard link would do just fine.
 
I think you need tabs (rather than spaces) between the columns, and no commas, except under the Options column:
Code:
% cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
/dev/nda0p3             none    swap    sw              0       0
proc                    /proc           procfs  rw              0       0

extra tabs between columns seem to be OK for some reason.
 
I must miss something obvious...
This is not documented in the FreeBSD manuals or the 3rd party application documentation: To mount 3rd party file systems (file systems not supported by default on FreeBSD), their mount program must be specified in the mount(8) command line or in fstab(5).

Unlike on Linux, "davfs" alone is not a valid FreeBSD fstab(5) FStype entry. There is no logic for mount(8) (which is invoked when fstab is read during boot) to process a unsupported by default, specific file system type. It is necessary to specify the 3rd party file system mount program.
Rich (BB code):
# Device                  Mountpoint   FStype  Options        Dump    Pass#

https://webdav.mydomain   /mnt/webdav  davfs   mountprog=/usr/local/sbin/mount.davfs,rw,user,uid=myusername,noauto 0 0
Important is the "mountprog=" option. OTOH, "FStype" can be a arbitrary name (try "foofs").

mount -t foofs -o mountprog=/usr/local/sbin/mount.davfs,rw https://webdav.mydomain /mnt/webdav

EDIT: For mount(8) command line operations with "mountprog" the "-t" option can be omitted entirely:

mount -o mountprog=/usr/local/sbin/mount.davfs,rw https://webdav.mydomain /mnt/webdav
 
First of all thanks for all the suggestions !

T-Daemon you made my day !! Your suggestion works perfectly that's perfect, many thanks again, and hope that this will be useful for anyone who'd make a research in the future
 
I just upgraded my system to 15.0-RELEASE and when I try to mount with the exact same command working for months on 14.3 I got a segfault if I do mount /mnt/webdav which us using /etc/fstab (https://webdavaddress /mnt/webdav davfs mountprog=/usr/local/sbin/mount.davfs,rw,user,uid=blt,late,noauto 0 0) but working well if I manually do a mount.davfs https://webdavaddress /mnt/webdav if anyone has a suggestion more than happy to test
 
I assume all packages have been force upgraded to the ABI change from "FreeBSD:14:amd64" to "FreeBSD:15:amd64", right?
Yes it is correct
Does it also segfault when
It does not with your suggestion.
If I do mount.davfs https://webdavaddress /mnt/webdav or mount -o mountprog=/usr/local/sbin/mount.davfs,rw https://webdav.mydomain /mnt/webdav it works.

Would you suggest to change how I put the command in fstab (https://webdavaddress /mnt/webdav davfs mountprog=/usr/local/sbin/mount.davfs,rw,user,uid=blt,late,noauto 0 0) ?
 
Yes it is correct

It does not with your suggestion.
If I do mount.davfs https://webdavaddress /mnt/webdav or mount -o mountprog=/usr/local/sbin/mount.davfs,rw https://webdav.mydomain /mnt/webdav it works.

Would you suggest to change how I put the command in fstab (https://webdavaddress /mnt/webdav davfs mountprog=/usr/local/sbin/mount.davfs,rw,user,uid=blt,late,noauto 0 0) ?
Check /var/log/messages for fstab(5) error messages first, maybe there is a clue.
 
pid 53957 (mount.davfs), jid 0, uid 0: exited on signal 11 (no core dump - sugid process denied by kern.sugid_coredump)

So I activated sysctl kern.sugid_coredump=1 and I have now kernel: pid 97661 (mount.davfs), jid 0, uid 0: exited on signal 11 (core dumped) in /var/log/message and a 15M mount.davfs.core.

How can I make a use of it or extract interesting information ?

Many thanks
 
I use rclone compiled from git not from ports.

Code:
$ ~/git/rclone/./rclone lsd drive:/
          -1 2025-02-28 14:24:23        -1 .Trash-1000
          -1 2024-03-25 23:21:23        -1 Documents
          -1 2025-11-23 07:50:41        -1 Drive Mail

$ set ALL_PROXY socks5h://localhost:12000 | ~/git/rclone/./rclone cmount drive:/ /mnt/drive --vfs-cache-mode writes --daemon -vv
2025/12/12 10:52:14 DEBUG : rclone: Version "v1.73.0-DEV" starting with parameters ["/home/freezr/git/rclone/./rclone" "cmount" "drive:/" "/mnt/drive" "--vfs-cache-mode" "writes" "--daemon" "-vv"]
2025/12/12 10:52:14 DEBUG : Creating backend with remote "drive:/"
2025/12/12 10:52:14 DEBUG : Using config file from "/home/freezr/.config/rclone/rclone.conf"
2025/12/12 10:52:14 DEBUG : found headers: 
2025/12/12 10:52:14 DEBUG : fs cache: renaming cache item "drive:/" to be canonical "drive:"
2025/12/12 10:52:19 DEBUG : rclone: Version "v1.73.0-DEV" finishing with parameters ["/home/freezr/git/rclone/rclone" "cmount" "drive:/" "/mnt/drive" "--vfs-cache-mode" "writes" "--daemon" "-vv"]

$ ls /mnt/drive/
Documents/
Drive Mail/
 
lldb -c /path/to/mount.davfs.core `which mount.davfs` should get you into a debugger, and then thread backtrace all to dump out stack traces.
 
thanks atax1a , I tried hopefully this can be useful for T-Daemon :

* thread #1, name = 'mount.davfs', stop reason = signal SIGSEGV
* frame #0: 0x00000008264728fd libc.so.7`___lldb_unnamed_symbol5697 + 61
frame #1: 0x000000082646996d libc.so.7`___lldb_unnamed_symbol5678 + 125
frame #2: 0x00000000002144fb mount.davfs`___lldb_unnamed_symbol513 + 1051
frame #3: 0x00000000002164c2 mount.davfs`___lldb_unnamed_symbol515 + 7538
frame #4: 0x000000082637737f libc.so.7`__libc_start1 + 303
frame #5: 0x000000000020a8f4 mount.davfs`___lldb_unnamed_symbol434 + 36
 
It's probably linked to the libraries from 14.3. You need to recompile (which is one of the reasons you should use the port/package) after a major version upgrade.
 
Thanks SirDice , I don't recall having installed it from source, I just checked and I got it from pkg :

pkg info | grep fusefs-davfs2
fusefs-davfs2-1.7.2 FUSE filesystem to access WebDAV servers

Would it be worth trying to remove / re-installing it ?
 
I have a hint... if I do a doas mount.davfs https://webdavaddress /mnt/webdav it works but it is mounted under root:wheel.
if I try to mount without doas, obviously I got this error : program is not setuid root, which I think makes sense.
That's this combination which make the seffault : doas mount.davfs https://webdavaddress /mnt/webdav -o uid=myusername (what was used/working in 14.3 in fstab)
 
Thanks, I didn't know, now I know :)

Code:
fusefs-davfs2-1.7.2:
    FreeBSD_version: 1500068
    build_timestamp: 2025-12-06T14:39:07+0000
    built_by       : poudriere-git-3.4.4-7-gd0e6e138
    port_checkout_unclean: no
    port_git_hash  : e3fa556c9a509b3bc0e615815d8368b663c95dc3
    ports_top_checkout_unclean: no
    ports_top_git_hash: a5736339d01a59fcbee9a4225e63418e34132655
    repo_type      : binary
    repository     : FreeBSD
 
Back
Top