跳到主要内容
AnyStorage
免费下载

rclone

rclone mount 的 FUSE 错误:三系统逐一处理

找不到 fusermount3、cgofuse cannot find winfsp、mount point in use、没装 macFUSE。每个错误的真实原因,以及它们共同的驱动要求。

rclone mount 在各平台会抛出的四个 FUSE 错误、rclone 官方文档要求的前置条件,以及为什么走本地 WebDAV 根本不需要驱动。

rclone mount fuse 错误,fusermount3 找不到,cgofuse cannot find winfsp

四个错误,同一个前提

rclone mount 其实不是 rclone 的功能,而是 rclone 驱动的文件系统驱动的功能。下面每个错误都是那一层在拒绝合作。这是你真正会遇到的四个,按被报告时的原样引用。

text

Fatal error: failed to mount FUSE fs: fusermount: exec: "fusermount3": executable file not found in $PATH

text

panic: cgofuse: cannot find winfsp

text

Cannot create WinFsp-FUSE file system: mount point in use.
Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed

text

NOTICE: mount helper error: fusermount3: mount failed: Permission denied
CRITICAL: Fatal error: failed to mount FUSE fs: fusermount: exit status 1
错误、平台、原因与处理
错误平台原因处理
fusermount3 ... not found in $PATHLinux没装 FUSE 3 用户态工具安装 fuse3
mount helper error: fusermount3: mount failed: Permission deniedLinux较新 Ubuntu 的 AppArmor 限制sudo aa-disable /usr/bin/fusermount3
cgofuse: cannot find winfspWindows没装 WinFsp安装 WinFsp
mount point in useWindows目标文件夹已存在删掉它,或换一个空闲盘符
没有 /dev/fuse,或什么都没挂上macOS缺 macFUSE 或 FUSE-T装一个,并批准扩展
挂上了,但写入时卡住或报错全平台VFS 缓存模式不足以应付这种用法--vfs-cache-mode writesfull

Linux:先装工具,再看 AppArmor

第一个错误就是字面意思。rclone 会去调用 FUSE 的挂载助手,在 FUSE 3 的系统上那个可执行文件叫 fusermount3。精简容器和一体机发行版常常缺它,缺了的话 rclone 这边配什么都没意义。

sh

which fusermount fusermount3
sudo apt install fuse3        # Debian, Ubuntu
sudo dnf install fuse3        # Fedora, RHEL

第二个是较新的症状,rclone 的挂载文档自己点名了它:「On newer versions of Ubuntu, you may encounter the following error when running rclone mount」——紧跟的就是上面那段 mount helper error。文档给出的原因是 AppArmor:「This may be due to newer Apparmor restrictions, which can be disabled with sudo aa-disable /usr/bin/fusermount3 (you may need to sudo apt install apparmor-utils beforehand).」

卸载用的是同一个助手,这点值得记住,因为一个半死的挂载点会在下次给你更莫名的错误:

sh

fusermount -u /path/to/local/mount
fusermount3 -u /path/to/local/mount

Windows:WinFsp 不是可选项

rclone 的文档毫不含糊:「To run rclone mount on Windows, you will need to download and install WinFsp. WinFsp is an open-source Windows File System Proxy which makes it easy to write user space file systems for Windows. It provides a FUSE emulation layer which rclone uses in combination with cgofuse.」

没装它,你拿到的就是 panic: cgofuse: cannot find winfsp 这段堆栈——之所以是 panic 而不是一句客气的提示,是因为 FUSE 层连初始化都做不到。WinFsp 自我介绍为「system software that provides runtime and development support for custom file systems on Windows computers」,并说明它相当于 UNIX 系上的 FUSE。装好,必要时重启,再试。

Windows 侧的第二个错误性质不同。Cannot create WinFsp-FUSE file system: mount point in use. 通常意味着你指定的文件夹已经存在。报告者自己两分钟就解决了:「All I have to do is make sure that the mount folder does not exist. I already created the folder hence the error.」用一个真正空闲的盘符同样有效:

powershell

rclone mount remote: X: --vfs-cache-mode writes
rclone mount remote: C:\path\parent\mount --vfs-cache-mode writes

macOS:两个驱动,选一个

在 macOS 上 rclone 给出三个选项,并把取舍写得很准确:「Mounting on macOS can be done either via built-in NFS server, macFUSE (also known as osxfuse) or FUSE-T. macFUSE is a traditional FUSE driver utilizing a macOS kernel extension (kext). FUSE-T is an alternative FUSE system which 'mounts' via an NFSv4 local server.」

这一句基本就能决定选谁。macFUSE 意味着内核扩展,在当前 macOS 上意味着要在系统设置里批准,而且通常要重启。FUSE-T 避开了这件事:项目页自称「Kext-less design with no kernel extension required」,改为通过一个本地服务挂载,后端可选 NFS、SMB 与原生 FSKit。

两者都有边角情况,rclone 也列了出来。用 FUSE-T 时,按项目 wiki 的说法「File access and modification times cannot be set separately as it seems to be an issue with the NFS client which always modifies both」——也就是说 Finder 浏览一下挂载点就可能改掉修改时间,进而让 rclone 重新上传整个文件。另外在 --read-only 下写入会「fail silently as opposed to with a clear warning as in macFUSE」。

如果你是用 MacPorts 而不是 dmg 安装 macFUSE,rclone 文档给了让它找到库的额外步骤:

sh

sudo mkdir /usr/local/lib
cd /usr/local/lib
sudo ln -s /opt/local/lib/libfuse.2.dylib

挂上了但行为不对时

驱动到位之后,剩下的抱怨基本都是 VFS 缓存。rclone 文档化了四种模式,差别并不细微。--vfs-cache-mode off 会「read directly from the remote and write directly to the remote without caching anything on disk」;minimal「very similar to 'off' except that files opened for read AND write will be buffered to disk」;writes 下「files opened for read only are still read directly from the remote, write only and read/write files are buffered to disk first」;full 则是「all reads and writes are buffered to and from disk」。

会以读写方式打开文件、往回 seek、原地改名的应用——也就是大部分桌面软件——至少需要 writes。剩下的问题用 full 能解决,代价是磁盘。

把驱动整个去掉的设计

这一页上的每个错误都来自同一个架构选择:把文件系统驱动放进内核。拿到一个驱动器其实还有另一条路,而且在这三个系统上都比 FUSE 更久——WebDAV,三家都能不装任何东西就挂载。

AnyStorage(v0.2.24;macOS 11+、Windows 10+、Ubuntu 20.04+)走的就是这条路。它在 http://127.0.0.1:3211 上运行内置 WebDAV 服务,应用里打开的每个连接——支持 path-style 与自定义区域的 S3 兼容端点、Cloudflare R2、MinIO、Backblaze B2、密钥认证的 SFTP、WebDAV——都作为该根下的一个文件夹出现。没有 FUSE、没有 WinFsp、没有 macFUSE,没有要批准的内核扩展,也不需要 $PATH 里有 fusermount3。免费版可用两个连接。

老实说也有代价:系统自带的 WebDAV 客户端各有上限,Windows 重定向器就有文档化的 50,000,000 字节默认文件大小限制(见50 MB 限制)。但那是一个注册表值,而不是一次驱动安装——这正是这场对比的要点。

WinFsp 和 rclone 的 cmount 都要装吗?

不用。装好 WinFsp,rclone 会通过 cgofuse 自动使用它。Windows 侧除了选一个尚不存在的挂载点,没有别的要配。

rclone 用 FUSE-T 还是 macFUSE 更好?

macFUSE 是带内核扩展的传统驱动,FUSE-T 免 kext、通过本地 NFSv4 服务挂载。如果你不能或不愿批准内核扩展,选 FUSE-T;如果你需要精确的修改时间语义和明确的只读报错,选 macFUSE。

为什么只有在 Docker 里 rclone mount 会失败?

容器通常缺 /dev/fuse 和必要的 capability。你需要把设备透传进去、给 SYS_ADMIN,并在镜像里装 fuse3——这也正是很多人干脆改成从容器里对外提供 WebDAV 的原因。

如果完全装不了驱动,用什么替代挂载?

rclone serve webdav 或任意本地 WebDAV 服务,然后用系统客户端挂载它。这和 AnyStorage 的取舍一样,只是零件更多。

下一步