← Home

[f44] 使用 Rclone 挂载 Onedrive 上的 home 文件夹(推荐)

01 Mar, 2026 12:00 AM +00:00

同步太重了,不敢跑怕丢文件,而且配置起来也麻烦。

这里换成挂载整个网盘的方案,到 ~/ondrive

这样就灵活多了,还不占存储。

1. 安装 Rclone CLI

rpm-ostree install rclone

flatpak 太麻烦,这里直接安装到了 rpm-ostree 。

2. 初始化 Rclone 的 Onedrive 配置文件

rclone config

然后跟着交互式工具走,注意 remote 的 name ,这里是 onedrive8614

3. 写一个 systemd 脚本,实现开机自动挂载

创建模板 Service 文件:

# ~/.config/systemd/user/rclone-onedrive.service
# Gemini 3 生成 3/1/2026
[Unit]
Description=Rclone OneDrive Mount Service
After=network-online.target

[Service]
Type=simple
# 注意:%h 是 systemd 中代表用户家目录的变量
ExecStart=/usr/bin/rclone mount onedrive8614: %h/onedrive \
    --vfs-cache-mode writes \
    --vfs-cache-max-size 10G \
    --vfs-cache-max-age 24h
# 停止服务时卸载
ExecStop=/usr/bin/fusermount -u %h/onedrive
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

执行:

systemctl --user daemon-reload
systemctl --user enable --now rclone-onedrive.service

就是这么简单。