brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: the Recycle Bin plugin keeps files you delete over SMB for a week

Unraid
~/tips/tip-unraid-recycle-bin-plugin-smb

\\tower\media\.Recycle.Bin

Moves files deleted over SMB into a hidden bin per share and empties it after a set number of days.

Deleting something on a network share is permanent, and I find that uncomfortable. The Recycle Bin plugin for Unraid adds a safety net for deletions over SMB.

Unraid’s own docs say nothing about this plugin, so what follows comes from its support thread on the Unraid forum. The plugin builds on Samba’s vfs_recycle module, which moves deleted files to a repository instead of removing them. Per the thread, it creates a hidden .Recycle.Bin folder on each share, and files deleted over SMB land there, on the same share.

In the settings you can organise deleted files by user or machine. You can also schedule an emptying job, hourly, daily or weekly, that removes files older than a number of days, and the thread gives 7 as the default. A button called Remove Aged Files does it by hand.

The folder is hidden because its name starts with a dot. Set Hide “dot” files to No in the SMB settings to see it, or open the path directly:

\\tower\media\.Recycle.Bin

Use your own server name and share instead of tower and media. You can exclude shares by name, and directories as share/directory. The author advises excluding appdata and system, which sounds right to me, since container databases do not belong in a recycle folder.

Deleting with the file manager or on the command line does not use the bin, so it only catches deletions over SMB. Some forum users also report an empty bin after the update to Unraid 7.0.0. The bin takes up space on the same share until the schedule empties it, and it covers a slip on a Windows or Mac client, not a lost disk. It does not replace a backup.

Further reading: Recycle Bin (VFS recycle) support thread (Unraid forum), vfs_recycle (Samba), unraid/recycle.bin on GitHub

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Unraid tips Change the RAID profile of a Unraid BTRFS pool with Balance Replace a disk in a redundant Unraid pool from the Main tab Test every Unraid drive with the DiskSpeed container See the XML behind a VM with the inline XML view in Unraid 7 Choose where a new VM's disk image is created with Unraid's storage override All Unraid tips (77) All topics

Link