We recommend using s3fs version 1.84 or higher.
s3fs performance depends on the speed of your local disk. Use high-speed disks, especially if you store a lot of small files (several hundred kilobytes each or smaller). To increase s3fs performance, you can enable caching (via the
--use_cache <directory> key). As the s3fs cache can grow indefinitely, please make sure to clear it regularly. Learn more in the s3fs documentation.
Before you start
- Create a service account.
- Assign a proper role to the service account. For more information about roles, see the Identity and Access Management documentation.
- Create a static access key.
To install s3fs, follow the instructions in the project repository.
To configure s3fs, save the key ID and secret key to a
~/.passwd-s3fs file in the format
<key ID>:<secret key> and restrict access to the
~/.passwd-s3fs file like this:
echo <key ID>:<secret key> > ~/.passwd-s3fs chmod 600 ~/.passwd-s3fs
Mounting a bucket
Select the folder where you want to mount a bucket and make sure you have permissions to mount a bucket.
Run a command in the format:
s3fs <bucket name> /mount/<directory path> -o passwd_file=$HOME/.passwd-s3fs \ -o url=http://storage.yandexcloud.net -o use_path_request_style
You can configure mounting a bucket at system startup. To do this, open the
/etc/fstab file and add a line in the following format:
s3fs#<bucket name> /mount/<directory path> fuse _netdev,allow_other,use_path_request_style,url=http://storage.yandexcloud.net,passwd_file=/home/<username>/.passwd-s3fs 0 0
For descriptions of all s3fs parameters, see the project's wiki page on GitHub.