Ubuntu – How to use gnome trash for files in different partition

filesystemgnometrash

I have my files in a separate partition that is not mounted to /home, but only linked to it. How do I manage to be able to use the gnome trash in those files?

For example:

partion 2: mounted on /data, with a folder /data/myname

partion 1: mounted on /, with its own /home and /home/myname, inside it /home/myname/Desktop and /home/myname/Documents link to /data/myname/Desktop and /data/myname/Document respectively. Suppose I have a file /data/myname/Document/example.txt.

When I use nautilus, and try to delete /home/myname/Document/example.txt, Nautilus say it can't use the trash. It took me a while to figure out it is because example.txt is in a different filesystem. I don't know can another trash directory be defined in that partition so that gnome can use it?

I could have partion 2 mounted as /home with almost simular results –I did that for a long time–, but each time I change the Linux/Ubuntu installation, many configuration files in my home become broken. But in summary this new scheme doesn't allow me to use gnome trash now.

Best Answer

GNOMEish file managers need a place to put the trashed files. Copying them to the 1st partition would be very bad performance. So it tries to put them in the /.Trash-$UID folder. Without rw access to that folder, no trash.

Run this bash in the partition root as the user who needs a trash.

sudo mkdir .Trash-$UID && sudo chown $USER:$USER .Trash-$UID

Note: If there is a a rw .Trash folder, Nautilus may create the user's trash folder automatically (/.Trash/$UID). I haven't tried this, just saw it in some logs. There are security issues with public trashes. YMMV.