NFS share suddenly becomes unmountable - permission denied

Status
Not open for further replies.

balanga

Patron
Joined
Jul 10, 2014
Messages
271
I set up an NFS share a few months ago and have regularly written backups to it...

Now suddenly I get 'Permission denied when I try mounting it.

Any ideas as to what to look out for?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If you don't provide more info about your setup like the forum rules say then you won't get any help.

So far with the info provided I can tell you that you have a permission problem and should give that user access.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
[root@freenas ~]# showmount -e 192.168.0.4
Exports list on 192.168.0.4:
/mnt/nas/iso Everyone


[root@freenas ~]# cat /etc/exports
V4: / -sec=sys:krb5:krb5i:krb5p
/mnt/nas/iso -mapall=root:wheel
/mnt/nas/images -mapall=root:wheel


I can mount /mnt/nas/iso but not /mnt/nas/images although I was able to previously. I am not aware of making any changes.

I have restarted NFS but that made no difference.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
I've just deleted the second share I created and now I can access the first one....

Does this mean I can only have one NFS share?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You can have as many as you want. Try recreating it and see if it works.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
I must be doing something wrong because when I create the second NFS share, the first becomes inaccessible. Just tried it to make sure that the 'permission denied' problem is a result of creating the second NFS share.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
This definitely sounds like a problem.

Let's make sure you aren't doing something silly before going into bug report land.

Please go through step-by-step the process you are following to create the share.

Also, you need to give us a little more info about your setup: what datasets do you have? What is their relationship to the shares? What are the file permissions? Do you have other non-NFS shares setup?
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
OK - I'm sure I must be doing something wrong here as I can't believe I've found a bug...

I'm basically a FreeNAS newbie who has setup a home NAS for learning purposes. My system consists of a 2TB disk mounted as /mnt/nas. I have a single CIFS share as /mnt/nas/repo. It has default permissions, is browsable and allows guest access. I did try to set up two NFS shares as /mnt/nas/images and /mnt/nas/iso with permissions
mapall user - root, mapall group - wheel. When I run 'showmount -e 192.168.0.4' from another system only the last NFS share shows up


I just noticed this msg pop up in the GUI

Aug 14 21:48:23 freenas mountd[52912]: can't change attributes for /mnt/nas/images: MNT_DEFEXPORTED already set for mount 0xfffffe0023a2a9a8
Aug 14 21:48:23 freenas mountd[52912]: bad exports list line /mnt/nas/images -mapall

No idea what this means, but /etc/exports looks OK

[root@freenas ~]# cat /etc/exports
V4: / -sec=sys:krb5:krb5i:krb5p
/mnt/nas/iso -mapall=root:wheel
/mnt/nas/images -mapall=root:wheel
[root@freenas ~]#
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
Can anyone shed any light on what is happening?

If I set up an NFS share it works fine. If I set up a second that works fine but the first one becomes inaccessible.

showmount -e xx.xx.xx.xx only picks up the last line of /etc/exports
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
You never answered my questions.

Please explain the step-by-step instructions you are following to create your share.

What datasets do you have? What is their relationship to the shares? What are the permissions on the datasets?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You never answered my questions.

Please explain the step-by-step instructions you are following to create your share.

What datasets do you have? What is their relationship to the shares? What are the permissions on the datasets?
this ^

you are doing something wrong and if you don't tell us what you are doing we can't help.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
I did my best to explain my setup in my earlier msg. I'm not doing anything complicated, just going through the GUI, clicking on sharing, and adding a Unix share. One is /mnt/nas/images and the other is /mnt/nas/iso both set up with
-mapall=root:wheel. My system consists of a 2TB disk mounted as /mnt/nas.

I don't know what else you need.

I realise I must be doing something wrong but can't figure out what.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
I did my best to explain my setup in my earlier msg. I'm not doing anything complicated, just going through the GUI, clicking on sharing, and adding a Unix share. One is /mnt/nas/images and the other is /mnt/nas/iso both set up with
-mapall=root:wheel. My system consists of a 2TB disk mounted as /mnt/nas.

I don't know what else you need.

I realise I must be doing something wrong but can't figure out what.

Your are not reading what I wrote. The only question you answered was that you have CIFS share. None of the other questions.

You have provided no details about how your data is set up. Is /mnt/nas/images a dataset? Or is it just a folder in /mnt/nas?

When you say "I'm not doing anything complicated" that does not explain what you are doing. You have not provided detailed "step-by-step" instructions of what you are doing. When I say step-by-step, I mean step-by-step. What do you click on exactly, what are the settings you are putting in, exactly?

As far as permissions go, you haven't explained what permissions you have set up. What are you dataset permissions?

I mean, you haven't even told us what version of FreeNAS you are using here. We want to help you, but we can't help you unless you answer the questions that we are asking, not the questions you think we are asking.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
[root@freenas ~]# uname -a
FreeBSD freenas.local 9.3-RELEASE-p13 FreeBSD 9.3-RELEASE-p13 #0 r281084+3df1120
: Thu Jun 4 01:00:51 PDT 2015 root@build3.ixsystems.com:/tank/home/jkh/buil
d/FN/objs/os-base/amd64/tank/home/jkh/build/FN/FreeBSD/src/sys/FREENAS.amd64 am
d64

In the GUI:

System -> Information ->

System Information
Hostname freenas.local Edit
Build FreeNAS-9.3-STABLE-201506042008
Platform Intel(R) Pentium(R) CPU G3220T @ 2.60GHz
Memory 7960MB
System Time Sat Aug 22 17:03:27 BST 2015
Uptime 5:03PM up 4 days, 8 hrs, 0 users
Load Average 0.10, 0.04, 0.01


Sharing -> UNIX (NFS) -> Add Unix (NFS) Share -> Browse
select /mnt/nas/images
select Advanced Mode
select Mapall User -> root
select Mapall Group -> wheel
select OK

/mnt/nas/images appears as a Unix share

I can then mount this from a remote system

If I subsequently add a second Unix share doing exactly the same as above but selecting /mnt/nas/iso then I have two path entries in the GUI,
but immediately after adding the second a log msg pops up on the GUI at the bottom of the screen:-

Aug 22 17:50:20 freenas mountd[1660]: can't change attributes for /mnt/nas/images: MNT_DEFEXPORTED already set for mount 0xfffffe0005a6d000
Aug 22 17:50:20 freenas mountd[1660]: bad exports list line /mnt/nas/images -maproot

and I can no longer access the first share.

The permissions for /mnt/nas are

Owner Group Other
Read x x x
Write x
Execute x x x

owner is root, group is wheel.
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Are /mnt/nas/iso and /mnt/nas/images different datasets or are they subfolders in the same dataset? I'm thinking that your problem here is that they are subfolders, and instead should be datasets.

Why are you setting the mappall user and group? If you don't set those, does it change anything?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Are /mnt/nas/iso and /mnt/nas/images different datasets or are they subfolders in the same dataset? I'm thinking that your problem here is that they are subfolders, and instead should be datasets.

Why are you setting the mappall user and group? If you don't set those, does it change anything?
This is cool, I wonder if you are using two folders and not datasets? I have a feeling that the way the export is getting created has issues when there are two exports for different folders on the same filesystem/dataset. When creating exports of this nature they must be specified on the same line in the exports file on the system. FreeNAS might be trying to specify them as different entries on the export file.

I vote you should file a bug for this.
 

balanga

Patron
Joined
Jul 10, 2014
Messages
271
Are /mnt/nas/iso and /mnt/nas/images different datasets or are they subfolders in the same dataset? I'm thinking that your problem here is that they are subfolders, and instead should be datasets.

Why are you setting the mappall user and group? If you don't set those, does it change anything?

To be honest I'm completely confused about volumes and datasets. My old school understanding of storage consists of a hierarchy of disk - partition - directory - file...

When adding a Unix share there is no mention of any datasets in the GUI - just a prompt for a path.

Am I supposed to create a new dataset every time I add a Unix share? And if I have directories /mnt/nas/images and /mnt/nas/iso in the same dataset how do go about moving the files from those two directories into different datasets?
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
To be honest I'm completely confused about volumes and datasets. My old school understanding of storage consists of a hierarchy of disk - partition - directory - file...

When adding a Unix share there is no mention of any datasets in the GUI - just a prompt for a path.

Am I supposed to create a new dataset every time I add a Unix share? And if I have directories /mnt/nas/images and /mnt/nas/iso in the same dataset how do go about moving the files from those two directories into different datasets?

Disk->Partition->Directory->file is a very Windows way of looking at data. *nix is instead all about mounting different file systems into a single, system-wide file system. The difference between /mnt/nas/images as a folder and /mnt/nas/images as a dataset isn't the path. Symlinks between devices (both physical and virtual), and that sort of thing.

You'll know if they are different datasets, because you'd have created them. You can see your datasets if you look under Storage->Volumes->/mnt/nas/: http://doc.freenas.org/9.3/freenas_storage.html#create-dataset

In the ZFS paradigm, you should use datasets to separate data into same-type pools, because datasets are the smallest organizational unit (which sets snapshots, deduplication, compression, etc.). For example, if you are distinguishing between images and isos as different kinds of CD/DVD images, you probably want those in the same dataset, because they are large files that don't change very regularly, and (depending on your use) may not be deleting very commonly or need very fast write speed. That tells you that you could probably get away with a high amount of compression, but deduplication would be useless.

On the other hand, if you distinguish between iso and images as CD/DVD images and pictures, then you'd want them in different datasets. If you regularly write to your images (pictures) folder, you probably don't want super high compression, because that would slow down write speeds. Deduplication probably wouldn't help. However, if you care about your images a lot more than your isos, you'll probably set a more aggressive snapshoting on your pictures folder than your iso folder.

And so on, and so forth.

I completely agree with SweetAndLow: if they aren't different datasets, you should file a bug: https://bugs.freenas.org/projects/freenas I have no problem with two CIFS shares from the same dataset, so NFS shares shouldn't be a problem.

However, you don't "have" to mount directly to the share in NFS. You can share /mnt/nas, and then mount /mnt/nas/folder1 and /mnt/nas/folder2 directly.
 

boricuastock

Cadet
Joined
May 6, 2013
Messages
3
This is cool, I wonder if you are using two folders and not datasets? I have a feeling that the way the export is getting created has issues when there are two exports for different folders on the same filesystem/dataset. When creating exports of this nature they must be specified on the same line in the exports file on the system. FreeNAS might be trying to specify them as different entries on the export file.

I vote you should file a bug for this.

After months of having this setup I ran into the same issue posted here. I am on an older build (9.2.1) and I am running it as a domU in xen, but I had 3 NFS mounts pointing to the same dataset (just had different dircetories. I deleted them all and created a single NFS and allowed all directories and the issue went away. I had rebooted and just started having the issue. Thanks to everyone who posted and helped me resolve this!
 
Status
Not open for further replies.
Top