Mounting sshfs via fstab cannot find mount helper
Trying to mount an sshfs with type sshfs
fails with unknown filesystem type 'sshfs'
because mount
does not look for mount.sshfs
in /usr/sbin
:
# strace -f -e file,process -s512 mount /mnt
execve("/bin/mount", ["mount", "/mnt"], 0x7ffc338ba8a8 /* 22 vars */) = 0
open("/etc/ld-musl-x86_64.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libmount.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libblkid.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
stat("/etc/fstab", {st_mode=S_IFREG|0644, st_size=1728, ...}) = 0
open("/etc/fstab", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
readlink("asdf@asdf:", 0x7ffc3557561f, 4096) = -1 ENOENT (No such file or directory)
readlink("/mnt", 0x7ffc3557556f, 4096) = -1 EINVAL (Invalid argument)
stat("/sbin/mount.sshfs", 0x7ffc35575550) = -1 ENOENT (No such file or directory)
stat("/sbin/fs.d/mount.sshfs", 0x7ffc35575550) = -1 ENOENT (No such file or directory)
stat("/sbin/fs/mount.sshfs", 0x7ffc35575550) = -1 ENOENT (No such file or directory)
stat("/run", {st_mode=S_IFDIR|0755, st_size=660, ...}) = 0
lstat("/run/mount/utab", {st_mode=S_IFREG|0644, st_size=770, ...}) = 0
faccessat2(AT_FDCWD, "/run/mount/utab", R_OK|W_OK, AT_EACCESS) = 0
mount("asdf@asdf:", "/mnt", "sshfs", 0, "reconnect,idmap=user,transform_symlinks,identityfile=/etc/ssh.key,allow_other,default_permissions,uid=0,gid=0") = -1 ENODEV (No such device)
mount: /mnt: unknown filesystem type 'sshfs'.
exit_group(32) = ?
+++ exited with 32 +++
Using fuse.sshfs
, the error is different, but also likely caused by, in this case, the fuse kernel module not finding the mount.fuse.sshfs
helper (not visible in strace since that'd happen in the kernel of course).
mount: /mnt: wrong fs type, bad option, bad superblock on sshfs#asdf@asdf:, missing codepage or helper program, or other error.
Symlinking the mount helper in /sbin
makes mounting via fstab possible.
This may also affect the fuse3
, davfs2
, mtd-utils-ubi
and unionfs-fuse
packages since those also have their mount helpers in /usr/sbin
. I have not tried any of those.
Alpine version: 3.14