Can we persist the mounted remote volume's data to the same path so we have it if we remove the mount?

What is the problem you are having with rclone?

I've mounted an AWS S3 bucket and when I remove the mount, the mount path gets empty. I know its not a problem its just how it works but I just want that mounted volume's data be persisted like we are syncing it.

Run the command 'rclone version' and share the full output of the command.

rclone v1.69.1

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 6.8.0-1026-aws (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.24.0
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

AWS S3

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount aws-s3:folder /home/ubuntu/s3 \
  --vfs-cache-mode=full \
  --vfs-read-ahead=32M \
  --vfs-fast-fingerprint \
  --vfs-write-back=100ms \
  --buffer-size=16M \
  --dir-cache-time=1s \
  --poll-interval=0 \
  --attr-timeout=1s \
  --log-file=/var/log/rclone.log \
  --log-level=INFO \
  --allow-non-empty \
  --daemon

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[aws-s3]
type = s3
provider = AWS
access_key_id = XXX
secret_access_key = XXX
region = ap-south-1
location_constraint = ap-south-1
acl = private

Again, I just want to persist the mounted volume's data so its there if the mount is broken or removed. I don't want to use the sync approach instead because I want to directly read and write to the mount. Can we maybe sync the remote to local file system like beneath the mount or something? Thank you for taking the time to read this and I'd greatly appreciate any response.

welcome to the forum,

run rclone mount command at boot using systemd, cron, etc..
many working examples in the forum.


does nothing on s3 remotes. a debug log would show that.


fwiw, use only if 1000% sure you know what that does

i am 78% sure (that it mounts the remote on a non-empty folder). could you link me a resource for it and also for one of those working example please :backhand_index_pointing_right::backhand_index_pointing_left: ( i searched but didn't find something )

search for cron or systemd

for systemd

1 Like

When you mount an S3 bucket to a folder on the local filesystem, let's say /mnt/data/, then all the filesystem is doing is it's showing you the S3 bucket if you access /mnt/data. The actual contents of the S3 bucket don't 'live' in that directory. They don't get transferred there. You are actually not even accessing your local filesystem; "/mnt/data" has become an alias/shortcut that points to the S3 bucket (or whatever else you have mounted).

So, if the process that created and is running the mount is broken for whatever reason, then the link between the filesystem alias /mnt/data and your S3 bucket is broken, so you won't see your files there any more; you will only see any files that are under /mnt/data on your actual storage device where /mnt/data normally is (if there are any).

To keep having access to the S3 files if the mount is broken, you'd have to constantly mirror them somehow, i.e. keep an exact copy of everything on the local filesystem/storage device.

To keep the mount persistent you can run rclone mount on a systemd service, as has already been mentioned here, and enable the service so it runs on boot.

Here's an example of a systemd unit file for an rclone mount:

[Unit]
Description=MyDrive (rclone)
AssertPathIsDirectory=/mnt/data
After=network-online.target

[Service]
Type=notify
User=dinosm
ExecStart=/usr/bin/rclone mount \
        --config=/home/dinosm/.config/rclone/rclone.conf \
        --vfs-cache-mode full \
        --vfs-cache-max-age 2h \
        --vfs-cache-max-size 7G \
        --log-file=/home/dinosm/log/mys3service.log \
        --log-level DEBUG \
        mys3remote: /mnt/data
ExecStop=/bin/fusermount -u /mnt/data
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

If you name this file mydrive.service, you would start this with:

sudo systemctl start mydrive.service

And you can enable it to start at boot with:

sudo systemctl enabel mydrive.service
1 Like