SOLVED NFS share issues between FreeNAS and Ubuntu 16.04 server

Status
Not open for further replies.

nullthegrey

Cadet
Joined
Sep 12, 2016
Messages
2
Hi all,

I've been having some issues since I set up an NFS share on my FreeNAS ( FreeNAS-9.10.1 (d989edd) )device. I can map the NFS share on my Ubuntu server, no problem, and I can create files directly on the share, also without problems. What I cannot seem to do is download to it using LFTP or copy files over to it. I get an error like:

Code:
cp: cannot create regular file 'Media/download/test.asc': Operation not permitted


But as I said, I can do this with no apparent issue:
Code:
jabber@ubuntu:~/Media/download$ dd if=/dev/zero of=test.asc bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.711647 s, 147 MB/s


The way I have my dataset set up in FreeNAS is this:
upload_2016-9-12_13-38-56.png


In the NFS sharing section I have this:
upload_2016-9-12_13-45-32.png


I'm not overly concerned about Security, I just need this to work. It's just a home network, sharing out my media files. I'm not really sure where to go from here. I've chown-ed all the files to root:wheel recursively, still cannot figure out what is going on. I mount it in Ubuntu with this command:
Code:
sudo mount -t nfs 192.168.1.101:/mnt/ZPOOL/Media /home/jabber/Media


I should also add that I noticed another ODD behavior. If I try to copy my 100M dummy file, test.asc, I get the Operation not Permitted error. However it DOES make a file, just empty. Then if I attempt to copy the file again, It actually copies it.
Code:
jabber@ubuntu:~$ cp test.asc Media/download/
cp: cannot create regular file 'Media/download/test.asc': Operation not permitted
jabber@ubuntu:~$ ls -l Media/download/
total 72
drwxrwxrwx 9 root root 9 Sep  8 08:26 chillhop
drwxrwxrwx 2 root root 2 Sep 12 11:24 Movies
-rwxrwxrwx 1 root root 0 Sep 12 13:54 test.asc
drwxrwxrwx 2 root root 2 Sep 12 11:41 TV
jabber@ubuntu:~$ cp test.asc Media/download/
jabber@ubuntu:~$ ls -l Media/download/
total 72
drwxrwxrwx 9 root root  9 Sep  8 08:26 chillhop
drwxrwxrwx 2 root root  2 Sep 12 11:24 Movies
-rwxrwxrwx 1 root root 104857600 Sep 12 13:54 test.asc
drwxrwxrwx 2 root root  2 Sep 12 11:41 TV
jabber@ubuntu:~$
 
Last edited:

nullthegrey

Cadet
Joined
Sep 12, 2016
Messages
2
Well, I think, after some further work, I was able to determine what the problem was finally. I'll post my findings here so that others may benefit, should they happen to have the same perfect storm of nonsense :p

So, after I posted the above, I continued to tinker. Eventually I just got to the shell of the FreeNAS box itself and started trying to run some chmod and chown commands. However, I could not even run the command there as root! I got the same "Operation not permitted" error. So this got me thinking. I mean if I can't even change the file permissions as root on the box itself, something is definitely wrong.

It got me thinking about other types of permissions, like ACLs. I had originally set this up as a Windows share, and I don't recall actually SETTING any permissions on the share, but that may make no difference. I converted it to a Unix share and then added all my data. At any rate I ran getfacl on some of the file and directories, and sure enough, they were all over the place.

so I ran a setfacl -R -b /mnt/ZPOOL/Media and I was then able to copy and write to any directory in there on the NFS share.

It was a long road, but I think I got it fixed. Hopefully this can save someone else some pain down the road. Basically on FreeNAS, you can have different kinds of share permissions and just because you've gone through the web interface to change it from one type to another doesn't mean the original permissions are not still there. Windows (or unix) ACL won't show up in the ls -l output, and aren't affected by chmod, you'll need getfacl, and setfacl to change those.
 
Last edited by a moderator:
Status
Not open for further replies.
Top