I've got a NAS in my home network, which can serve files both via CIFS or NFS. Some of the shares require a username and password and I want all machines to automatically mount the shares on boot.
With my Windows machine, I simply connect a network drive, give it a Drive letter and put in the username and password.
With Ubuntu 14.04, I'm not sure what's the right way to do it. First, should I use CIFS or NFS? Second, how to set it up? I found way too many "how to's" and they are all different somehow, so I'm really confused now. Isn't there the way to do it? :)
EDIT:
I decided for CIFS (thanks to the comments), then followed these instructions as suggested. After creating the .smbcredentials file, as well as some folders within the /mnt/ directory, plus adding a line to my /etc/fstab file, I thought I was done. However, there is a problem left. When running mount -a:
mount error: could not resolve address for readynas: Unknown error
The line in fstab looks like this:
//readynas/public /mnt/readynas/public cifs iocharset=utf8,credentials=/home/domdom/.smbcredentials,uid=1000 0 0
Apart from that, I've got some questions:
- Where would you usually mount those shares to? /mnt sounded like a good place to me, but some people suggest /media.
- Why do I have to download and install cifs-utils when Ubuntu is able to mount the shares without? I can do that via the file manager (Browse Network, readynas (CIFS), ...).
- The instructions say to secure the .smbcredentials file with two commands, then immediately add that they don't work with recent Ubuntu versions anymore. So, I just go without them? Or do I need to do something else? Is this insecure?
- In another source, 'sec=ntlm' is added to explicitly set the security mode; I wonder if I need that and how I figure out whether or not I do.
Man, I wish this was more straightforward.
EDIT 2
I replaced 'readynas' with the actual IP address and added the 'sec=ntlm' option. This way, I got it to work, though I still don't understand the details (see questions above). Plus, I feel like using the IP address is more of a workaround, but at least it does work.
etc/fstab
so it will work automatically after the next reboot.