Skip to main content

Mount JuiceFS at Boot Time


Copy juicefs as /sbin/mount.juicefs, then edit /etc/fstab with following line:

<META-URL>    <MOUNTPOINT>       juicefs     _netdev[,<MOUNT-OPTIONS>]     0  0

For the format of <META-URL>, please refer to the "How to Set Up Metadata Engine" document, such as redis://localhost:6379/1. Then replace <MOUNTPOINT> with the path you want JuiceFS to mount, e.g. /jfs. If you want to set mount options, separate the options list with commas and replace [,<MOUNT-OPTIONS>]. Here is an example:

redis://localhost:6379/1    /jfs       juicefs     _netdev,max-uploads=50,writeback,cache-size=204800     0  0

By default, CentOS 6 will NOT mount network file system after boot, run following command to enable it:

sudo chkconfig --add netfs

Automating Mounting with systemd.mount

If you're using JuiceFS and need to apply settings like database access password, S3 access key, and secret key, which are hidden from the command line using environment variables for security reason, it may not be easy to configure them in the /etc/fstab file. In such cases, you can utilize systemd to mount your JuiceFS instance.

Here's how you can set up your systemd configuration file:

  1. Create the file /etc/systemd/system/juicefs.mount and add the following content:


    Environment="ALICLOUD_ACCESS_KEY_ID=mykey" "ALICLOUD_ACCESS_KEY_SECRET=mysecret" "META_PASSWORD=mypassword"


    Feel free to modify the options and environments according to your needs.

  2. Enable and start the JuiceFS mount using the following commands:

    ln -s /usr/local/bin/juicefs /sbin/mount.juicefs
    systemctl enable juicefs.mount
    systemctl start juicefs.mount

After completing these steps, you will be able to access /juicefs and store your files there.


Create a file named io.juicefs.<NAME>.plist under ~/Library/LaunchAgents. Replace <NAME> with JuiceFS file system name. Add following contents to the file (again, replace NAME, PATH-TO-JUICEFS, META-URL, MOUNTPOINT and MOUNT-OPTIONS with appropriate value):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">

If there are multiple mount options, they can be set in multiple lines, for example:


Use following commands to load the file created in the previous step and test whether the loading is successful. Please make sure the metadata engine is running properly.

launchctl load ~/Library/LaunchAgents/io.juicefs.<NAME>.plist
launchctl start ~/Library/LaunchAgents/io.juicefs.<NAME>

If mount failed, you can add following configuration to io.juicefs.<NAME>.plist file for debug purpose:


Use following commands to reload the latest configuration and inspect the output:

launchctl unload ~/Library/LaunchAgents/io.juicefs.<NAME>.plist
launchctl load ~/Library/LaunchAgents/io.juicefs.<NAME>.plist
cat /tmp/juicefs.out
cat /tmp/juicefs.err

If you install Redis server by Homebrew, you could use following command to start it at boot:

brew services start redis

Then add following configuration to io.juicefs.<NAME>.plist file for ensure Redis server is loaded: