Mounting filesystems using autofs

Content Software for File CLI Reference

Version
4.2.x
Audience
anonymous
Part Number
MK-HCSF001-03

It is possible to mount a Content Software for File filesystem using the autofs command.

  1. Install autofs on the host using one of the following commands according to your deployment:
    • On RedHat or Centos:
      yum install -y autofs
    • On Debian or Ubuntu:
      apt-get install -y autofs
  2. To create the autofs configuration files for Content Software for File filesystems, do one of the following depending on the client type:
    • For a stateless client, run the following commands (specify the backend names as parameters):
      echo "/mnt/weka   /etc/auto.wekafs -fstype=wekafs,num_cores=1,net=<netdevice>" > /etc/auto.master.d/wekafs.autofs
      echo "*   <backend-1>,<backend-2>/&" > /etc/auto.wekafs
      
    • For a stateful client (traditional), run the following commands:
      echo "/mnt/weka /etc/auto.wekafs -fstype=wekafs" > /etc/auto.master.d/wekafs.autofs
      echo "* &" > /etc/auto.wekafs
  3. Restart the autofs service:
    service autofs restart
  4. The configuration is distribution-dependent. Verify that the service is configured to start automatically after restarting the host. Run the following command:
    systemctl is-enabled autofs.

    If the output is enabled the service is configured to start automatically.

In Amazon Linux, you can verify that the autofs service is configured to start automatically by running the command chkconfig. If the output is on for the current runlevel (you can check with the runlevel command), autofs is enabled upon restart.
# chkconfig | grep autofs
autofs         0:off 1:off 2:off 3:on 4:on 5:on 6:off

Once you complete this procedure, it is possible to access Content Software for File filesystems using the command cd /mnt/weka/<fs-name>.