Trying to mount mhddfs / osxfuse via fstab

Solution 1:

Here is a way to mount osxfuse / mhddfs via LaunchDaemon

Prerequisites:
– existing /mnt/DrivePoolA
– some Volumes (in the example below Test01-Test03 mounted at /Volumes)
– OSXFuse 2.7.3
– mhddfs via macports

  1. Create a file com.oxsfuse.mhddfs.plist in /Library/LaunchDaemons/

    <?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.oxsfuse.mhddfs</string>
        <key>ProgramArguments</key>
        <array>
            <string>sh</string>
            <string>/usr/local/mhddfs-start.sh</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
    </plist>
    
  2. Enter in Terminal:

     sudo chown root:wheel /Library/LaunchDaemons/com.oxsfuse.mhddfs.plist 
     sudo chmod 644 /Library/LaunchDaemons/com.oxsfuse.mhddfs.plist 
    
  3. Create a file mhddfs-start.sh in /usr/local/

    #!/bin/bash
    
    kextload /Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext
    sysctl -w osxfuse.tunables.allow_other=1
    /opt/local/bin/mhddfs /Volumes/Test01,/Volumes/Test02,/Volumes/Test03 /mnt/DrivePoolA -o allow_other,loglevel=0,logfile=/tmp/mhddfs1.log,volname=DrivePoolA
    sleep 5
    /opt/local/bin/mhddfs /Volumes/Test01,/Volumes/Test02,/Volumes/Test03 /mnt/DrivePoolA -o allow_other,loglevel=0,logfile=/tmp/mhddfs2.log,volname=DrivePoolA
    
  4. Enter in Terminal:

     sudo chown root:wheel /usr/local/mhddfs-start.sh  
    

You may store the shell script somewhere else but be sure to adapt <string>/usr/local/mhddfs-start.sh</string> in the file com.oxsfuse.mhddfs.plist.

After some extended testing in a Parallels VM (Mavericks with OSXFuse 2.7.3 and macport's mhddfs) i got it mounted reliably. And yes, executing mhddfs two times is intended!

You may omit the loglevel=0,logfile=/tmp/mhddfs1/2.log,-part in the shell script - it was just for testing purposes.

Please do some tests with the volumes before using it in a productive environment.