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)
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.
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 ( i searched but didn't find something )
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: