Automatically mounting S3 bucket using s3fs on Amazon CentOS

时间:2019-01-15 18:21:48

标签: amazon-web-services amazon-s3 s3fs fstab

I have tried all the answers provided in similar questions but none is helpful.

I installed S3 Fuse so that I can mount S3 bucket. After the installation, I performed the following the steps:

Step 1 Create the mount point for S3 bucket mkdir –p /var/s3fs-drive-fs Step 2 Then I am able to mount the S3 bucket in the new directory with the IAM role by running the following commands: s3fs myresearchdatasets /var/s3fs-drive-fs -o iam_role=EC2-to-S3-Buckets-Role -o allow_other, and it works fine.

However, I found out that the bucket disappears each time I reboot the system, which means I have to run the command above to remount the S3 bucket each time after restarting the system.

I found the steps to complete an Automatic mount at reboot by editing the fstab file with the lines below

s3fs myresearchdatasets /var/s3fs-drive-fs fuse_netdev,allow_other,iam_role=EC2-to-S3-Buckets-Role,umask=777, 0 0

To check whether the fstab is working correctly, I tried mount /var/s3fs-drive-fs/

but I got the following errors, "mount: can't find /var/s3fs-drive-fs/ in /etc/fstab"

Can anyone help me please?

1 个答案:

答案 0 :(得分:0)

第一个字段应包含安装类型和存储区名称,例如

s3fs#mybucket /path/to/mountpoint fuse _netdev,allow_other 0 0

s3fs README还有其他示例。