trash-cli icon indicating copy to clipboard operation
trash-cli copied to clipboard

Problem with symlinks and btrfs subvolumes

Open ghost opened this issue 7 years ago • 2 comments
trafficstars

I have a problem with app-misc/trash-cli-0.17.1.14_p20170816 on a Gentoo Linux system.

I have two btrfs subvolumes: / and /mnt/storage.

Under /home/fturco (which belongs to the first subvolume) I have several symlinks targeting directories under /mnt/storage (the second subvolume). For example /home/fturco/documents points to /mnt/storage/documents.

If I delete a document with trash-put it goes into /mnt/storage/.Trash-1000, but trash-list doesn't show anything. Also, trash-empty seems to be ineffective as it doesn't clean anything under /mnt/storage/.Trash-1000.

Is this a bug with trash-cli or a problem with my setup?

ghost avatar Nov 09 '18 20:11 ghost

Hi @fturco, I think this issue is related to #56. I’ve hit the same problem using ZFS: outside of the dataset where your home belongs, it seems trash-cli has some difficulties to work properly.

ejpcmac avatar May 21 '19 21:05 ejpcmac

Exactly the same problem accessing a Windows hard drive through, for example, /mnt/g using WSL

twome avatar Jun 15 '22 12:06 twome

Hi @ghost, I don't know what can be the problem. The only suggestion I can give to you is update your version fo trash-cli. The version that you are using is from five years ago.

If you know how to modify Python code you can try to add this debug print line and send us the results:

diff --git a/trashcli/list.py b/trashcli/list.py
index 725b5ce..8538cf5 100644
--- a/trashcli/list.py
+++ b/trashcli/list.py
@@ -69,6 +69,7 @@ class ListCmd:
         for event, args in trash_dirs:
             if event == trash_dir_found:
                 path, volume = args
+                print("Trash directory found: {}".format(path))
                 trash_dir = TrashDirReader(self.file_reader)
                 for trash_info in trash_dir.list_trashinfo(path):
                     self._print_trashinfo(volume, trash_info, extractor, show_files)

andreafrancia avatar Aug 19 '22 17:08 andreafrancia

Hi @ghost, I've created a tool for diagnose problems like yours. Please install the latest version 0.22.8.21, launch this command trash-list --debug-volumes and send me the output.

andreafrancia avatar Aug 20 '22 23:08 andreafrancia

Related to https://github.com/andreafrancia/trash-cli/issues/245 Solved in latest version.

andreafrancia avatar Aug 28 '22 17:08 andreafrancia