andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.58k stars 179 forks source link

fuse.glusterfs doesn't work on trash-list and trash-restore #255

Closed rcy17 closed 1 year ago

rcy17 commented 1 year ago

Describe the bug In my glusterfs mount directory, I can trash-put files, but I can't find them in trash-list, or trash-restore.

trash-cli version 0.22.10.4.4

Are you using the latest version of trash-cli? yes

Have you tried if the bug is present in the latest version of trash-cli? Yes. I cloned the repo to find the problem and solution.

Operating system:

Probably reason

In /etc/mtab I noticed this line:

server-1:/gv1 /mnt/data fuse.glusterfs rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072 0 0

So the fstype is fuse.glusterfs, meanwhile there is a 'fuse' in fstypes set in os_mount_points, but Partitions.should_used_by_trashcli use

partition.fstype in self.physical_fstypes

to check type, which mismatches fuse and fuse.glusterfs.

Honestly, I'm not familiar with filesystem, including naming rule or types or others, so as a temporary solution, I just tried to change that line into

partition.fstype.split('.')[0] in self.physical_fstypes

and it works just fine. But I'm not sure if this is a suitable solvement, so I post an issue instead of a pr.

andreafrancia commented 1 year ago

Thank you. Can you send me the output of trash-list --debug-volumes?

rcy17 commented 1 year ago

Of course. Just to make things simpler, I removed most of the irrelevant lines, please let me know if you're instrested in those.

ubuntu@my-server:~$ trash-list --debug-volumes
physical ->
[......,
sdiskpart(device='/dev/nvme0n1p1', mountpoint='/', fstype='ext4', opts='rw,relatime,errors=remount-ro,stripe=32', maxfile=255, maxpath=4096),
 sdiskpart(device='/dev/nvme0n1p2', mountpoint='/boot', fstype='ext4', opts='rw,relatime,stripe=32', maxfile=255, maxpath=4096),
 sdiskpart(device='/dev/nvme0n1p3', mountpoint='/tmp', fstype='ext4', opts='rw,relatime,stripe=32', maxfile=255, maxpath=4096),
 sdiskpart(device='/dev/nvme0n1p4', mountpoint='/boot/efi', fstype='vfat', opts='rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro', maxfile=1530, maxpath=4096),
 sdiskpart(device='/dev/nvme0n1p5', mountpoint='/home', fstype='ext4', opts='rw,relatime,stripe=32', maxfile=255, maxpath=4096),
 sdiskpart(device='/dev/sda1', mountpoint='/glusterfs/brick1', fstype='ext4', opts='rw,relatime', maxfile=255, maxpath=4096)]
virtual ->
[......, 
  sdiskpart(device='server2:/gv1', mountpoint='/mnt/data_online', fstype='fuse.glusterfs', opts='rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072', maxfile=255, maxpath=4096),
 sdiskpart(device='server1:/gv0', mountpoint='/mnt/data', fstype='fuse.glusterfs', opts='rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072', maxfile=255, maxpath=4096)]
Filesystem       1K-blocks       Used   Available Use% Mounted on
udev              65799928          0    65799928   0% /dev
.......
/dev/nvme0n1p1   195750516   18077584   167656576  10% /
/dev/nvme0n1p2      965872     180092      719376  21% /boot
/dev/nvme0n1p4      999496       5356      994140   1% /boot/efi
/dev/nvme0n1p3     4836604        216     4569996   1% /tmp
/dev/nvme0n1p5   756555344    9069424   708981576   2% /home
/dev/sda1       3844549616 1287836848  2361345552  36% /glusterfs/brick1
server2:/gv1   15502546440  504271640 14371864840   4% /mnt/data_online
server1:/gv0    7689101112 2536537836  4838719756  35% /mnt/data
andreafrancia commented 1 year ago

Hi @rcy17 , please try installing the latest version from sources. I've added fuse.glusterfs to the allowed filesystems.

rcy17 commented 1 year ago

Solved, thank you!