Skip to main content
s3fs
Last update:

s3fs

s3fs is an open source utility for Linux and macOS. With s3fs, you can mount a container to a folder on your device and work with it as a regular folder while it is mounted.

Configure s3fs

  1. Install the client.
  2. Configure access.
  3. Mount the container.

Install the client

Use the instructions Installation on GitHub s3fs-fuse.

Configure access

Access can be configured by a user with role Account Owner or User Administrator.

  1. Create a service user с a role with access to object storage. If you are using a user with the Object Storage User role, the container must be configured with the access policy.

  2. Issue an S3 key to the user.

  3. Open the CLI.

  4. In the file ~/.passwd-s3fs save the S3 key:

    echo <access_key>:<secret_key> > ~/.passwd-s3fs

    Specify:

    • <access_key> — field value Access key from S3 key;
    • <secret_key> — field value Secret key from the S3 key.
  5. Restrict access to the file ~/.passwd-s3fs:

    chmod 600 ~/.passwd-s3fs

mount the container

The container will be mounted in a folder on your device. Each time the system reboots, the container will be unmounted.

You can:

  • perform a one-time mount of the container after each manual reboot of the system;
  • configure an automatic mount to be performed automatically each time the system boots.
  1. Open the CLI.

  2. Create an empty folder:

    mkdir ~/<local_folder>

    Specify <local_folder> — folder name.

  3. Mount the container:

    s3fs <container_name> <path> -o passwd_file=~/.passwd-s3fs -o allow_other -o use_path_request_style -o endpoint=<pool> -o url=https://<s3_domain>

    Specify:

    • <container_name> — container name;
    • <path> — path to the local folder where the container will be mounted;
    • -o allow_other — optional: a parameter that allows other users on the device to access the container folder. If you do not specify the parameter, only the current user can work with the folder;
    • -o use_path_request_style — optional: parameter that enables Path-style addressing. If you do not specify a parameter, the following will be used Virtual-Hosted addressing;
    • <pool> — pool where the object storage is located;
    • <s3_domain> — S3 API domain depends on pool where the object storage is located.