i have been wrestling with adding a (asustor) nas to my network last week and finally got to the point where i can mount folders via nfs in ubuntu and from my raspberry-pi running rune-audio.
i mount these in root/nfs/"folder" and added it to the nautilus sidebar.
now i would like to auto mount these upon boot and have read through:
https://help.ubuntu.com/community/Autofs and,
How to setup Automount/Autofs
I have installed autofs.
but i don't seem to understand how to convert the assignment in terminal when i manually mount it to a rule for auto.master:
Manual mount rule used: sudo mount 192.168.0.200:/volume1/Public /nfs/Public
help on this "conversion" would be greatly appreciated.
that is i assume that adding that rule to the standard auto.master is enough or should i work with indirect rules? incorperating auto.nfs?
many thanks in advance on any assistance.
Addition:
I due to the help of steeldriver i indeed got the folder mounted.
But i forgot to mention that besides the rule mentioned above:
sudo mount 192.168.0.200:/volume1/Public /nfs/Public.
i also need to mount:
sudo mount 192.168.0.200:/share/USB1 /nfs/Music.
i assumed this would be similar to implement, but when it tried the following:
* -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp 192.168.0.200:/volume1/Public
* -fstype=nfs,soft,intr,rsize=8192,wsize=8192,nosuid,tcp 192.168.0.200:/share/USB1
but this only gave me a Music folder with the public content, not the USB1 content. what am i doing wrong here?
Best Answer
To mount NFS shares we need to install nfs-common:
To save us from retyping this after every reboot we add the following line to /etc/fstab:
If after mounting, the entry in /proc/mounts appears as :// (with two slashes), then you might need to specify two slashes in /etc/fstab, or else umount might complain that it cannot find the mount.
The auto option mounts on startup. However this will not work if your client uses a wifi connection managed at the user level (after login), because the network will not be available at boot time. In Ubuntu 12.04 LTS and later, wifi connections are managed at the system level by default, so auto-mounting of NFS shares at boot time should work fine
Source: https://help.ubuntu.com/community/SettingUpNFSHowTo
With WIFI it's better to use Autofs:
We start by installing AutoFS:
We edit /etc/auto.master:
Content:
Comment out (#) "+auto.master" and "+dir:/etc/auto.master.d" and add the lines at the bottom. I spent 2hours trying to get this to work and somehow it does not work without adding the --ghost option. If someone knows why please comment. Now /media/nfs is the dir that will contain your NFS shares (you dont have to create that, autofs does that for you) and /etc/auto.nfs is the configuration file for your shares. We will make that now:
Insert shares:
Now Backup the the dir 10.0.1.100:/Backup will take in /media/nfs.
Restart autofs:
That's it, enjoy your shares.