Mount samba share in a way that disables/bypasses trash

I have a NAS accessed via samba that manages it’s own trash. I don’t want my linux machines creating .Trash-1000 folders, I just want it to seamlessly work like it does with my Windows machines and phones without having to remember to Shift+Delete. I’ve tried cifs, smbfs, and even rclone. Does anyone know any way to mount a samba share that will just bypass the trash folder system wide?

No.
It
doesn’t manage it’s own trash …

That is a function of whatever means / file manager you use to access it.

Your premise is faulty.

xy problem …

1 Like

It does. With the plugin disabled, if I delete a file via smb on my phone or Windows machines, the file is gone, but with the plugin enabled, the file gets moved to a dedicated trash folder

No.
It doesn’t.
It simply doesn’t. :man_shrugging:

You might be misunderstanding something in my original post, because I assure you, it does.

I can’t post links, but if you do a search for “Recycle Bin (vfs recycle) for SMB Shares” you will find the Unraid forum support thread for the plugin

But you can - just format them as text or whatever, using the tool bar above where you input your text …
… not clickable links then, maybe, but the information comes across

You keep talking about a plugin.
A plugin to what?

google: xy problem

I don’t like subverting forum rules especially when I’m a new user, but if you insist, replace the ~ with dots

forums~unraid~net/topic/41044-recycle-bin-vfs-recycle-for-smb-shares/

It’s a plugin for Unraid, a Slackware based OS for NASes

The plugin uses a Samba feature called vfs_recycle

samba~org/samba/docs/current/man-html/vfs_recycle.8.html

I’m not a new user, obviously.
but
you don’t need to cheat
or distort your links
and have others to reconstruct them.

just format them like so:

https://www.samba.org/samba/docs/current/man-html/vfs_recycle.8.html

or like so:

vfs_recycle

both are the same - just use the tool bar at the top of your edit window

Not sure about the second variant, but the first should work (for a new user of the forum).
It’s just text - but everyone can just recognize and use it as a link with a right click …

Thanks for the info. Haven’t had a forum tell me I couldn’t post links in probably 15yrs, obfuscation was all we had back then.

1 Like

The goal, the objective, is just to prevent
(apparently many, many stupid and even malicious)
people to be able to easily post spam …

and it looks neater (neat, more neat) as well :sunglasses:

and towards the initial subject
which I still don’t really get:

a) don’t use that feature of the plugin
b) don’t use the plugin

No?
Wrong line of argument?
How?
Why?

I want a trash bin on my NAS, Windows and the apps on phones do not implement their own when connecting with samba, so my NAS needs to handle it.

Even if they did have an option for it, I would rather have consistent functionality across devices, which samba offers with vfs_recycle. So I would like to configure Linux devices using the samba shares to not use it’s own trash system.

Perhaps it’s very different with Unraid
but I very much doubt it …

for the very last time here
unless someone (except you) objects
and teaches me how it really works:



You want a trash bin on the NAS.
But you are not getting it?

You want to delete stuff - but have second thoughts about it and want to be able to reverse it?
Deleted stuff should end up in Trash?
Can be easily restored?

Linux !== Windows …

I guess the people at Unraid would have more info on their system and specific question like that.

I guess I’m not being clear enough because the replies I’m getting seem to focus on the a different thing I’m asking about.

On my machines running Manjaro, I mount samba shares from my NAS. When I delete, it does not perform a delete, it creates a trash folder and moves the file there. I understand this is normal operation but I would like to know if it’s possible to override that and just always delete.

That is normal - as you have already concluded.

But I understand that having the file(s) moved to your local system is a time and diskspace consuming and that overriding this may be preferable.

If you use the command line there will be no moving to a local trashfolder.

The CLI filemanager Midnight Commander does not create a local trash folder.

If you use a file manager - the filemanagers configuration may allow for override.

I prefer pcmanfm-qt and there is a setting Erase files on removable media instead of “trash can” creation

I am fairly certain that other file manages provides a similar configuration option.

If the file manager does not provide the functionlity perhaps it is an environment wide setting e.g. Plasma or Gnome.

//EDIT:
Perhaps you should be looking at configuring the samba configuration file for your system /etc/samba/smb.conf.

[share]
Path = /data/share
vfs objects = recycle
recycle:repository = .recycle
recycle:keeptree = yes
recycle:versions = yes

https://unix.stackexchange.com/questions/112063/how-can-i-have-a-trash-recycle-bin-for-my-samba-shares

//EDIT afterthought
The above is the server side definition - having the server moving files to a recycle bin instead of deleting the files permanently

The smb.conf on the desktop that’s connecting to the NAS?

I thought that config was just for hosting samba shares. Does it also do client-side configuration?

I think you are right - this specific configuration is on the server side as it defines the share - it will likely not work as I first thought.

I haven’t really worked with this specific topic - but yes - a lot of the configuration in the local smb.conf affect how the client interact with the service

But you may still need to configure your chosen filemanager to not create local copies of files deleted from removable devices - which includes network locations.

2 Likes