Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

Quiet easy. In /etc/fstab I have

 

//XXXXX/XXXXX     /media/XXXXX       cifs        vers=3.1.1,username=XXXXX,password=XXXXX,user,uid=1000        0       0

 

and Linux is doing the rest.

 

The vers=3.1.1 statement I added this evening because I got aware, that Windows is using SMB vers 3.1.1 and Linux only 3.0.2 by default. But unfortunately nothing improves by having 3.1.1 also an Linux.

 

If I execute smbstatus at the Unraid console, it now looks like this:

 

Samba version 4.9.5
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing              
----------------------------------------------------------------------------------------------------------------------------------------
6468    XX           users        192.168.49.67 (ipv4:192.168.49.67:55360)  SMB3_11           -                    partial(AES-128-CMAC)
7669    XX           users        192.168.49.88 (ipv4:192.168.49.88:64923)  SMB3_11           -                    partial(AES-128-CMAC)

Service      pid     Machine       Connected at                     Encryption   Signing     
---------------------------------------------------------------------------------------------
XXX 7669    192.168.49.88 Tue Apr 23 07:28:47 PM 2019 CEST -            -           
IPC$         6468    192.168.49.67 Tue Apr 23 07:19:13 PM 2019 CEST -            -           
XXX 6468    192.168.49.67 Tue Apr 23 07:19:13 PM 2019 CEST -            -           

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------
7669         1000       DENY_NONE  0x100081    RDONLY     NONE             /mnt/user/multimedia_nas3   .   Tue Apr 23 19:28:47 2019
7669         1000       DENY_NONE  0x100081    RDONLY     NONE             /mnt/user/multimedia_nas3   .   Tue Apr 23 19:28:47 2019

 

For me, it looks pretty similar. The .88 machine (Windows) is working, the .67 (Linux) does not.

 

And, additionally, I got aware that from Windows it's also not working properly. At the screenshot you see 2 different files which have been deleted. They are from different shares. And although they have been logged, the second share is not displayed (.Recycle.Bin has not been created, file not been moved). As the plugin obviously recognized, that a file has been deleted, shouldn't there be not also a error message in a log (because he failed to create the directory and to move the file)? Where can I find this?

 

grafik.thumb.png.44deb9f2388d73c3feb7e92973612095.png

 

I'm a bit confused. Maybe I should work first that it's working properly with Windows and postpone the Linux problem .

 

My Config: Unraid 6.7.0-rc7 Basic. 3x2TB Data, 1x2TB Parity, 2x60GB SSD Cache. ASRock Q1900-ITX, 16GB Memory.

 

Maybe someone has an idea.

 

Hope, this was bit of a kind understandable. If not, of course I'll try to dig deeper and come back, if there is anything more clear, or solved, or...

 

Best regards,

Marcus

 

 

Link to comment

I'm not sure about the reasons but, finally, it works.

Switch to SMB 3.1.1 fixed the different behaviour between Windows and Linux client for me.

The confusion obviously came from that the Plugin seemed to be unable to create the directory .Recycle.Bin. But, if this is definitely the reason and why this problem came up, I don't know.

After I created the directory by hand everything works normal (so far), from Windows and from Linux side.

Best regards,

Marcus

 

Link to comment
  • 2 weeks later...
11 minutes ago, gacpac said:

Question. I deleted a video from Plex, but it didn't go to the recycle bin.

But if I delete it manually from the share it does it.

What's different if the file is on the same place?

Sent from my Pixel 2 XL using Tapatalk
 

Plex (or any container running locally on the server) doesn't use SMB to manage the files.

Link to comment
4 hours ago, unabletoconnect said:

Would this scenario work with this plugin or just cause issues?

 

1. Map /mnt/user/TV/.Recycle.Bin/ into my Sonarr container

2. Specify the container path as my recycle bin for sonarr

 

Regards,

I don't think that will be a problem, depending on how sonarr works with it.

Link to comment
6 hours ago, unabletoconnect said:

Would this scenario work with this plugin or just cause issues?

 

1. Map /mnt/user/TV/.Recycle.Bin/ into my Sonarr container

2. Specify the container path as my recycle bin for sonarr

 

Regards,

When I did this I had to create a script to recreate the recycle directory after it was emptied (deleted). Not sure if this is still necessary or not since that was quite a while back and there have been more than a few updates to the plugin.

Link to comment
7 hours ago, wgstarks said:

When I did this I had to create a script to recreate the recycle directory after it was emptied (deleted). Not sure if this is still necessary or not since that was quite a while back and there have been more than a few updates to the plugin.

The .Recycle.Bin folder is no longer removed when the trash is emptied.

Link to comment
  • 4 weeks later...
7 hours ago, gacpac said:

Hi I'm excluding shares to the recycle bin but it doesn't take. Am I missing something?

 

This is what I have exactly like this  "appdata, system, AppDataBackup, Downloads"

 

 

Remove the spaces.  "appdata,system,AppDataBackup,Downloads"

Link to comment
  • 2 weeks later...
  • 2 weeks later...

having a strange issue.  I have multiple .Recyclebin nested in the .Recyclebin folder. They go 20-30 deep.  I don't know when it started.  not sure I should delete them all.

 

On my windows machine:

 

\\storage2\Multimedia\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin

 

Console on UnRaid box:

root@STORAGE2:/mnt/user/Multimedia/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin#

 

I am running a party check just in case but does anyone know what is wrong?

 

 

Edited by chris0583
Link to comment
23 hours ago, chris0583 said:

having a strange issue.  I have multiple .Recyclebin nested in the .Recyclebin folder. They go 20-30 deep.  I don't know when it started.  not sure I should delete them all.

 

On my windows machine:

 

\\storage2\Multimedia\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin

 

Console on UnRaid box:

root@STORAGE2:/mnt/user/Multimedia/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin#

 

I am running a party check just in case but does anyone know what is wrong?

 

 

I've seen this issue when I backup shares from my main server to a backup server using robocopy.  If I exclude the .Recycle.Bin folders, it doesn't seem to happen.  I have been unable to determine how/why this happens.

Link to comment
  • 2 weeks later...
On 7/3/2019 at 9:54 AM, chris0583 said:

having a strange issue.  I have multiple .Recyclebin nested in the .Recyclebin folder. They go 20-30 deep.  I don't know when it started.  not sure I should delete them all.

 

On my windows machine:

 

\\storage2\Multimedia\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin

 

Console on UnRaid box:

root@STORAGE2:/mnt/user/Multimedia/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin/.Recycle.Bin#

 

I am running a party check just in case but does anyone know what is wrong?

 

 

My version: 2019.04.08

 

I am also having this issue. I have seen this in the past and a reboot usually fixes the problem. I never brought it up as it happened rarely. As far as i can tell this happened after i upgraded unRaid to v6.7.2 from v6.7.1.

 

I also use robocopy to sync data from 1 server to another, but i have always excluded the .Recycle.Bin directory. I wanted to ask if anyone knows a fix before i uninstall and reinstall the plugin. Thanks.

Edited by chris1259
Link to comment
On 7/19/2019 at 7:49 PM, dlandon said:

You'll need to remove the .Recycle.Bin folder manually.

I tried that too. On both X:\.Recycle.Bin and X:\.Recycle.Bin\.Recycle.Bin.

 

So i removed the plugin and rebooted. But the directory is still there. This does not happen on unRaid v6.7.0

 

I am left with the directory 41 times --> X:\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin

 

I then reinstalled the plugin and rebooted again. But the issue remains. It's not a big deal, it's just a bug somewhere.

Link to comment
4 hours ago, chris1259 said:

I tried that too. On both X:\.Recycle.Bin and X:\.Recycle.Bin\.Recycle.Bin.

 

So i removed the plugin and rebooted. But the directory is still there. This does not happen on unRaid v6.7.0

 

I am left with the directory 41 times --> X:\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin\.Recycle.Bin

 

I then reinstalled the plugin and rebooted again. But the issue remains. It's not a big deal, it's just a bug somewhere.

I don't have any control over the .Recycle.Bin management.  There is a module in Samba called vfs recycle that handles the placement of the recycled files in the .Recycle.Bin.  The plugin tells vfs recycle where the files are to be placed and vfs recycle handles it from there.

 

Set the recycle bin plugin to its defaults for a while and see if that helps.  Don't define any recycle bin parameters.

Link to comment

I noticed that the default setting for this plugin is "Enable Recycle Bin for Deleted Files? = No", which defeats the whole purpose of having it installed. After 2 days of it set to "No", the directory replication is still there.  Even after reboots. This is not a big deal and might sort itself out in future releases of the plugin or unRaid. Thanks for help everyone.

Link to comment
  • dlandon changed the title to Recycle Bin (vfs recycle) for SMB Shares

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.