Rclone memungkinkan Anda untuk mount cloud storage sebagai local filesystem menggunakan FUSE. Artikel ini membahas cara mount Google Drive di Linux sehingga Anda dapat mengakses file seolah-olah berada di hard drive lokal.
1. Persiapan dan Prasyarat
Install Rclone dan Dependencies
# Install rclone
curl https://rclone.org/install.sh | sudo bash
Install FUSE (untuk mount filesystem)
sudo apt install fuse3 -y # Ubuntu/Debian
sudo yum install fuse -y # CentOS/RHEL
sudo pacman -S fuse3 # Arch Linux
Verifikasi instalasi
rclone version
fusermount3 -V
Setup Google Drive Remote
# Konfigurasi rclone
rclone config
Pilih:
n) New remote
name> gdrive
Storage> 13 (Google Drive)
Ikuti wizard untuk OAuth setup
Copy authorization URL ke browser
Paste code yang diberikan
2. Mount Google Drive dengan Rclone
Mount Sederhana
# Buat direktori mount
mkdir -p ~/mnt/gdrive
Mount Google Drive
rclone mount gdrive: ~/mnt/gdrive
Di terminal lain, akses file
ls ~/mnt/gdrive
Unmount
fusermount3 -u ~/mnt/gdrive
Mount dengan Options Optimal
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode full \
--vfs-cache-max-size 5G \
--vfs-cache-max-age 24h \
--transfers 16 \
--checkers 8 \
--buffer-size 32M \
--dir-cache-time 72h \
--drive-chunk-size 128M \
--timeout 1h \
--vfs-read-chunk-size 128M \
--vfs-read-chunk-size-limit 1G
Penjelasan Options:
– --vfs-cache-mode full: Full caching untuk performance
– --vfs-cache-max-size 5G: Cache maksimal 5GB
– --transfers 16: Parallel transfers
– --drive-chunk-size 128M: Upload chunk size untuk file besar
– --dir-cache-time 72h: Directory listing cache 72 jam
3. Mount Permanent dengan Systemd
Buat Systemd Service
# Buat service file
sudo nano /etc/systemd/system/rclone-gdrive.service
Isi file:
[Unit]
Description=Rclone Mount Google Drive
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
Environment="RCLONE_CONFIG=/home/username/.config/rclone/rclone.conf"
Environment="RCLONE_CACHE_DIR=/home/username/.cache/rclone"
ExecStart=/usr/bin/rclone mount gdrive: /home/username/mnt/gdrive \
--vfs-cache-mode full \
--vfs-cache-max-size 5G \
--vfs-cache-max-age 24h \
--transfers 16 \
--checkers 8 \
--buffer-size 32M \
--dir-cache-time 72h \
--drive-chunk-size 128M \
--timeout 1h \
--vfs-read-chunk-size 128M \
--vfs-read-chunk-size-limit 1G \
--config /home/username/.config/rclone/rclone.conf \
--log-level INFO \
--log-file /var/log/rclone-mount.log
ExecStop=/bin/fusermount3 -u /home/username/mnt/gdrive
Restart=on-failure
RestartSec=10
User=username
Group=username
[Install]
WantedBy=default.target
Enable dan Start Service
# Reload systemd
sudo systemctl daemon-reload
Enable service (start otomatis saat boot)
sudo systemctl enable rclone-gdrive.service
Start service
sudo systemctl start rclone-gdrive.service
Check status
sudo systemctl status rclone-gdrive.service
View logs
sudo journalctl -u rclone-gdrive.service -f
4. Multiple Mount Points
Mount Multiple Google Drive Accounts
# Setup remote kedua
rclone config
name> gdrive-work
Storage> 13 (Google Drive)
# Setup dengan account Google yang berbeda
Mount kedua account
mkdir -p ~/mnt/gdrive-personal ~/mnt/gdrive-work
Gunakan systemd service terpisah
Mount Subfolder Spesifik
# Mount hanya subfolder Documents
rclone mount gdrive:Documents ~/mnt/gdrive-docs \
--vfs-cache-mode full
Mount multiple subfolder
rclone mount gdrive:Projects ~/mnt/projects \
--vfs-cache-mode full &
rclone mount gdrive:Media ~/mnt/media \
--vfs-cache-mode full &
5. Optimasi Performance
Cache Configuration
# Full cache untuk best performance
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode full \
--vfs-cache-max-size 10G \
--vfs-cache-max-age 48h \
--vfs-cache-poll-interval 5m
Minimal cache untuk low resource
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode minimal \
--vfs-cache-max-size 1G
No cache (direct streaming)
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode off \
--buffer-size 64M
Bandwidth Management
# Limit bandwidth
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode full \
--bwlimit 10M
Schedule bandwidth (batasi jam kerja)
rclone mount gdrive: ~/mnt/gdrive \
--vfs-cache-mode full \
--bwlimit "09:00,5M 18:00,20M"
6. Troubleshooting
Permission Issues
# Pastikan user ada di group fuse
sudo usermod -a -G fuse username
Set proper permission pada mount point
chmod 755 ~/mnt/gdrive
Check FUSE configuration
cat /etc/fuse.conf
Pastikan user_allow_other tidak dikomentari
Mount Failed atau Not Responding
# Force unmount
fusermount3 -uz ~/mnt/gdrive
Kill rclone process jika hang
pkill -f "rclone mount"
Check logs
sudo tail -f /var/log/rclone-mount.log
Mount dengan verbose logging
rclone mount gdrive: ~/mnt/gdrive -vv \
--vfs-cache-mode full \
--log-file /tmp/rclone-debug.log
Slow Performance
# Increase buffer size
rclone mount gdrive: ~/mnt/gdrive \
--buffer-size 1G \
--vfs-read-chunk-size 256M \
--vfs-read-chunk-size-limit 2G
Increase parallel transfers
rclone mount gdrive: ~/mnt/gdrive \
--transfers 32 \
--checkers 16
Reduce API calls dengan cache
rclone mount gdrive: ~/mnt/gdrive \
--dir-cache-time 168h \
--poll-interval 0
Kesimpulan
Mount Google Drive dengan Rclone memberikan pengalaman seamless mengakses cloud storage seperti local disk. Dengan konfigurasi yang tepat, Anda dapat streaming video, mengedit dokumen, dan mengelola file dengan performa yang baik.
Best Practices:
1. Gunakan --vfs-cache-mode full untuk kebanyakan use case
2. Setup systemd service untuk mount otomatis
3. Monitor disk space untuk cache directory
4. Gunakan bandwidth limit di production server
5. Backup rclone.conf secara berkala
Perintah Penting:
– rclone mount: Mount cloud storage
– fusermount3 -u: Unmount
– systemctl status rclone-gdrive: Check service status
– df -h: Check mounted filesystems
Ditulis oleh
Hendra Wijaya