Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

17 minutes ago, dlandon said:

What is your use case?

Everything across each share, including the Recycle Bin, is being backed up by my backup software. While I could exclude the folder, doing so for every new share would get tiresome. If I could relocate these files to an other share, let's say a Recycling Bin share, it would make maintenance simpler.

Link to comment
3 minutes ago, Falloutman said:

Everything across each share, including the Recycle Bin, is being backed up by my backup software. While I could exclude the folder, doing so for every new share would get tiresome. If I could relocate these files to an other share, let's say a Recycling Bin share, it would make maintenance simpler.

It is setup to be a .Recycle.Bin per share.  That's how the Samba recycle bin works.  It currently can't be a recycle bin for all shares.  Just exclude the Recycle.Bin folders in your backups.

Link to comment
  • 2 weeks later...

I’m running 6.11.5, and after updating the plugin to 2023.02.20, I’m still having instances of folders in the recycle bin with their files missing.  However, my usage is probably uncommon.  My apps are configured to use user shares, but interactively, I use disk shares.

 

During testing, deletes were done from a Windows client.  In all test cases, I am deleting:

  \\Servername\DiskOrPoolName\UserShare\FolderWithFile

 

If the user share resides on an array disk (they are all Use cache pool=no), the folder and file show up in the disk’s .Recyele.Bin folder as expected.

 

If the user share resides on the cache pool (they are all Use cache pool=only), the folder appears in the pool’s .Recycle.Bin without the file.

 

The strange thing is, during testing I created a new user share in the cache pool, and it is working as expected.

 

None of my other pools had previously defined user shares, and newly defined shares work ok.

 

tower7-diagnostics-20230403-1145.zip

Capture.PNG

Edited by aim60
Link to comment
3 hours ago, aim60 said:

I’m running 6.11.5, and after updating the plugin to 2023.02.20, I’m still having instances of folders in the recycle bin with their files missing.  However, my usage is probably uncommon.  My apps are configured to use user shares, but interactively, I use disk shares.

 

During testing, deletes were done from a Windows client.  In all test cases, I am deleting:

  \\Servername\DiskOrPoolName\UserShare\FolderWithFile

 

If the user share resides on an array disk (they are all Use cache pool=no), the folder and file show up in the disk’s .Recyele.Bin folder as expected.

 

If the user share resides on the cache pool (they are all Use cache pool=only), the folder appears in the pool’s .Recycle.Bin without the file.

 

The strange thing is, during testing I created a new user share in the cache pool, and it is working as expected.

 

None of my other pools had previously defined user shares, and newly defined shares work ok.

 

Why are you deleting files on your dsk, cache, or pool device?  You should only delete files in the user shares, no matter where they are residing.  A delete of \\Servername\DiskorPoolName/UserShare\fileorfolder is not the same as \\Servername\UserShare\fileorfolder.  For best management of the recycle bin, you should only delete from \\Servername\UserShare\.  The deleted files and folders will go to the \\Servername\UserShare\.Recycle.Bin\ folder.  If you delete from the disk, cache, or a pool device, the deleted files and folders will go to the \\Servername\DiskorPoolName\.Recycle.Bin\ folder.

 

You need to turn off Disk sharing and just stick with the user shares shown when browsing the \\ServerName.

Link to comment
  • 2 weeks later...
3 hours ago, jcofer555 said:

every time i empty the recycle bin it seems to do a mini smb reset or something as any encodes i have going in my vm that i run handbrake in with the loading and saving of the files coming from an smb share errors out and has to be reset.

The only time samba is restarted is when the recycle bin is stopped and started.  I'm probably going to change that.

Link to comment
21 minutes ago, jcofer555 said:

any idea why it would error out my handbraking? it happens every single time i empty recycle bin.

All the empty recycle bin does is delete files in the .Recycle.Bin folder.  Is handbrake accessing a file that ended up in the Recyle Bin?  Install the open files plugin and see if handbrake is accessing any files moved to the Recycle Bin before you empty it.

Link to comment
On 4/12/2023 at 3:31 PM, dlandon said:

All the empty recycle bin does is delete files in the .Recycle.Bin folder.  Is handbrake accessing a file that ended up in the Recyle Bin?  Install the open files plugin and see if handbrake is accessing any files moved to the Recycle Bin before you empty it.

not seeing any files open by handbrake, also i tried enabling another setting and it also resets the jobs in my handbrake but other plugin changes do not have this effect so it's something specific to this recycle bin plugin:(

it seems to affect any vm, even my qbittorrent errors out when i change any setting or empty.

just did your update and that fixed it ty ty ty

Edited by jcofer555
additional information
Link to comment
  • 2 weeks later...
1 hour ago, TheJavarian said:

Hello dlandon,

 

I just installed the plug-in, however, it only works for Unassigned Share.

Could you take a quick look at my diagnostics data?

I also included a screenshot of the settings.

 

I really appreciate what you are doing here.

 

1885825130_RecycleBinSetting.thumb.png.8b4ee79e8715f170bcbdffa8804d927d.png milkyway-diagnostics-20230425-1717.zip 347.65 kB · 0 downloads

Post the output of this command:

testparm -s

 

Link to comment
On 4/26/2023 at 7:43 AM, dlandon said:

The recycle bin is set up properly.  Keep in mind that a file with zero length will not be put into the recycle bin when it is deleted.

Thank you dlandon,

It turned out I should have restarted my unraid box after installing the plug-in. After the restart, all working fine. Sorry for the false alarm.

Link to comment
  • 3 weeks later...

For those who like to disable the "Hide dot files" SMB setting:

 

image.png.f8b30b66f9abeea217078d71eb78e5a8.png

 

But want to hide the Recycle Bin folder for the user, can add "veto files" to their SMB Settings > SMB Extras Config:

 

# disable access to recycle bin directory
veto files = /.Recycle.Bin

 

 

 

Link to comment
On 5/18/2023 at 9:31 AM, mgutt said:

For those who like to disable the "Hide dot files" SMB setting:

 

image.png.f8b30b66f9abeea217078d71eb78e5a8.png

 

But want to hide the Recycle Bin folder for the user, can add "veto files" to their SMB Settings > SMB Extras Config:

 

# disable access to recycle bin directory
veto files = /.Recycle.Bin

 

 

 

I've added a Recycle Bin setting to hide the .Recycle.Bin folder in the next release.

  • Like 1
Link to comment

All of my recycle folders seem to have disappeared from my folders when browsing via Windows since the last update.

I just had to reboot the server for another issue and my recycle folders are still not showing up anymore.

I've tried restarting the service itself without issue. It's showing sizes for the folders I've deleted things from.

I can view shares in Unraid via Shares and see the recycle bin folder, and I'm able to view/browse the share from Unraid GUI and see files/folders in the recycle bin.

Unraid versino 6.11.5

Recycle bin plugin version: 2023.5.20

Link to comment

not really sure how to put this but my recycle bin was working great and i could see it from directory opus (explorer replacement)

i had to restart in safe mode to fix something and after rebooting to normal mode the recycle bin has vanished and am unable to acess .Recycle.bin from the mapped drive nor from browsing to it from network i havnt tryed restarting unraid as of yet but did update the plug in

 

 

 

 

 

 

 

 

image.png.d9814a2001059af4301494b2f6c87b9a.png

 

 

 

 

 

Link to comment

so i uninstalled the plugin  reinstalled   the error came back

 

i uninstalled deleted the plugin off the flash drive  and rebooted

 

reinstalled... and the error above comes back

 

and not sure if its releated to the vnc crashing i having...  not sure whats all getting affected

 

almost have to re do the entire server  or maybe try different ram i might try

Link to comment
11 minutes ago, comet424 said:

i was able to fix the error..  apparently it didnt like the 2  recycling bins on the disk..  when i delete the .recyclin.bin    and uninstalled and reinstall the recycling bin app   the error hasnt come back

 

trash can2.JPG

The .Recycle.Bin is the one this plugin uses for deleted files.  I'll take a look and see if I can reproduce the error.  So far I've not been abe to reproduce the error.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.