here’s how to use autofs, it’s quite a good soft to be sure you mount filesystems anytime, it’s also useful to unmount them when you don’t need them (less uptime for the disk and you can save the planet this way).
First install the correct package:
Then create the few directories:
Now it’s time to do some configuration, so edit /etc/auto.master.d/master.autofs:
Finally, simply set the mount(s) you want in /etc/auto.map.d/master.autofs (one per line) :
There you can notice I just have one mount, a cifs one, the mount directory will be /mnt/autofs/boxshare.
Now restart autofs and check if it’s mounted!
If when you “ls” the directory it fails, then stop autofs and troubleshoot it this way:
You’ll probably get this error:
To fix it, simply open /etc/auto.master an comment the last line, so it should look like that:
Now you restart autofs and it should work !
If not, do the troubleshooting again 🙂