Rclone挂载Google Drive网盘


Rclone 可以将 Google Drive 网盘挂载到 VPS 上,作为本地磁盘使用。


安装 fuse

1
2
3
4
5
# Debian/Ubuntu
apt-get install fuse

# CentOS
yum install fuse

创建挂载目录

1
mkdir -p /home/gdrive

挂载 Google Drive

1
rclone mount gd: /home/gdrive --allow-other --allow-non-empty --vfs-cache-mode writes

参数说明:

  • gd - Rclone 配置时的名称
  • /home/gdrive - 本地挂载路径
  • --allow-other - 允许其他用户访问
  • --allow-non-empty - 允许挂载非空目录
  • --vfs-cache-mode writes - 缓存写入模式

挂载网盘内指定文件夹

1
rclone mount gd:backup /home/gdrive --allow-other --allow-non-empty --vfs-cache-mode writes

验证挂载

1
df -h

挂载成功后,关闭 SSH 重连即可看到挂载的磁盘。


卸载网盘

1
fusermount -qzu /home/gdrive

开机自启

需要配置开机自动挂载的,可以配合 systemd 或 init.d 实现。