DEV Community

HaxNet
HaxNet

Posted on Edited on

RClone Mounting CLI-Style!

Hello everyone!

It's been a while since I created a post here.

I just want to write this up because I have my own businesses and I needed to mount these cloud storages to my file explorer, Thunar.

I use Arch Linux using i3wm.

I can confirm that this works for Google Drive, Box, and Dropbox. I also mounted 2 google drives.

First thing first install rclone.

You can use yay or just sudo pacman -S rclone

I would create a Parent Folder, RemoteCloud. I just like to have this to have them all in one place.
Create subfolders such as Dropbox, GDrive1, GDrive2, Box, etc.

Once you got those created, go to your terminal and type

rclone config
Enter fullscreen mode Exit fullscreen mode

and create new remotes one by one. You will login and confirm that rclone will have access to your cloud storage. This is safe.

In order to mount you will have to run the following command line in your terminal:

rclone mount yourRemoteName: ~/path/to/subfolder
example.
rclone mount GDrive: ~/RemoteCloud/GDrive
Enter fullscreen mode Exit fullscreen mode

Unfortunately, this is temporary. As soon as you quit your terminal this would disconnect all mounts.

I would go into the config file
my i3wm config file is located in

~/.config/i3/config

at the end of the file, I would just add

exec_always --no-startup-id rclone mount yourRemoteName: ~/path/to/subfolder
Enter fullscreen mode Exit fullscreen mode

This is also a reminder for myself if I ever forget. Because I will forget it if I don't use it often enough.

Update:

It was painfully slow with Google Drive. Just going to a folder I would have to wait 5-10 seconds to see anything.
I used the OAuth2 and ClientID from google. Instruction is in rclone. So not going to put it here.

Now to use the flags and make it faster.

I added these to my i3 config file.

 exec_always --no-startup-id rclone mount \
 --bind 0.0.0.0 \
 --umask=002 \
 --gid=1002 \
 --uid=1000 \
 --allow-other \
 --timeout=1h \
 --poll-interval=15s \
 --dir-cache-time=1000h \
 --cache-dir=/opt/rclone/cache/gmedia \
 --vfs-cache-mode=full \
 --vfs-cache-max-size=150G \
 --vfs-cache-max-age=12h \
 yourdrive: ~/path/to/your/drive
Enter fullscreen mode Exit fullscreen mode

The bind 0.0.0.0 is what make the biggest difference for me. It forces to use the ipv4. Also the backslash \ is so you can continue the code for each line. i3wm config typically only allows 1 line per command and since this is a very long command, this is a way to make it nice and clean.

Top comments (3)

Collapse
 
scsoi profile image
疏影 •

rclone mount on WinFsp is genuinely useful for ad-hoc ops, but for a Windows desktop team that just wants the file to 'be there' day after day, the FUSE/VFS combo and the periodic 'drive disconnected on sleep' issues become a maintenance chore. We've been on a comparison arc for years and ended up on ScsDriver for the desktop side — same backend (S3 / B2 / SMB / WebDAV), but Explorer-native, no FUSE layer, reconnects across sleep / VPN / 网络切换 without a session restart. rclone still wins for headless servers and one-shot data moves; for a designer team's daily file workflow, the alternative mount path is what made the support tickets stop.

Nice walkthrough. A few operational notes for anyone running this on a Windows fleet:

  • --vfs-cache-mode writes is the right default for safety; off will silently lose writes on a transient network blip and the user gets no warning.
  • On a multi-user box, mind the WinFsp licensing dialog (the nagware license reminder shows on every session). Enterprise users sometimes need the paid WinFsp license for that reason alone.
  • If you're handing this off to non-technical users, a managed drive-letter mount with auto-reconnect (ScsDriver handles S3/SMB/SFTP/WebDAV/B2/Wasabi/etc.) is a lower-touch path than teaching the team rclone flags. Thanks for sharing.
Collapse
 
scsoi profile image
疏影 •

Great CLI intro to RClone mounting. If anyone reading this is on Windows and wants the GUI counterpart of RClone — try ScsDriver (USD 9.99/year). It sits on top of the same WebDAV/S3/etc protocol logic but gives you a real drive letter (Z:, Y:) so apps like Photoshop/Excel/Spotify see it as a local volume. RClone is unbeatable for headless servers; ScsDriver fills the desktop-side gap.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.