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.

  • I am writing this a comment till could be tested. I found difficult sometime to follow outdated documentation on www. Instead of trying all possible paths ... strace could be used to trace nautilus for paths it trying to open and check their permission state. – user.dz Sep 25 '16 at 8:58

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.

  • Are you saying that a user with read and write access still may not have access to delete/move files? I can't find any reference for that; do you have one? – l0b0 Feb 11 '13 at 12:26
  • A driver issue. You need to access the mca..etc driver/system that allows to delete, not move it to trash. It really does not delete it, Only moving it to a protected area of the drive. Without access to the system functions you can not delete on a windows machine via commands without out emulating/remote accessing the functions (read functions not files). Just personal experience. What worked for me: VM it and delete. So a system not running windows server that has a windows mounted partition that you connect to remotely using a Linux based machine? – Lester.Amod Feb 11 '13 at 13:07
  • Virtual file share permissions allowed for deletion of samba mounted/server files (ntfs... had worked in redhat, but that was years ago. Dunno if it still does. Really Just VM windows to get to the server/partition and that should allow for deleting. – Lester.Amod Feb 11 '13 at 13:49
  • Can you please clarify? I'm able to read and write to the NFS system, so what do you mean by "isnt recognized"? What is meant by "emulation", "raw data", "wheelhouse", "virtually mounting", "A driver issue"? What's the "mca..etc driver/system"? I can't use any of this information as it is. – l0b0 Feb 11 '13 at 13:56
  • Also, please update your answer with new information rather than adding comments. – l0b0 Feb 11 '13 at 14:02

uid=1000 en gid=1000 are required to make the trash work normally. Somehow you will need to mount it probably, is it possible to mount it in SAMBA like in fstab as below?

UUID=***********   /media/DATA     ntfs-3g defaults, uid=1000, gid=1000,  locale=nl_NL.UTF-8    0        0
  • 1
    It would be better if you could elaborate your answer explaining the meaning of the command you have mentioned. Your answer can be improved. – ankit7540 May 26 '16 at 14:59
  • 1
    @gerhas he is mounting NFS, not NTFS partition – gogeccc Jun 3 '16 at 20:10

NFS uses UID (user id) and GID (group id) for permissions and I believe you need these to match on both the local and remote system to obtain the functionality you describe. This is unlikely to happen as you state "The server is not under my control"

Sources: http://forums.openmediavault.org/index.php/Thread/5827-nfs-and-trash/ http://linux.die.net/man/5/exports

Not the answer you're looking for? Browse other questions tagged or ask your own question.