Overview

I had the opportunity to mount mdx.jp object storage as a file system using s3fs, so this is a memo of the process.

1. Prerequisites

This guide targets Ubuntu.

Installing s3fs

sudo apt update
sudo apt install s3fs

Setting up authentication credentials

Save the access key and secret key for mdx.jp object storage to ~/.passwd-s3fs.

echo “ACCESS_KEY:SECRET_KEY” > ~/.passwd-s3fs chmod 600 ~/.passwd-s3fs # Change permissions for security

2. Mount S3 Storage Locally

Create a mount point

mkdir ~/s3mount

Mount with s3fs

s3fs your-bucket /s3mount -o passwd_file=/.passwd-s3fs -o url=https://s3ds.mdx.jp -o use_path_request_style

Option descriptions:

  • -o passwd_file=~/.passwd-s3fs -> Specify authentication credentials
  • -o url=https://s3ds.mdx.jp -> Object storage endpoint
  • -o use_path_request_style -> Required for S3-compatible storage that uses “path style” like MinIO or Ceph

3. Use as a File System

Create and verify files

echo “Hello, S3 Storage!” > ~/s3mount/test.txt cat ~/s3mount/test.txt

List files

ls -lah ~/s3mount

Delete files

rm ~/s3mount/test.txt

4. Auto-mount (Automatic Mount at Startup)

By adding a configuration to /etc/fstab, the mount will persist after reboot.

echo “your-bucket ~/s3mount fuse.s3fs _netdev,passwd_file=/home/youruser/.passwd-s3fs,url=https://s3ds.mdx.jp,use_path_request_style 0 0” | sudo tee -a /etc/fstab

5. Unmount

Manually unmount

fusermount -u ~/s3mount

If registered in /etc/fstab, comment it out

sudo nano /etc/fstab # Delete or comment out the relevant line

6. Summary

With the above configuration, I was able to use mdx.jp object storage as a file system.

In the future, I would like to try whether it can also be used with applications such as IIP Image and other IIIF Image Servers, as well as Omeka S.

Regarding Cantaloupe Image Server, I hope the following article is also helpful.