Skip to main content

Mount a bucket as a local drive

Mounting a bucket lets you open and save files in FPT Object Storage from File Explorer or the Linux file system, like a normal drive. Use TntDrive on Windows or s3fs on Linux.

Prerequisites​

  • A bucket to mount.
  • An Access Key, Secret Key, and the endpoint of the region. See Manage Access Keys.

Mount a bucket on Windows​

  1. Download and install TntDrive.
  2. Open TntDrive and select Accounts → Add new account.
  3. Enter the account details, the same as for S3 Browser, and save.
  4. Click Add New Mapped Drive.
  5. Enter the drive settings:
    • Storage account: the account you added.
    • Amazon S3 Bucket: the bucket to mount. Type the name or click the icon to choose it.
    • Mapped drive letter: the drive letter for the bucket.
  6. Click Add new drive. TntDrive shows the status of the mounted drive.

The bucket appears as a drive in File Explorer.

Mount a bucket on Linux​

The following steps use s3fs on Ubuntu and mount the bucket bucket-01 at /mnt/bucket-01, so that it mounts again after every restart.

  1. Install s3fs:

    sudo apt-get install s3fs
  2. Save the Access Key and Secret Key in a password file that only root can read:

    echo YOUR_ACCESS_KEY:YOUR_SECRET_KEY | sudo tee /root/s3-password > /dev/null
    sudo chmod 600 /root/s3-password
  3. Create the mount directory:

    sudo mkdir -p /mnt/bucket-01
  4. Add the bucket to /etc/fstab. Replace bucket-01 and the url value with your bucket and endpoint:

    echo "bucket-01 /mnt/bucket-01 fuse.s3fs _netdev,allow_other,passwd_file=/root/s3-password,use_path_request_style,nonempty,uid=0,gid=0,use_cache=/tmp,dbglevel=info,curldbg,url=https://s3-hfx03.fptcloud.com 0 0" | sudo tee -a /etc/fstab
  5. Mount the bucket:

    sudo mount -a
  6. Check that the bucket is mounted:

    df -h /mnt/bucket-01
    ls /mnt/bucket-01

    The output shows the bucket as a s3fs file system and lists its objects.