Skip to main content
Version: v2.3.0

Mount S3 Bucket

Bitstreams support mounting an S3 bucket that can be used to save files. The hosts /mnt directory is configured as a shared mount point inside the docker containers.

Installation

To mount the S3 Bucket the following applications need to be installed.

sudo apt install s3fs

Setup

  1. Create a directory under the /mnt location

    sudo mkdir -p /mnt/s3bucket
  2. Login into the AWS account and obtain an Access Key and Access ID.

  3. Create a file to store the Access Key and Access ID

    nano .passwd-s3fs
  4. Update the permissions on the password file.

    chmod 600 .passwd-s3fs
  5. Paste the Access Key and Access ID into the file with the following syntax.

    ACCESSKEY:ACCESSID

    eg
    DU6IAFSADMSI6OURYAKNF4X:uJL/Pw3U+w/odfcvasaRtuI9mI/E8c3R/p5L1TVVjfj
  6. Run the below command to mount the S3 Bucket.

note

If the server is rebooted, the S3 Bucket will no longer be mounted. See the next section to mount with fstab.


sudo s3fs <s3-bucket-name> /mnt/s3bucket -o passwd_file=.passwd-s3fs -o use_cache=/tmp -o allow_other -o umask=022 -o url=https://<region>.amazonaws.com

s3-bucket-name = Name of the S3 Bucket
region = Region the S3 bucket is located

Example:

sudo s3fs bitstreams-sse-s3  /mnt/s3bucket -o passwd_file=.passwd-s3fs -o use_cache=/tmp -o allow_other -o umask=022  -o url=https://s3.us-west-2.amazonaws.com

Mount with fstab

  1. Copy the passwd file into the root home director

    sudo cp ~/.passwd-3fs /root
  2. Edit the fstab with nano /etc/fstab and add the following line.

    s3fs#<s3-bucket> /mnt/s3bucket fuse _netdev,allow_other,umask=022,url=https://<region>.amazonaws.com 0 0

    s3-bucket-name = Name of the S3 Bucket
    region = Region the S3 bucket is located

    Example:

    s3fs#bitstreams-sse-s3 /mnt/s3bucket fuse _netdev,allow_other,umask=022,url=https://s3.us-west-2.amazonaws.com 0 0