使用 io_uring 高性能异步优化Rclone云盘挂载

通过编写一个 Systemd 用户服务 (User Service) 或 系统服务 (System Service) 来实现开机自动挂载。 由于云盘挂载深度依赖网络以及当前登录用户的权限,最稳妥、优雅的做法是配置为 Systemd 用户服务。这样它会自动在网络就绪以及你的用户登录时启动,且挂载的文件夹直接拥有当前用户的读写权限。 以下是完整的配置步骤: 1. 确认系统 fuse 权限(前置准备) 为了让 Rclone 服务在后台运行时允许其他应用访问(避免权限冲突),我们需要先开启系统的 allow_other 选项: sudo sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf 2. 创建 Systemd 服务文件 在终端中执行以下命令,直接创建并编辑属于你当前用户的 Systemd 配置文件夹和文件: mkdir -p ~/.config/systemd/user/ nano ~/.config/systemd/user/rclone-mount.service 将以下配置内容复制并粘贴进去(注意修改两处占位符): [Unit] Description=Rclone cmount with io_uring for Omarchy 4.02 Documentation=https://rclone.org After=network-online.target Wants=network-online.target [Service] Type=simple # 注意:请将下面的 your-remote-name: 替换为你在 rclone config 中配置的名称 # 注意:请将 /home/你的用户名/OneDrive 替换为你本地真实的空挂载点绝对路径 ExecStart=/usr/bin/rclone cmount your-remote-name: %h/OneDrive \ --vfs-cache-mode full \ --vfs-cache-max-age 24h \ --vfs-cache-max-size 50G \ --fuse-flag io_uring=on \ --fuse-flag max_read=131072 \ --allow-other \ --log-file=%h/.config/rclone/rclone-mount.log \ --log-level=INFO # 确保在重启或服务停止时干净地卸载,防止目录死锁 ExecStop=/usr/bin/fusermount3 -u %h/OneDrive Restart=on-failure RestartSec=10s [Install] WantedBy=default.target 💡 代码中的 %h 是 Systemd 的原生变量,会自动替换为你的家目录(如 /home/yancheng)。 ...

2026年9月21日 · 1 分钟 · Yancey