Permissions problem. Building program from RPi on FreeNas NFS Share

keithg

Explorer
Joined
May 15, 2013
Messages
92
I have been using my Freenas 11.2-U5 for sharing music and pictures etc. From time to time I run into permissions problems on NFS or CIFS shares and I just power through by logging into the NAS via SSH and adjusting permissions to do what I need to do. Currently, I have a NFS share mounted on a RPi and want to build some programs in this mounted share using mapkpke on the RPi. I have the NFS share set with Mapall user 'root' and Mapall group 'wheel' (right or wrong, that is what I have). I mount it from the RPi with this line in my fstab:
Code:
192.168.2.198:/mnt/first_NAS/Rune_dev /Rune_dev nfs rw 0 0 

When I git pull then build, it works fine sometimes. Some packages, though, require a change of ownership when running the script in makepkg and I get this error when it tries:

Code:
/AUR/aixlog]$ makepkg
==> Making package: aixlog 1.2.1-2 (Sun 04 Aug 2019 12:10:04 PM CDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v1.2.1.tar.gz
==> Validating source files with sha256sums...
    v1.2.1.tar.gz ... Passed
==> Extracting sources...
  -> Extracting v1.2.1.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
install: cannot change ownership of '/Rune_dev/AUR/aixlog/pkg/aixlog/usr/include/aixlog.hpp': Invalid argument
==> ERROR: A failure occurred in package().
    Aborting...

edit: Another issue is very similar with group ownership with patching code and it returns:
Code:
...
patching file Makefile
patch: **** Failed to set the owning group of file ./Makefile.oRgGY8H : Invalid argument
==> ERROR: A failure occurred in prepare().
    Aborting...


my guess is that the script is trying to change the ownership of a file while in 'fakeroot' or even while patching and cannot do so as permissions are controlled by the NAS. All subsequent files are owned by nobody:nobody when I 'ls' the directory on the RPi. When I am on the NAS and run 'ls', all files are owned by root:wheel (as expected). I tried changing the settings to mapall user to kgrider (me) and mapall group to wheel' and now when I ls from the NAS it reports all fiels owned by kgrider:kgrider (yes, I am member of the wheel group on the NAS)

Is there a way to create my share so that I can change ownership properly from the RPi? My user on the RPI is alarm. I have struggled with this for years and read a ton of stuff on permissions. I understand some of it, but always seem to get hung up on this when trying to chmod or chown from a client to any share on the NAS.

Keith
 
Last edited:

keithg

Explorer
Joined
May 15, 2013
Messages
92
anyone, no one?
This is really frustrating. I can do almost everything, but any reference to chown crashes the builds. Some AURs build fine, but any use of 'patch' and some use of tar will crash it.
One is this:
Code:
==> Starting prepare()...
patching file src/adapter.c
patch: **** Failed to set the owning group of file src/adapter.c.oi1F92a : Invalid argument

I have tried setting mapall user to me (kgrider=uid1001) and alarm(uid=1000 on both the Pi and NAS) with mapall group to 'wheel' and get the same result each time. When I tried 'map root user' I get more problems. Both users on the NAS have full read write access. When I 'ls' the files on the Pi, they all show as owned as nobody:nobody, but on the NAS, they show owned by alarm:wheel (currently). Is this issue completely on the Pi? Whenever any chowm or chgrp command seems to be issued, it crashes.

My current line from the /etc/fstab on the Pi is:
192.168.2.198:/mnt/first_NAS/Rune_dev /Rune_dev nfs4 _netdev,rw 0 0

and I get the same result. Please any suggestions to point me to a solution is appreciated.

Keith
 

keithg

Explorer
Joined
May 15, 2013
Messages
92
well, I gave up on nfsv4. It is too complicated. I added vers=3 to the fstab line and now I can make packages. If a concise answer as to how I can use nfsv4 for thsi is out there, please point me to the link or a solution.

Thanks

Keith
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
One of the big differences from nfs to nfsv4 is the mapping of the owners. In nfs it is done with the UID/GUID
while with NFSv4 it is done via username/groupname.

Also NFSv4 requires a running idmapd on the client to work correctly.

All users/groups have to exist on the client and server, otherwise they are mapped to nobody/nogroup.

I'm not so familiar with the mapall option, but if it is forcing all the ownership to one single user,
I highly doubt a chown/chgrp will work.
 
Top