How To Mount Multiple Filesystems On The Same Server

This document describes how multiple ObjectiveFS filesystems can be mounted on the same server using different config directories.

Background

The ObjectiveFS config directory (default: /etc/objectivefs.env/) stores the environment variables used to mount a filesystem, such as the object store keys (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), your ObjectiveFS license (OBJECTIVEFS_LICENSE), filesystem passphrase (OBJECTIVEFS_PASSPHRASE), memory cache size (CACHESIZE), etc. For the complete list of environment variables, see the user guide.

When mounting multiple filesystems, you can have separate config directories, one for each mount. The env=<dir> mount option can be used to select the config directory for each mount. This way, each mount can have their own separate keys, passphrase, cache sizes, etc.

Example

Here is an example of how to mount three different filesystems on the same server.

  1. Set up three ObjectiveFS config directories (e.g. /etc/ofs1.env, /etc/ofs2.env, /etc/ofs3.env). Each config directory contains the following files for the corresponding mount. The filename represents the environment variable and the file content represents the value.

    • AWS_DEFAULT_REGION
    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • OBJECTIVEFS_LICENSE
    • OBJECTIVEFS_PASSPHRASE
    • DISKCACHE_PATH (optional)
    • DISKCACHE_SIZE (optional)
    • CACHESIZE (optional)

  2. Example /etc/fstab entries to mount three filesystems, each with a different config directory.

    s3://bucket1 /ofs1 objectivefs  auto,_netdev,env=/etc/ofs1.env 0 0
    s3://bucket2 /ofs2 objectivefs  auto,_netdev,env=/etc/ofs2.env 0 0
    s3://bucket3 /ofs3 objectivefs  auto,_netdev,env=/etc/ofs3.env 0 0
    
    Note: To add other mount options, you can add them after the config directory separated by comma. Here is an entry using an additional mount option (mt).
    s3://bucket1 /ofs1 objectivefs  auto,_netdev,env=/etc/ofs1.env,mt 0 0 

  3. Example commands if you prefer to mount the filesystems from the command line.

    $ sudo mount.objectivefs -oenv=/etc/ofs1.env s3://bucket1 /ofs1
    $ sudo mount.objectivefs -oenv=/etc/ofs2.env s3://bucket2 /ofs2
    $ sudo mount.objectivefs -oenv=/etc/ofs3.env s3://bucket3 /ofs3
    

Useful Notes

A few items to note when running multiple mounts on the same server.

  1. The memory cache (CACHESIZE, default: 20% per mount) is cumulative.
    You may want to reduce this value depending on the number of mounts and amount of memory available on the server. For example, four mounts (at the default 20% value) would use 80% of memory.

  2. The disk cache can be shared by all mounts on the same server if using the same DISKCACHE_PATH.
    We recommend having all mounts share the same disk cache (i.e. same DISKCACHE_PATH). This allows ObjectiveFS to manage the space efficiently. The data from different filesystems are encrypted and will not be shared across filesystems.

  3. The disk cache size is shared when using the same DISKCACHE_PATH.
    If multiple filesystems are mounted using different DISKCACHE_SIZE values and point to the same DISKCACHE_PATH, ObjectiveFS will use the minimum disk cache size and the maximum free space value. We suggest setting the DISKCACHE_SIZE and DISKCACHE_PATH on all config directories to the same value and path.

Reference


Last updated by ObjectiveFS staff, August 1, 2019
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 support@objectivefs.com