Mount NAS share on client when NAS starts after client

I am working on the final setup of a NAS and have moved all my data to that server. I want to mount with fstab shares of the NAS, on both my Linux desktop and have a second Linux server for owncloud/subsonic etc that I want to fstab mount media shares. Question, how do I set up the clients so in the event of a power outage etc., that if the clients restart prior to the NAS being up and online they will find the NAS shares and mount? Thank you all.

Posted Jun 13, 2014, 6:22 PM UTC

64
gh39xp•

I use AutoFS

autofs is a program for automatically mounting directories on an as-needed basis.

https://help.ubuntu.com/community/Autofs

https://wiki.archlinux.org/index.php/autofs

2
arm1e•
Sudo mount -a

This will remount all drives in your fstab. If you want it to do this when you are not able to reach the terminal just put in a root crontab to run every hour or so

1
kenharkey7•

Not really related to the post but everytime I read NAS my brain always parses it as NSA.

1
Ironicbadger•

Try this... It works much more reliably than AutoFS in my experience (which is a great idea but in deployment I've experienced a lot of unreliability). Works v well on my Arch box. The network share is mounted when an application calls it such as Plex automatically.

/etc/fstab

//10.0.0.2/Media /mnt/data cifs auto,x-systemd.automount,guest,noperm,noserverino,uid=nobody,gid=users 0 0

1