I am running Xubuntu 22.04. l installed a new hard disk (really an ssd). I set up fstab to mount it in /media, which it does at start up. Because the disk will be used by multiple users, I installed it under root. I then put a folder in the disk for each user of the disk. I changed the disk permissions so that each folder is owned by each user with permissions of (for example) Owner=ralph (read&write), Group=ralph (read only), Other=none.
I have another disk set up this way and “move to trash” works. I have seen web sites saying that I should mount it in /media/ralph/. But this would make it available to only user ralph, and I want to make it available to all user.
Can somebody help me to get “move to trash” to appear when I right click on a file/folder rather than “delete”???
In Thunar:
Edit>Preferences> Behavior tab
uncheck “Show action to permanently delete files and folders.”
Thanks for the response. I really appreciate people responding. However, I already did that and it didn’t help. Interesting that I have older disk that is set up exactly the same way as the new one but it shows “move to trash” rather than “delete”.
Here is the fstab entry for the new disk: UUID=953a9916-cc6d-40d7-9e4c-c1b3b785b7f5 /media/Shared_Data_1 auto nosuid,nodev,comment=x-gvfs-show,nofail 0 0
I don’t know what all the parameters are for, but I copied fstab entry for the old disk that worked, changing only the UUID.
The trash for a user in a file system is stored in a hidden directory named ‘.Trash-{numerical-user-id}’ - e.g. ‘.Trash-1000’ for the first user on the system - in the root directory of the file system. That folder has to be owned by the user and the user has to have read, write, and execute permission for it. I’m not quite certain what happens if a user doesn’t have the permissions to create this directory if it doesn’t exist.
I could sure use some help on this item: "Thunar won’t show “move to trash” but rather “delete” for a new disk I just installed.
Anybody???
hdd-gehrke: Please excuse me for not seeing your response, before I asked for help again.
A couple of questions on your response:
- My new disk is in: /media/Shared_Data_1. Shared_Data_1 is owned by root with R&W permission; group is root with Read only; others is Read only. I made the disk owned user root so it would be available to more than one user. Should I put .Trash_1000 in /media/Shared_Data_1. Or should .Trash_1000 be in documents_ralph_1, folder within Shared_Data_1 that is owned by user ralph with user id=1000?
- If I put in a trash folder for ralph in Shared_Data_1 should I put another trash folder named .Trash_1001 for user john, who has a folder documents_john_1 also in Shared_Data_1?
There actually is a specification for how Trash works. It’s at freedesktop.org and gives two ways things can be done:
- one directory (.Trash) for all users - obviously that directory has to be writeable for everyone and has to have the sticky bit set so users can’t clear each others trash
- individual trash directories. And yes, if you go with the second approach, then you would need to create one trash directory per user and the number in the directory’s name would have to be the id of that user as shown by ‘id -u {username}’ e.g. ‘id -u john’. In both cases the trash directories need to be at the top level. I’m not certain if you also need to create the subdirectories inside the per user trash directories (expunged,files,info).
A simpler way to get things working is to set the drive rwx for everyone or have all users that have access to the drive as a group and give full access to the drive to that group. The advantage of this approach is that .Trash-XXXX directories are created as needed by the file manager. The disadvantage is that users wouldn’t be confined to one directory per user by anything besides common sense.
hdd-gehrke: Thank you very much. You were really helpful. I got it working. I took your advice and set everything to rwx. This allowed the “move to trash” to come up. Then I started backing them off till I got the permissions I wanted. Users can’t see each others trash, nor can they see each others files.