ObjectiveFS Mount On Boot Guide For macOS

This guide covers the steps to set up your filesystem to mount automatically upon boot on macOS with a launchd script. For Linux, see this guide.

What You Need

Steps

  1. Create your filesystem passphrase file at /etc/objectivefs.env/OBJECTIVEFS_PASSPHRASE to contain your objectivefs passphrase.

    $ sudo ls /etc/objectivefs.env
    AWS_ACCESS_KEY_ID         OBJECTIVEFS_LICENSE
    AWS_SECRET_ACCESS_KEY     OBJECTIVEFS_PASSPHRASE
    

  2. Create a launchd script at /Library/LaunchDaemons/com.objectivefs.mount.plist.
    Replace FILESYSTEM_NAME and MOUNT_DIRECTORY with your filesystem name (e.g. myfs) and mount directory (e.g. /Volumes/ofs).
    Replace MOUNT_OPTIONS with the mount options you would like to use (e.g. -omt) or remove this line if not using any mount option.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>com.objectivefs.mount</string>
        <key>ProgramArguments</key>
        <array>
          <string>/Library/Filesystems/objectivefs.fs/Support/mount.objectivefs</string>
          <string>MOUNT_OPTIONS</string>
          <string>FILESYSTEM_NAME</string>
          <string>MOUNT_DIRECTORY</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <dict>
          <key>SuccessfulExit</key>
          <false/>
        </dict>
        <key>AbandonProcessGroup</key>
        <true/>
        <key>StandardOutPath</key>
        <string>/dev/null</string>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
      </dict>
    </plist>
    
  3. Verify the owner of this file is root.

  4. Permanently enable this job.

    $ sudo launchctl load -w /Library/LaunchDaemons/com.objectivefs.mount.plist
    

Reference


by ObjectiveFS staff, September 26, 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 support@objectivefs.com