I use TrueNAS-SCALE-24.04.2
First, I create a user user1:group1
root@truenas[~]# groupadd -g 3001 group1
root@truenas[~]# useradd -u 3001 -g 3001 user1
create a zpool names mypool
root@truenas[~]# dd if=/dev/zero of=/root/zfs.raw count=204800
root@truenas[~]# zpool create mypool /root/zfs.raw -m /mnt/mypool
Through the mount -v command, you can see that the nfsv4 protocol is adopted by default.
root@truenas[~]# mount -v
...
mypool on /mnt/mypool type zfs (rw,relatime,xattr,nfs4acl,casesensitive)
...
I use “user1” to write a “test.txt” file into zfs. You can see that the user of this file is “user1”, but the group is “root”. This is very strange because the main group of “user1” is “group1”, not “root”.
root@truenas[~]# chmod 777 /mnt/mypool
root@truenas[~]# sudo -u user1 touch /mnt/mypool/test.txt
root@truenas[~]# ls -l /mnt/mypool
total 1
-rw-r--r-- 1 user1 root 0 Sep 8 22:49 test.txt
I changed the “acltype” of mypool to “posixacl” and touch a new fiile names “test2.txt”, and it was normal.
root@truenas[~]# zfs set acltype=posixacl mypool
root@truenas[~]# mount -v
...
mypool on /mnt/mypool type zfs (rw,relatime,xattr,posixacl,casesensitive)
...
root@truenas[~]# sudo -u user1 touch /mnt/mypool/test2.txt
root@truenas[~]# ls -l /mnt/mypool
total 1
-rw-r--r-- 1 user1 root 0 Sep 8 22:49 test.txt
-rw-r--r-- 1 user1 group1 0 Sep 8 22:58 test2.txt
I am not sure if this is a problem with this version of TrueNas or a problem with the linux kernel, but at least I did not find this problem on ubuntu22. what’s going on?