Latest interface: 0.3.1
Latest system: 010
j.hoekstra
User

9 posts

Posted on 12 August 2015 @ 14:59
Hi,

I've been struggling with using ZFSGURU as an fileserver for a linuxsystem, I'd like the NFSmount to behave as a 'normal' device(like ie mdraid).

ZFSguru version 0.2.0-rc
Running official system image 10.1-001 featuring FreeBSD 10.0-STABLE with ZFS v5000.
Running Root-on-ZFS distribution.
Virtualized under VMware Workstation!(ESXI 5.5)
64-bit dual core Intel(R) Xeon(R) CPU E31260L @ 2.40GHz - Running at MHz ( scales from 300 MHz to 2400 MHz )
8 GiB physical memory, 7.7 GiB usable
8 normal harddrives(2 TB WD-GREENS 2b replaced soon ;))

cat /etc/zfs/exports
# !!! DO NOT EDIT THIS FILE MANUALLY !!!

/ZFS_12TB/share -alldirs -mapall=1000:1000 -network=192.168.1.5/32
/ZFS-48GB/share -alldirs -mapall=1000:1000
(taking out the -mapall argument doesn't affect the situation on the client it seems)

### NFS share zfsguru
192.168.1.102:/ZFS-48GB/share /mnt/ZFS nfs rw 0 0
192.168.1.102:/ZFS_12TB/share /RAID nfs defaults,user 0 0

Both machines are on the same host, don't mind the mount point or the options, they have the same effect.

Mounting is no problem, every file / dir is mapped to user 1000 as you can see above, however since I intend to use this setup with other programs on the linuxhost as well I sometimes have to change fileownership etc.
This is however not allowed:
jos@EAUROUGE:~$ sudo touch /mnt/ZFS/TEST/test.test2
jos@EAUROUGE:~$ sudo ls -alh /mnt/ZFS/TEST/test.test2
-rw-r--r-- 1 jos jos 0 Aug 12 14:47 /mnt/ZFS/TEST/test.test2
jos@EAUROUGE:~$ sudo chown root.root /mnt/ZFS/TEST/test.test2
chown: changing ownership of `/mnt/ZFS/TEST/test.test2': Operation not permitted

A solution to this problem would be to add no_root_squash in linuxland, I don't see how to do that on ZFSGURU(editing the command on webif to read "/sbin/zfs set sharenfs="-alldirs -no_root_squash" ZFS-48GB/share" results in permission denied when mounting).

TBH I don't know where the problem exactly lies, can anybody point me in the right direction?

CiPHER
Developer

1199 posts

Posted on 12 August 2015 @ 18:51
Mounting is no problem, every file / dir is mapped to user 1000 as you can see above, however since I intend to use this setup with other programs on the linuxhost as well I sometimes have to change fileownership etc.
This is however not allowed:
You cannot use both the 'mapall' parameter and use chown. If you use mapapp, then all files will be of one owner. If you want to have (remote) control over ownership, then do not use mapall!

ZFSguru uses 'Easy Permissions' to allow casual users to use NFS together with Samba without any permission problems, which are frequent when combining file access from multiple protocols.

However, you can de-select the 'Use Easy Permissions' checkbox to revert to normal UID/GID behavior.

Does this address your issue? Try without the mapall and see if it works as expected.
j.hoekstra
User

9 posts

Posted on 13 August 2015 @ 11:35
Taking out the -mapall feature doesn't take care of this, I still get the same error.

Let me rephrase the question: "If I want to be able to use the NFS-exported filesystem as if it were a local filesystem(like a diskmount), how would I export it and mount it?"
CiPHER
Developer

1199 posts

Posted on 13 August 2015 @ 12:28edited 12:29 16s
Ok, i just read the manual page (man exports) and it says:


In the absence of -maproot and -mapall options, remote accesses by root
will result in using a credential of -2:-2. All other users will be
mapped to their remote credential. If a -maproot option is given, remote
access by root will be mapped to that credential instead of -2:-2. If a
-mapall option is given, all users (including root) will be mapped to
that credential in place of their own.



So try without '-mapall=1000:1000' but with '-maproot=root'.

Would that give you access to remote chown?
j.hoekstra
User

9 posts

Posted on 13 August 2015 @ 12:41
That indeed works!
Mounting seems a bit slow, but that might be because of current systemload.

Thanks very much :)
DanielMd
User

5 posts

Posted on 5 December 2018 @ 07:50edited 07:50 38s
I was facing the same problem but when I read this article I learned this method of file exportation in Linux servers and thats an achievement for me and visit https://edubirdie.org/ site to get writing tips for students. I am wondered along with thankful to you for presenting this amazing article. Hope to see your articles again in future. Thanks
Last Page

Valid XHTML 1.1