Bind mount doesn't allow to trash files and directories
Recently I hitted a wrong behavior that (I think) could be improved.
Im using xfce 4.16 and thunar 4.16.10 on gentoo.
Preparation
On your system, as root, create one directory like this :
# mkdir /home/foo
Always as root, chown this directory to your regular user :
# chown user:user /home/foo
You should have something like this :
$ ls -ld /home/foo
drwxr-xr-x 2 user user 4096 15 janv. 20:22 /home/foo
With your regular user, in your ~, create this directory :
$ mkdir ~/foo
As root, bind those two directories :
# mount -o bind /home/foo /home/user/foo
Now, with your regular user, create two files in this directory :
$ cd ~/foo
$ touch empty1 empty2
Now, the behavior.
Run thunar with your regular user like this :
$ thunar /home/foo
In thunar, right click on empty2 file, send it to trash. It works.
Run thunar with your regular user like this :
$ thunar ~/foo
In thunar, right click on empty1 file, send it to trash. It does not work.
You cannot send files to trash from bind mounted directories.
Years ago, a bug was opened on kernel bugzilla⁽¹⁾. The answer was :
Your best bet is to file a bug against your desktop environment vendor and ask to implement EXDEV:copy+unlink fallback.
Thank you.