Files does not get deleted

Hi guys.
I am running truenas core as a main file server of my network using SMB shares.

I have set windows permission as modify for a group, and everthing works fine except file deletion. I can delete but after a refresh the file shows up again.

The only option that I´ve changed in the share parameters was to set export recycle

Share parameters

Any ideia how to overcome this behavior?

I have observed that the system is generating numerous .tmp files in the directories.

folders_tmp_files

I found a solution changing SMB Purpose on SMB Edit from no presets to Default Share parameters and then restart SMB services. All those strange behaviours has gone.

Is this a bug ? because the only thing that changed from no preset to default share is that some options gets available like choose like Export Recycle Bin option that was my intention of use

This most likely means that your user lacks ability to write to its own recyclebin. We try to fail safe. If file can’t be recycled, then we don’t recycle and don’t delete the file.

@chrispaiva Check into the behavior with “export recycle bin” checked in the Docs site.

Files are renamed into a hidden .recycle directory on a per-user basis - check to see if your users have the ability to create these directories at the root level.

root@mini-r[/mnt/ssdpool/testmesmb/.recycle/chris]# ls -al
total 2
drwxrwx--- 2 chris root 3 Oct 21 13:31 .
drwxrwx--- 3 chris root 3 Oct 21 13:31 ..
-rwxrwx--- 1 chris root 8 Oct 21 13:31 deleteme.txt

I will give it a try and check how the permissions are created after recycle bin option set and them I get back here to say something about it.

I tried to change .recycle permissions but I get the following errors

# sudo chmod -R 777 .recycle

Sorry, user root is not allowed to execute ‘/bin/chmod 777 .recycle’ as root on SRV-FS-TRUENAS.acpr.local.

# chmod -R 777 .recycle

chmod: .recycle: Operation not permitted

That’s because you’ve set an ACL on it and the dataset has the restricted ZFS aclmode. You can setfacl -b .recycle then chmod it if you need to.

2 Likes

Thanks Andrew, your tip did the job.

I think there should be some correction regarding this behavior, because I deleted the .recycle folder, and when it is created automaticaly, the permissions are not set correctly. I had to manually run it with your stay and then i can have access.