Ubuntu – Deleted Items not appearing in Trash folder. Stuck in .TRASH-1000

btrfsdeletetrash

I have a three 3TB discs in a BTRFS RAID 1 configuration mounted at /mnt/btrfs on my machine.
There is a symlink at /btrfs.

There are a number of subvols within this,

/archive
/backups
/games
/home
/music
/photos
/temp
/videos
/virtualmachines

/home is mounted at /mnt/btrfs/home/

When I delete an item from any folder in 'home' the items goes to the Recycle Bin correctly. I can recover and empty easily.

When I delete an item from any other subvol the object(s) go to .Trash-1000 within that subvol and this does not appear in my bin but has to be removed manually.

I suspect this is a permissions problem but cannot see what that could be.

Can anyone help with some suggestions for me?

Best Answer

It is not a permissions problem. This is a known bug which has been reported at https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1442649 (it affects more than just Nautilus).

Except for the home filesystem which is a special case (see here for full details), any trashed files are stored in a directory within the root directory of the filesystem they were deleted from, to avoid copying between filesystems.

The Trash folder is a virtual folder that should be a combination of those directories from every filesystem.

A subvolume is a separate filesystem. However, only mount points (e.g. those in /etc/mtab) are actually checked for trash directories. A subvolume which is not mounted separately isn't searched.

As for workarounds, for a given subvolume SUBVOL, trying:

ln -s /mnt/btrfs/.Trash /mnt/btrfs/SUBVOL/.Trash
ln -s /mnt/btrfs/.Trash-1000 /mnt/btrfs/SUBVOL/.Trash-1000

to store the trash on the parent volume does not work.

But the existence of both symlinks (or just empty files of the same name) prevents the creation of the trash directories, so preventing trashing on that subvolume.