ObjectiveFS Mount On Boot Guide For Linux
This guide covers the steps to set up your filesystem to mount automatically upon boot on Linux. For macOS, see this guide.
What You Need
- Completed installing ObjectiveFS and running config.
Steps
-
Check that
/etc/objectivefs.env/OBJECTIVEFS_PASSPHRASE
exists so you can mount your filesystem without needing to enter the passphrase.
If it doesn’t exist, create the file with your passphrase as the content.$ sudo ls /etc/objectivefs.env AWS_ACCESS_KEY_ID OBJECTIVEFS_LICENSE AWS_SECRET_ACCESS_KEY OBJECTIVEFS_PASSPHRASE
-
Add the following line in
/etc/fstab
<filesystem> <mount dir> objectivefs auto,_netdev[,<opts>] 0 0
Note:
a. Check that<mount dir>
is an existing empty directory
b._netdev
is used by many Linux distributions to mark the file system as a network file system. -
For older RedHat-derived Linux versions (e.g. CentOS 6.5 or older): make sure that network file systems are enabled on boot.
$ chkconfig --level 3 netfs on $ chkconfig --list netfs netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
-
Verify
/etc/fstab
is set up correctly to mount on boot.
This command can be run without needing to reboot your system.$ sudo mount -a
Tips
If SELinux is enabled and you get an error during boot, you may need one of the following commands to allow mount on boot.
$ setsebool -P allow_mount_anyfile 1
$ semanage permissive -a mount_t
Examples
All examples below assumes your filesystem is stored in an S3 bucket called myfs
and your mount directory is /ofs
.
-
Mount on boot with multithreading enabled
Add this line in/etc/fstab
:s3://myfs /ofs objectivefs auto,_netdev,mt 0 0
-
Mount on boot with disk cache enabled
a. Add a file/etc/objectivefs.env/DISKCACHE_SIZE
that contains the desired disk cache size, e.g. 500G. (see disk cache user guide for options)
b. Add this line in /etc/fstab$ cat /etc/objectivefs.env/DISKCACHE_SIZE 500G
s3://myfs /ofs objectivefs auto,_netdev 0 0
-
Mount on boot using a different environment variable directory, e.g.
/etc/ofs.admin
Add this line in /etc/fstabs3://myfs /ofs objectivefs auto,_netdev,env=/etc/ofs.admin 0 0
References
by ObjectiveFS staff, May 24, 2016
ObjectiveFS is a shared file system for OS X and Linux that automatically scales and gives you scalable cloud storage. If you have questions or article idea suggestions, please email us at お問い合わせはこちら