3

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.

domsson
  • 203
  • What @bodhi.zazen said. Use CIFS. Especially the second link is useful. Try a mount command; when that works, put the information in etc/fstab so it will work automatically after the next reboot. – Jos Jun 23 '14 at 23:12
  • Thanks. That I should go with CIFS already helps, as I now know what to look up. Will check the link and try it out tomorrow, then report back! – domsson Jun 23 '14 at 23:14

1 Answers1

4

If you are sharing with Windows , go with CIFS. You can do NFS with windows , but last time I looked it takes more work. See How do I mount a CIFS share? or http://wiki.ubuntu.com/MountWindowsSharesPermanently .

Please update your question with specific details and/or configuration information if you come across a problem.

Panther
  • 102,067
  • I worked through the wiki link and am stuck. Initial question is updated accordingly. – domsson Jun 25 '14 at 19:46
  • use an ipaddress rather then readynas, or add an entry in /etc/hosts – Panther Jun 25 '14 at 23:02
  • Thanks. Yeah, I ended up using the ip address, although I feel like this is wrong, as it is more likely to change than the name, which is one reason to have those names. Anyway, it works now, so I'll mark your answer accepted, but I'm still quite puzzled over many details (see edit of original question). – domsson Jun 25 '14 at 23:15
  • Set a static ip for the device on your router or in the device configuration (web based?) – Panther Jun 25 '14 at 23:44
  • I have a DLINK NAS on my network drive. Using windows it automatically shows up but I'd like to browse the contents using the terminal on my ubuntu laptop. To do that I followed the guide for "How do I mount a CIFS share?" Here's the entry I added to my own /etc/fstab file for anyone curious: //192.168.1.249/Volume_1 /home/username/mounts/vol1 cifs guest,uid=1000,iocharset=utf8 0 0

    Remember that it's best when you initially setup your NAS to set it a static IP address so that it can be regularly located on your local network.

    – fIwJlxSzApHEZIl Oct 20 '15 at 07:42