Recycle bin only keeps folders, files do not appear in recycle bin

Status
Not open for further replies.

groo5

Cadet
Joined
Jun 14, 2012
Messages
1
Hello

I wish to use the recycle bin with CIFS shares. The recycle bin seems to work however there are only folders in the bin, there are absolutely no files. So it is basically useless.

I only have this problems with one volume ZFS, the others work fine.
If I turn off the export recycle bin it stops making the folders and if restarted it makes the folders in the recycle once again.

The same problem has occurred with current version 8.3.1 and older version 8.2.

Can some one help me to get the files to also appear in the recycle folder.

Thank you

Simon
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Have you tried to access the folders from the CLI as root? The files may be there and you simply don't have access to view them.

I really don't know how youd get folders but no files. I've had no problem with the recycle bin feature of Samba since I started using it in 8.0.4.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Are you seeing the folders with no files through CIFS? If so, I had a similar issue and discovered it was permission issue and it was resolved once I had my permissions setup right.
I've also noticed an update delay issue. When I delete stuff through the CLI, CIFS typically won't reflect that until a certain period of time. I'm usually not patient enough to wait it out and just instead restart the daemon.
So you could try restarting the daemon also and see if that makes a difference.

I didn't even know that feature existed. I had to do a quick check on the web admin and sure enough, there's the "Export recycle bin" check box, lol.
Looks like an interesting feature, I may try to use it. What directory do the files get exported to when you trash them?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I've always had files appear there instantly once I "delete" them.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Which directory does it get exported to? I'm thinking of enabling it.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
In the root of the share a folder called .recycle will be created and will have any files "deleted" from that share.

So if you share out /mnt/tank/Whattteva and you delete the directory at /mnt/tank/Whattteva/somefolder you'll end up with a folder location at /mnt/tank/Whattteva/.recycle/somefolder.

Keep in mind this is per share. So the associated share that you actually performed the delete on will have the .recycle folder. If you have alot of shares you can potentially have alot of .recycle folders.

They are not self emptying and there is no limit to how much data can be stored in them. I have a script that auto-empties my .recycle folders after a file has been there for 3 days.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Oh, that sounds pretty annoying. I guess I'm not going to bother using it after all.
 

one33_bpm

Cadet
Joined
Nov 20, 2013
Messages
7
Hello!
(longtime reader of these forums, but recently happened across a situation that i am having a difficult time solving on my own)

I am having the same problem described by the OP. I may be wrong, but in my case it appears that this is only occurring for datasets that within datasets... For example, within the ZFS volume 'zDisk', i have the following datasets:

zDisk/media (CIFS share)
zDisk/media/video
zDisk/media/photo
zDisk/media/audio
zDisk/software (CIFS share)

So when i delete something from within [video, photo, audio], media/.recycle only contains directories, and no files. However, deletions from the software share result in a files and folders in its respective .recycle directory. I have played with the permissions (chmod 777/755) and get no difference in behaviour. I am thinking that it has something to do with deleting files from the interior dataset, but the CIFS share (and hence the .recycle directory) are in the exterior dataset.

zDisk is owned by root/wheel
zDisk/* is owned by userx/userx

I am not seeing any indicators in /var/log/messages or dmesg

Any thoughts?

thanks!
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I am thinking that it has something to do with deleting files from the interior dataset, but the CIFS share (and hence the .recycle directory) are in the exterior dataset.
That's basically correct, the problem here is that the Samba vfs_recycle module is not able to move files across filesystem/dataset boundaries. When the deleted file and the .recycle directory are in different datasets the move fails.
I am not seeing any indicators in /var/log/messages or dmesg
Enabling full vfs_recycle logging reveals this:
[panel][2013/12/24 12:43:12.262971, 10] modules/vfs_recycle.c:640(recycle_unlink)
recycle: Moving dataset1/test to .recycle/nobody/dataset1/test
[2013/12/24 12:43:12.263015, 3] modules/vfs_recycle.c:646(recycle_unlink)
recycle: Move error 18 (Cross-device link), purging file dataset1/test (.recycle/nobody/dataset1/test)[/panel]
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I added a note about this situation to the FreeNAS manual.
 

one33_bpm

Cadet
Joined
Nov 20, 2013
Messages
7
Dusan,
Thanks for confirming my suspicions. Fortunately, there was no good reason to maintain the distinct datasets, so i am merging them into a single dataset.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't run datasets at all. :P
 

one33_bpm

Cadet
Joined
Nov 20, 2013
Messages
7
I don't run datasets at all. :p

When I looked at the nature of my data, It made sense to use separate datasets to differentiate compression and snapshots for media and non-media. I still have separate top-level datasets, but no more interior datasets.
 
Status
Not open for further replies.
Top