I do not manage to get a remote directory automatically mounted during bootstrap. I am using the NFS protocol under Ubuntu 14.04 LTS. The server is 192.168.1.1
and the client is 192.168.1.2
The setting in /etc/exports
at the server side is
/home/export 192.168.1.2(ro,no_root_squash,sync)
Although the \home\user
directory at the client side is, note that all directories mentioned in this post are not encrypted. The server computer is always on, and the two machines can ping each other. Also note that, in both machines, the \home
directory is mounted on an own partition.
The command line works well and I can see the remote content at the mount point after
sudo mount 192.168.1.1:/home/export /home/import/server1
.
Like in How to edit /etc/fstab properly for network drive?
I want to mount a network drive by editing /etc/fstab
. However, when I add any one of those lines to /etc/fstab
[1] 192.168.1.1:/home/export /home/import/server1 nfs rsize=8192,wsize=8192,timeo=14 0 0
[2] 192.168.1.1:/home/export /home/import/server1 nfs auto 0 0
[3] 192.168.1.1:/home/export /home/import/server1 nfs auto, rsize=8192,wsize=8192,timeo=14 0 0
[4] 192.168.1.1:/home/export /home/import/server1 nfs defaults 0 0
I need to launch a sudo mount -a
manually to get the view on the server side. This defies my expectations and those from this U&L post as well.
How can I get the auto-mounting capability running on its own feet?
Inspirations/copy-catting disclosed:
[1] https://help.ubuntu.com/14.04/serverguide/network-file-system.html
[3] = [1] + [2]
[4] mimicking the mount options of the local device partitions in etc/fstab
Best Answer
If your mount -a option works then you should add _netdev in fstab.
192.168.1.1:/home/export /home/import/server1 nfs defaults,_netdev 0 0
Also make sure for "chkconfig netfs on"