Mount multiple s3fs buckets automatically with /etc/fstab

amazon-s3, s3fs

Solution

You may try a startup script. This is how I got around issues I was having mounting my s3fs at boot time with /etc/fstab.

How to make startup scripts varies with distributions, but there is a lot of information out there on the subject.

Problem

In the s3fs instruction wiki, we were told that we could auto mount s3fs buckets by entering the following line to `/etc/fstab` ``` s3fs#mybucket /mnt/mybucket fuse allow_other,use_cache=/tmp,url=https://s3.amazonaws.com 0 0 ``` This works fine for 1 bucket, but when I try to mount multiple buckets onto 1 EC2 instance by having 2 lines: ``` s3fs#mybucket /mnt/mybucket fuse allow_other,use_cache=/tmp 0 0 s3fs#mybucket2 /mnt/mybucket2 fuse allow_other,use_cache=/tmp 0 0 ``` only the second line works I tried duplicating s3fs to s3fs2 and to: ``` s3fs#mybucket /mnt/mybucket fuse allow_other,use_cache=/tmp 0 0 s3fs2#mybucket2 /mnt/mybucket2 fuse allow_other,use_cache=/tmp 0 0 ``` but this still does not work. only the second one gets mounted: How do I automatically mount multiple s3 bucket via s3fs in `/etc/fstab` without manually using: ``` s3fs mybucket /mn/mybucket2-ouse_cache=/tmp ```

Original source