Amazon Simple Storage Service (Amazon S3) is generally used as highly durable and scalable data storage for images, videos, logs, big data, and other static storage files. In addition to its popularity as a static storage service, some users want to use Amazon S3 storage as a file system mounted to either Amazon EC2, on-premises systems, or even client laptops. This alternative model for cloud file sharing is complex but possible with the help of S3FS or other third-party tools.
In this article, we will show you how to mount an Amazon S3 bucket as file storage and discuss its advantages and drawbacks. We’ll also show you how some NetApp cloud solutions can make it possible to have Amazon S3 mount as a file system while cutting down your overall storage costs on AWS. It is important to note that AWS does not recommend the use of Amazon S3 as a block-level file system.
Mounting an Amazon S3 bucket as a file system means that you can use all your existing tools and applications to interact with the Amazon S3 bucket to perform read/write operations on files and folders. Can EC2 mount Amazon S3? Using this method enables multiple Amazon EC2 instances to concurrently mount and access data in Amazon S3, just like a shared file system.
Why use an Amazon S3 file system? Any application interacting with the mounted drive doesn’t have to worry about transfer protocols, security mechanisms, or Amazon S3-specific API calls. In some cases, mounting Amazon S3 as drive on an application server can make creating a distributed file store extremely easy.
For example, when creating a photo upload application, you can have it store data on a fixed path in a file system and when deploying you can mount an Amazon S3 bucket on that fixed path. This way, the application will write all files in the bucket without you having to worry about Amazon S3 integration at the application level. Another major advantage is to enable legacy applications to scale in the cloud since there are no source code changes required to use an Amazon S3 bucket as storage backend: the application can be configured to use a local path where the Amazon S3 bucket is mounted. This technique is also very helpful when you want to collect logs from various servers in a central location for archiving.
There are a few different ways for mounting Amazon S3 as a local drive on linux-based systems, which also support setups where you have Amazon S3 mount EC2.
In this section, we’ll show you how to mount an Amazon S3 file system step by step. Mounting an Amazon S3 bucket using S3FS is a simple process: by following the steps below, you should be able to start experimenting with using Amazon S3 as a drive on your computer immediately.
The easiest way to set up S3FS-FUSE on a Mac is to install it via HomeBrew. To install HomeBrew:
1.
ruby -e "$(curl -fsSL
2. Brew install s3fs, as shown below.
On Ubuntu 16.04, using apt-get, it can be installed by using the command below:
sudo apt-get install s3fs
1. Once S3FS is installed, set up the credentials as shown below:
echo ACCESS_KEY:SECRET_KEY > ~/.passwd-s3fs
cat ~/ .passwd-s3fs ACCESS_KEY:SECRET_KEY
You will also need to set the right access permission for the passwd-s3fs file to run S3FS successfully. To do that, run the command below:
chmod 600 .passwd-s3fs
2. Now we’re ready to mount