7

I'm using s3fs 1.33 on Ubuntu 9.10 x86.

I mount it manually with this command:

sudo /usr/bin/s3fs mybucket /mnt/s3/mybucket -ouse_cache=/tmp

How can I force the mount on boot?

I guess that I have to write something to /etc/fstab. But what? And how do I test it without rebooting the server?

9

Follow the Ubuntu RcLocalHowto to create /etc/init.d/local, and then put your command in that file. The mount will then happen automatically on boot.

To test, invoke /etc/init.d/local manually on the command line (as root). You should see that causes the mount to occur.

EDIT: doing the mount from /etc/fstab should work fine too, according to the s3fs faq:

s3fs#example.com /mnt/s3/blah fuse _netdev,use_cache=/tmp,use_rrs=1,allow_other 0 0

Reason to prefer the /etc/init.d/local approach: it's simpler to set up, just put your existing mount script in that file.

Reason to prefer the fstab approach: it's a more standard way to do mounts, and someone who doesn't know about your setup can just look in /etc/fstab to determine what mounts your machine is making.

  • Is this the best way? Why not the fstab? – Alexander Gladysh Jan 10 '11 at 7:53
  • 2
    Is that fstab line, it should be _netdev, otherwise mount will throw an error. – Steve Nay Sep 15 '12 at 19:50
  • 1
    and how to test without rebooting -- mount -a will mount everything in fstab. Answered here with more detail. – Michael Greisman Apr 10 '15 at 18:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.