Ubuntu – How to enable trash for NFS mounts

nfstrash

The /home/users directory on my host is an NFS mount connected to a server which is not in my control. When deleting files in $HOME (/home/users/foo) with Nautilus I get the following message:

Cannot move file to trash, do you want to delete immediately?

The file "…" cannot be moved to the trash.

Is there some way to enable trash for this mount point? I have write access to the partition, but even after creating the expected /home/users/.Trash-$(id -u) and setting the sticky bit, Nautilus still fails to use the trash.

When reading this question and the Trash Specification I found that $HOME/.local/share/Trash is the standard location (unless $XDG_DATA_HOME is set), and it looks like Nautilus is only half-aware of this: It does indeed write a $HOME/.local/share/Trash/info/[filename]<.number>.trashinfo every time I try to delete a file, but the files are all empty and I still keep getting the error message.

Best Answer

You are trying to set permissions for a file system that isnt recognized. THE SYSTEM FUNCTION that "deletes" is not the system used in a linux based bit unless its emulated. When you tell it to delete it tries to write to the "trashbin". You are only moving stuff. To remove it you need to access the file system, not raw data. Its going to kick the data back because you are just asking it to move not delete, the delete command isnt within its wheelhouse./ regardless of the command you use.

If you can mount the partition/drive of the server in samba or what ever you like you may be able to use that to delete. Try virtually mounting, with permissions. If you only have read/write but not delete/move your going to have a bad time.

Related Question