LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting CISF/NFS Shares (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-cisf-nfs-shares-4175516458/)

panher 08-26-2014 05:09 PM

Mounting CISF/NFS Shares
 
Hi all,

I've been trying to figure this out for a while and can't get anywhere. I've trolled the net and to be quite honest, I'm more confused now than when I started.

Basically, I'm trying to auto-mount a CIFS/NFS share(FrreeNAS & or Openfiler) at bootup on Ubuntu Desktop 14.04.1 LTS.

So far, I can mount it (able to add delete files) using the terminal using

Code:

sudo mount -t nfs -o proto=tcp,port=2049 192.168.0.100:/mnt/FreeNAS/unixset /home/dk/Documents/nfsmount/
I can't get it to auto-mount using the fstab file with

Code:

mount -a
Fstab file contains

Code:

//192.168.0.100/dk /media/nfsmount/ cifs uid=1000,gid=1000,credentials=/home/dk/.nfsmount01credentials,iocharset=utf8,sec=ntlm 0 0
The error I get is:

Code:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I also have a file (.nfsmount01credentials) that stores the username and password and assigned it permissions (chmod 600 .nfsmount01credentials). I've also tried both the ubuntu box and nas credentials.

As mentioned, and through loads of trial and error, I can't work it out.

Please help.

AlucardZero 08-26-2014 05:30 PM

Why are you manually mounting with NFS then trying stab with CIFS? Does CIFS mounting work when you do it manually? Why can't you just use NFS in fstab?

ferrari 08-26-2014 05:45 PM

Why don't you just mount the NFS share via an fstab entry? (You mentioned that it works from the command prompt.) BTW, You seem to be confusing NFS and CIFS with your fstab entry (based on references to NFS mountpoint and credential file naming).

1. Are you sure that //192.168.0.100/dk is the actual share?
Code:

smbclient -L 192.168.0.100
2. I note that you are trying to mount the cifs share within the /media tree. That is generally reserved for automatic device mounting utilized with modern desktop environments (eg udev/umount mounting). You should create/use a suitable mount-point eg /mnt/mydata, or even within your user's home directory eg ~/mydata

panher 08-26-2014 05:52 PM

: Response to Alucard

Good point. However, from what I've read and understand, linux in general has issues with nfs authentication. I just opted for the cifs option to avoid the hassles and differences of the various nfs versions. If you could please show me a way of how to do it in nfs that would be great.

The FreeNAS box has both CIFS and NFS shares setup. For now, I'm just trying to be able to auto-mount with either at bootup.

panher 08-26-2014 05:59 PM

Ferrari:

Thanks for your response.

Thanks for the media tip. As for the nfs shares, the dk is my linux username (picked that from some how to guide).

I have also tried this with same result

Code:

mount -t nfs -o proto=tcp,port=2049 192.168.0.90:/mnt/data/datashare/Data /home/dk/Documents/nfsmount/

ferrari 08-26-2014 06:19 PM

Quote:

As for the nfs shares, the dk is my linux username (picked that from some how to guide).
No, actually I was referring to your cifs fstab entry, where you had //192.168.0.100/dk. This implies dk is the actual share. Anyway, don't get confuesed. Let's stay with NFS now. :)

If this works
Code:

sudo mount -t nfs -o proto=tcp,port=2049 192.168.0.100:/mnt/FreeNAS/unixset /home/dk/Documents/nfsmount/
then you can generate a NFS fstab entry eg
Code:

192.168.0.100:/mnt/FreeNAS/unixset /home/dk/Documents/nfsmount/ nfs rw 0 0
BTW, when using 'mount -a', you need root credentials, so execute it like this
Code:

sudo mount -a

ferrari 08-26-2014 06:27 PM

Quote:

I have also tried this with same result

Code:

mount -t nfs -o proto=tcp,port=2049 192.168.0.90:/mnt/data/datashare/Data /home/dk/Documents/nfsmount/

I don't understand what you're trying to do above. The server:/share must match the export from the NAS device, and the mount-point must exist (ie have been previously created).

ferrari 08-26-2014 07:11 PM

Some useful NFS options explained in simple terms:

http://linoxide.com/file-system/exam...stab-etcfstab/

panher 08-27-2014 08:25 AM

Thanks for the brilliant pointer and wonderful resource. Worked like a charm.

Much appreciated.

Code:

192.168.0.100:/mnt/FreeNAS/unixset /home/dk/Documents/nfsmount/ nfs rw,hard,intr,rsize=8192,wsize=8192,timeo=14 0 0

ferrari 08-27-2014 01:53 PM

Glad to have been on help! :)


All times are GMT -5. The time now is 04:36 PM.