Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

25 minutes ago, dlandon said:

Did the testdel file you deleted have a zero length?  A file that is deleted that is empty will not go to the .Recycle.Bin.

My test files were notepad file with random strings of text and photos. 

 

On my windows PC, I have mapped the rootshare to 'U:' drive.

 

When I delete test files through windows "U:\user\data" Recyclin Bin does not catch them.

However, when I delete test files through windows "\\UNRAID\data", Recylin bin does work!

 

Do you know what is causing this? I think I have been using rootshare U drive since I set it up because I occasionally move files between shares. 

 

Cheers

Link to comment
1 hour ago, belupig said:

My test files were notepad file with random strings of text and photos. 

 

On my windows PC, I have mapped the rootshare to 'U:' drive.

 

When I delete test files through windows "U:\user\data" Recyclin Bin does not catch them.

However, when I delete test files through windows "\\UNRAID\data", Recylin bin does work!

 

Do you know what is causing this? I think I have been using rootshare U drive since I set it up because I occasionally move files between shares. 

 

Cheers

A root share has it's own .Recycle.Bin at the disk level.  Files are not recycled at the share level when deleted from a root share.

Link to comment
25 minutes ago, dlandon said:

A root share has it's own .Recycle.Bin at the disk level.  Files are not recycled at the share level when deleted from a root share.

I do see a .Recyle.Bin folder at the disk level (U:\user\.Recycle.Bin), but it does not catch anything that I delete from rootshare ("U:\user\data") and the folder stays empty. The existence of this folder is probably from previous revision when it worked.

 

When I delete from root share ("U:\user\data"), the delete data log does not show those delete files. However, the delete data log works correctly when delete through share ("\\UNRAID\data"). 

Link to comment
49 minutes ago, belupig said:

When I delete from root share ("U:\user\data"),

What is this?  Is this the rootshare?  Something doesn't look right?

 

I just did a test and the file I deleted did go to the recycle bin.

 

The best place to see the recycled files is through the Recycle Bin page.  The .Recycle.Bin folders are created at the disk level and the Recycle Bin browse puts them together so you don't have to look on the individual disks.  The disk the files get recycled to depends on which disk the original file was stored.

Link to comment
1 hour ago, dlandon said:

What is this?  Is this the rootshare?  Something doesn't look right?

 

I just did a test and the file I deleted did go to the recycle bin.

 

The best place to see the recycled files is through the Recycle Bin page.  The .Recycle.Bin folders are created at the disk level and the Recycle Bin browse puts them together so you don't have to look on the individual disks.  The disk the files get recycled to depends on which disk the original file was stored.

 

Yes U:\ is mapped to rootshare

image.png.796ff13a52f410ea01add9bee39c3a9e.png

 

image.png.fb4f55a0f857667eb08629251d029607.png

 

When deleting files through rootshare from windows, which is mapped to U:\. The deleted files do not show up on deleted files log within the Recycle Bin page. 

 

When deleting files through Krusader, (/media/user/data/), the deleted files also do not show up on delete files log within the Recycle Bin page.

 

Only when I delete files from Windows \\UNRAID\data, then it shows up on delete files log. 

image.png.73f79cb7934db8036dddad6649fa0ed6.png

image.png.c886ac75e0c779f61dab569329367e9c.png

 

image.png.5acc0b0e56d7217e28ee72d47d5d330f.png

Link to comment
4 minutes ago, belupig said:

When deleting files through rootshare from windows, which is mapped to U:\. The deleted files do not show up on deleted files log within the Recycle Bin page. 

I just tried and it worked for me.  I'm not sure how your system is different.  I can't see any issues in your share configuration.

Link to comment
22 minutes ago, belupig said:

 

Yes U:\ is mapped to rootshare

image.png.796ff13a52f410ea01add9bee39c3a9e.png

 

image.png.fb4f55a0f857667eb08629251d029607.png

 

When deleting files through rootshare from windows, which is mapped to U:\. The deleted files do not show up on deleted files log within the Recycle Bin page. 

 

When deleting files through Krusader, (/media/user/data/), the deleted files also do not show up on delete files log within the Recycle Bin page.

 

Only when I delete files from Windows \\UNRAID\data, then it shows up on delete files log. 

image.png.73f79cb7934db8036dddad6649fa0ed6.png

image.png.c886ac75e0c779f61dab569329367e9c.png

 

image.png.5acc0b0e56d7217e28ee72d47d5d330f.png

Are you using UD to create a root share?  It looks like you are trying to do your own thing with this in smb-extras.cfg:

[rootshare]
path = /mnt/
 comment =
 browseable = no
# Secure
 public = no
 valid users = ab
 writeable = yes
 vfs objects =

That won't work.  Remove it and use the UD rootshare.

Link to comment
2 hours ago, dlandon said:

Are you using UD to create a root share?  It looks like you are trying to do your own thing with this in smb-extras.cfg:

[rootshare]
path = /mnt/
 comment =
 browseable = no
# Secure
 public = no
 valid users = ab
 writeable = yes
 vfs objects =

That won't work.  Remove it and use the UD rootshare.

Thank you for the quick responses.

 

I followed spaceInvader One's tutorial on root share, and that's where the smb-extras.cfg is from. I do not know how to use Unassigned Devices to add root share, but this is probably outside of the scope of this discussion.

 

I have now removed the config and therefore the root share U:\ is no longer working. 

 

When deleting files through Krusader, (/media/user/data/), the deleted files do not show up on delete files log within the Recycle Bin page.

 

When deleting files from Windows "\\UNRAID\data", or "\\192.168.100.41\data" then it shows up on delete files log within the Recycle Bin page.

 

The behavior of Recycle Bin has not changed after deleting the smb-extras.

 

Cheers.

 

 

 

 

Link to comment
5 hours ago, belupig said:

Thank you for the quick responses.

 

I followed spaceInvader One's tutorial on root share, and that's where the smb-extras.cfg is from. I do not know how to use Unassigned Devices to add root share, but this is probably outside of the scope of this discussion.

 

I have now removed the config and therefore the root share U:\ is no longer working. 

 

When deleting files through Krusader, (/media/user/data/), the deleted files do not show up on delete files log within the Recycle Bin page.

 

When deleting files from Windows "\\UNRAID\data", or "\\192.168.100.41\data" then it shows up on delete files log within the Recycle Bin page.

 

The behavior of Recycle Bin has not changed after deleting the smb-extras.

 

Cheers.

The recycle bin does not work with Krusader.  It only works witl SMB shares as noted in the title.

  • Like 1
Link to comment
6 hours ago, belupig said:

When deleting files through Krusader, (/media/user/data/), the deleted files do not show up on delete files log within the Recycle Bin page.

This is bypassing SMB and going in directly at the Linux level.  It has to be via a network share for it to work.

  • Like 1
Link to comment

I was able to add root share under Unassigned Devices, and enable Share under the settings.

Then through windows, I was able to access root share and Reyclin Bin works perfectly!

Noted on the fact that Recylin Bin does not work on Krusader as it is directly at Linux level and not SMB.

 

Thank you so much! 

 

 

  • Upvote 1
Link to comment

Is there a way to get this to work for the "homes" share as well?  I setup a homes share with a script to create a user specific folder in there named home when exposed to the end user.  I can setup the recycle bin manually in the home share as defined in smb-extra but it won't show up in the Recycle Bin UI.  

 

homes share is added to Unraid to basically create a storage location.  smb-extra has a definition for a home share that calls a script and creates a folder for the user (if it doesn't exist) at /mnt/user/homes/$user then sends the share information to the user pointing to this folder as $server/home

If I edit this to add recycle bin data then the user gets their own Recycle Bin folder at that level but the plugin doesn't show anything regarding it.

Link to comment
On 4/3/2023 at 2:23 PM, dlandon said:

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

So just to clarify, this recycle bin will NOT work on EXCLUSIVE SHARES (of course, deleted from a windows explorer browser)? 
Is there plans to have this plugin work with exclusive shares in the future?  There is quite a access time benefit with having the exclusive shares set, but it seems allot of plugins and apps are having trouble with them since UNraid implemented it.

Edited by miicar
Link to comment
4 hours ago, shinji257 said:

Is there a way to get this to work for the "homes" share as well?  I setup a homes share with a script to create a user specific folder in there named home when exposed to the end user.  I can setup the recycle bin manually in the home share as defined in smb-extra but it won't show up in the Recycle Bin UI.  

 

homes share is added to Unraid to basically create a storage location.  smb-extra has a definition for a home share that calls a script and creates a folder for the user (if it doesn't exist) at /mnt/user/homes/$user then sends the share information to the user pointing to this folder as $server/home

If I edit this to add recycle bin data then the user gets their own Recycle Bin folder at that level but the plugin doesn't show anything regarding it.

The recycle bin only works at the share level.  You can't create separate recycle bins for each user.  That being said, you can have the one recycle bin work by user or machine.  Click on the "Recycle Bin parameters" and read the help.  You can add a parameter to have the recycle bin work by user or machine.

Link to comment
33 minutes ago, miicar said:

So just to clarify, this recycle bin will NOT work on EXCLUSIVE SHARES (of course, deleted from a windows explorer browser)? 
Is there plans to have this plugin work with exclusive shares in the future?  There is quite a access time benefit with having the exclusive shares set, but it seems allot of plugins and apps are having trouble with them since UNraid implemented it.

Are you talking about a root share recycle bin?

Link to comment
15 minutes ago, dlandon said:

Are you talking about a root share recycle bin?

I understood that he mean exclusive shares like mnt/cache/appdata, docker, iso, domains, ... that only on Cache and the exclusive share flag under shares and symlink under mnt/user

  • Thanks 1
Link to comment
44 minutes ago, dlandon said:

Are you talking about a root share recycle bin?

excuse my ignorance with some terminology.  I'll try to explain myself better...

Recently, unraid implemented "exlusive shares", that bypass fuse via simlink (?) in the background.  This allows us, in windows, to access a normal "//tower/sharename/", but in reality its going directly to //tower/poolname/sharename/ which speeds up access time.  


I had changed all my pool-only shares to "exclusive" a couple months back, to take advantage of this feature, assuming all was going to be handled as normal; but i didn't test the recycling bin part.   Today, one of my staff just went into a panic cuz they couldn't find a file that they accidently deleted (your plugin has saved their a$$ many times in the past...i do owe you a beer, or 6).  Upon investigating, i realized that nothing i deleted in these pools (accessed from windows through the normal share, NOT a disk share), was showing up in the .recycle.bin folder! 

Soon as I disabled exclusive shares for that pool, it was back to normal.  This really sucks as there is a noticeable access time advantage using exclusive shares, but the recycle bin is a must as well!!  If there is a way to have both, it would make me (and my staff) super happy!

 

26 minutes ago, Revan335 said:

I understood that he mean exclusive shares like mnt/cache/appdata, docker, iso, domains, ... that only on Cache and the exclusive share flag under shares and symlink under mnt/user

yea basically.  I have a bunch of pools dedicated to different things (camera recording has a spinning rust pool, cad design has their own SSD pool, Sales/marketing has their own pool, the OG cache pool only does appdata and dockers; pools have their respective shares that are accessed as normal shares through //tower/sharename/ in windows). 


Its really handy for boosting R/W and access speeds!  And yes, i should probably switch to proxmox, or something more industry geared, but unraid has worked amazingly well for what we do over the last 6 years, and even better since the multi-pool ability came a couple years back! 

Edited by miicar
Cleaned up grammer/spelling
Link to comment
1 hour ago, dlandon said:

The recycle bin only works at the share level.  You can't create separate recycle bins for each user.  That being said, you can have the one recycle bin work by user or machine.  Click on the "Recycle Bin parameters" and read the help.  You can add a parameter to have the recycle bin work by user or machine.

I recently added this:

I was hoping that I could have the Recycle Bin show up per user folder (where it looks like it is for the share for the user) or for the baseline homes share itself.  It doesn't appear to work as configured.  Also the setting to toggle if the Recycle Bin is hidden or not doesn't seem to work.

I went back and implemented the Recycle Bin in a slightly different way that allows pretty close to what I want.

Link to comment
25 minutes ago, miicar said:

excuse my ignorance with some terminology.  I'll try to explain myself better...

Recently, unraid implemented "exlusive shares", that bypass fuse via simlink (?) in the background.  This allows us, in windows, to access a normal "//tower/sharename/", but in reality its going directly to //tower/poolname/sharename/ which speeds up access time.  


I had changed all my pool-only shares to "exclusive" a couple months back, to take advantage of this feature, assuming all was going to be handled as normal; but i didn't test the recycling bin part.   Today, one of my staff just went into a panic cuz they couldn't find a file that they accidently deleted (your plugin has saved their a$$ many times in the past...i do owe you a beer, or 6).  Upon investigating, i realized that nothing i deleted in these pools (accessed from windows through the normal share, NOT a disk share), was showing up in the .recycle.bin folder! 

Soon as I disabled exclusive shares for that pool, it was back to normal.  This really sucks as there is a noticeable access time advantage using exclusive shares, but the recycle bin is a must as well!!  If there is a way to have both, it would make me (and my staff) super happy!

 

yea basically.  I have a bunch of pools dedicated to different things (camera recording has a spinning rust pool, cad design has their own SSD pool, Sales/marketing has their own pool, the OG cache pool only does appdata and dockers; pools have their respective shares that are accessed as normal shares through //tower/sharename/ in windows). 


Its really handy for boosting R/W and access speeds!  And yes, i should probably switch to proxmox, or something more industry geared, but unraid has worked amazingly well for what we do over the last 6 years, and even better since the multi-pool ability came a couple years back! 

I created an exclusive share and deleted a file and it worked as expected.  Post your diagnostics so I can have a look at your particular situation.

  • Thanks 1
Link to comment
55 minutes ago, dlandon said:

I created an exclusive share and deleted a file and it worked as expected.  Post your diagnostics so I can have a look at your particular situation.

...well  now I am pissed!  I disabled exclusive shares (added the array as secondary) and then i read your message about it working.  So i changed it back to pool only, and suddenly everything is fine...like the last 3 months through a few reboots etc it didn't work.  Now it seems to work as expected!!   ...i hate this...I hate not knowing what fixed things when i did nothing special. 🤬


The weirdest thing is, I noticed it wasn't working on ANY shares (even the non exclusive ones), now it seems they are all just fine everywhere.  You have no idea how mad i am right now that it works...
If you have any idea why cycling that one thing triggered it to work, i would love to know.  

 

I'll include my diag's for the hell of it...maybe you will see something there.

Thanks for your prompt replies and great plugin.

elmstorage-diagnostics-20240220-1926.zip

Edited by miicar
Link to comment
1 hour ago, dlandon said:

I created an exclusive share and deleted a file and it worked as expected.  Post your diagnostics so I can have a look at your particular situation.

So just to update: i checked some things on my home server.  It is much simpler so it only has one exclusive share (steam games on a pool of old HDD's), that i always excluded from recycle bin anyway. 
Well, i decided to remove that exclusion from recycle bin, then restarted unraid (for good measure), and BAM!  SAME ISSUE!  Deleted files were not getting sent to recycle bin (the non exclusive shares didn't seem to have a ".recycle.bin" folder in them till now as well...i should have checked them first, but my suspicion is, they didn't work neither, as there is nothing showing in the recycle bin plugin, and i'm sure i have deleted a file or 2 in the last month)! 

THE FIX: I went into the share settings of that exclusive pool, toggled the secondary storage to "array" (also changed mover action to maintain files on pool...not sure if this is needed), Hit apply, then immediately changed secondary storage back to "none", and hit apply again!  And it works now!!  Again, I am still confused and somewhat annoyed!  But thats the update so far!

P.S..: Both unraid servers are on 6.12.6 and all plugins are updated to latest versions.

Edited by miicar
added info
Link to comment
12 hours ago, miicar said:

...well  now I am pissed!  I disabled exclusive shares (added the array as secondary) and then i read your message about it working.  So i changed it back to pool only, and suddenly everything is fine...like the last 3 months through a few reboots etc it didn't work.  Now it seems to work as expected!!   ...i hate this...I hate not knowing what fixed things when i did nothing special. 🤬


The weirdest thing is, I noticed it wasn't working on ANY shares (even the non exclusive ones), now it seems they are all just fine everywhere.  You have no idea how mad i am right now that it works...
If you have any idea why cycling that one thing triggered it to work, i would love to know.  

 

I'll include my diag's for the hell of it...maybe you will see something there.

Thanks for your prompt replies and great plugin.

elmstorage-diagnostics-20240220-1926.zip 377.33 kB · 0 downloads

The only thing I see is you are putting things in the recycle bin by machine (%m).  That should have no bearing on whether or not the recycle bin works, but I'll do some testing.

 

Are these diagnostics from when it is not working?  Everything looks good.  The next time you reboot and the recycle bin doesn't seem to work, post the diagnostics before doing anything else.

Link to comment
12 hours ago, dlandon said:

The only thing I see is you are putting things in the recycle bin by machine (%m).  That should have no bearing on whether or not the recycle bin works, but I'll do some testing.

 

Are these diagnostics from when it is not working?  Everything looks good.  The next time you reboot and the recycle bin doesn't seem to work, post the diagnostics before doing anything else.

yea that diag was after i did the share-array shuffle (no reboot).  And yea, i use the %m tag to help my staff find their lost items (and snitch on who might have deleted it).

I will keep a close eye on it now, and if it happens again, i'll post again.  it was weird that my home server also had the same issue (with the same "fix").  My home server is the test bed for things i implement at the shop, so its practically identical (other then the size of it).

I have used this plug-in for a few years without issues, up until now.  I am using a mixed bag of pool formats, and i wonder if the new ZFS being baked in has caused (more) unintended consequences?  just a hunch

Thanks again for the app and your replies!

Edited by miicar
Link to comment
  • 3 weeks later...
On 2/21/2024 at 8:17 PM, miicar said:

yea that diag was after i did the share-array shuffle (no reboot).  And yea, i use the %m tag to help my staff find their lost items (and snitch on who might have deleted it).

I will keep a close eye on it now, and if it happens again, i'll post again.  it was weird that my home server also had the same issue (with the same "fix").  My home server is the test bed for things i implement at the shop, so its practically identical (other then the size of it).

UPDATE:  Seems to be working still, just did an update to 6.12.8 and everything is still good for the recycle bin!  
still curious if anyone else has had this issue, and why it might have happened!?!?!

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.