How can I set permissions via the shell [solved]

I have a small problem with the permissions for some files in my pool.
To explain this, however, I need to go into more detail.
I had an old TrueNAS hard drive with important data.
Then I built a current TrueNAS SCALE system, installed the old hard drive there and then copied the data directly to the new pool using the shell and ‘mv’ (and as root).
Only then did I realise that I had not yet created a dataset for the new pool.
So I made up for this and copied some of the files into the new dataset again using ‘mv’.
As a test, I then created a Samba share and tried to open a file with my Windows PC.
This doesn’t work because I don’t have the rights, I can’t even open a folder.
Then I looked at the rights and realised that the files have no rights at all.

admin@truenas[~]$ ls -all /mnt/streaming/Filme 
total 55815147
drwxrwx--- 2 root root           6 Oct 23 00:32  .
drwxr-xr-x 6 root root           6 Oct 23 00:26  ..
---------- 1 wpc  root  4676746995 Feb 27  2009  Chiko.mkv
---------- 1 wpc  root  7028626178 Jan 30  2009 'Der Mongole.mkv'
---------- 1 wpc  root  9595546602 Apr 22  2009  Hero.mkv
---------- 1 wpc  root 36262915136 Nov 10  2018 'Tiger and Dragon.mkv'
admin@truenas[~]$ sudo setfacl -m u:wpc:rwx /mnt/streaming/Filme 
[sudo] password for admin: 
setfacl: /mnt/streaming/Filme: Operation not supported
admin@truenas[~]$ sudo setfacl -m u:wpc:rwx /mnt/streaming/Filme/*
setfacl: /mnt/streaming/Filme/Chiko.mkv: Operation not supported
setfacl: /mnt/streaming/Filme/Der Mongole.mkv: Operation not supported
setfacl: /mnt/streaming/Filme/Hero.mkv: Operation not supported
setfacl: /mnt/streaming/Filme/Tiger and Dragon.mkv: Operation not supported
admin@truenas[~]$ chmod 777 /mnt/streaming/Filme/*
chmod: changing permissions of '/mnt/streaming/Filme/Chiko.mkv': Operation not permitted
chmod: changing permissions of '/mnt/streaming/Filme/Der Mongole.mkv': Operation not permitted
chmod: changing permissions of '/mnt/streaming/Filme/Hero.mkv': Operation not permitted
chmod: changing permissions of '/mnt/streaming/Filme/Tiger and Dragon.mkv': Operation not permitted

As you can see, it was not possible for me to change the rights of the files.
What can I do?
How do I make these files available for my network?

Have you tried setting this up using the UI instead?
Going to Datasets (Are you using SCALE?) → Select the dataset in question → Permissions (Edit) and apply the permissions recursively.

chmod is not going to work on any dataset with the ACL mode set to Restricted.

setfacl is also wrong command for NFSv4 acltype (nfs4xdr_setfacl).

1 Like