[GH-ISSUE #1938] Question: Are files mirrored locally? #977

Open
opened 2026-03-04 01:50:23 +03:00 by kerem · 1 comment
Owner

Originally created by @tonekk on GitHub (Apr 26, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1938

Hi,

I have a (probably really naive) question: Does s3fs mirror files locally?
Because I'm currently working on an ec2 instance (that somebody else set up), which uses s3fs and the disk is full.
It has a bucket mounted locally like this:

s3fs#bucket-name:/weekly-sales/ /home/user/folder fuse _netdev,rw,nosuid,nodev,allow_other 0 0

It seems like the files inside that bucket also use the disk space of the instance.
Is that expected or is it due to how we mount the bucket?

Thanks in advance!

Originally created by @tonekk on GitHub (Apr 26, 2022). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1938 Hi, I have a (probably really naive) question: Does s3fs mirror files locally? Because I'm currently working on an ec2 instance (that somebody else set up), which uses s3fs and the disk is full. It has a bucket mounted locally like this: ``` s3fs#bucket-name:/weekly-sales/ /home/user/folder fuse _netdev,rw,nosuid,nodev,allow_other 0 0 ``` It seems like the files inside that bucket also use the disk space of the instance. Is that expected or is it due to how we mount the bucket? Thanks in advance!
Author
Owner

@ggtakec commented on GitHub (May 22, 2022):

@tonekk Sorry for my late reply.

s3fs keeps the file on its local disk when it uploads it.(That is, your guess is correct.)
That is, user actions(such as the cp command) are interpreted as system calls such as write / flush and passed to FUSE.
And s3fs should keep the contents of the written file until it is flushed.
When it is flushed, it will start to upload the file.

Note: That you aren't using it, but if you are using the use_cache option, it will cache the contents of the file to your local disk permanently (until it is updated).

For example, if you try to upload a new 5GB file, your local disk will require 5GB of free space.
(If you can use multi-part upload, if you run out of disk space, it will work to use less than 5GB of disk, but it will be slower. These options are complicated, but man pages etc. Please refer to.)

If you want to keep free disk space, consider the ensure_diskfree option.

<!-- gh-comment-id:1133838517 --> @ggtakec commented on GitHub (May 22, 2022): @tonekk Sorry for my late reply. s3fs keeps the file on its local disk when it uploads it.(That is, your guess is correct.) That is, user actions(such as the `cp` command) are interpreted as system calls such as `write` / `flush` and passed to FUSE. And s3fs should keep the contents of the written file until it is flushed. When it is flushed, it will start to upload the file. Note: That you aren't using it, but if you are using the `use_cache` option, it will cache the contents of the file to your local disk permanently (until it is updated). For example, if you try to upload a new 5GB file, your local disk will require 5GB of free space. (If you can use multi-part upload, if you run out of disk space, it will work to use less than 5GB of disk, but it will be slower. These options are complicated, but man pages etc. Please refer to.) If you want to keep `free disk space`, consider the `ensure_diskfree` option.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#977
No description provided.