s3fs

s3fs is a utility that lets Linux and macOS mount an Object Storage bucket via FUSE.

Note

We recommend using s3fs version 1.84 or higher.

If you have any questions, see the official documentation, in particular, FAQ. There you can learn how to fix problems that occur when using s3fs.

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 (use the key --use_cache <directory>). As the s3fs cache can grow indefinitely, please make sure to clear it regularly. Learn more in the s3fs documentation.

Before you start

  1. Create a service account.
  2. Assign a role to a service account.
  3. Create a static access key.

Installation

To install s3fs, follow the instructions in the project repository.

Configuration

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

  1. Select the folder where you want to mount the bucket and make sure you have permissions to perform the mounting operation.

  2. Run a command like:

    s3fs <bucket name> /mount/<folder path> -o passwd_file=~/.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/<folder path> fuse _netdev,allow_other,use_path_request_style,url=http://storage.yandexcloud.net 0 0

For descriptions of all s3fs parameters, see the project's wiki page on GitHub.