ZimaOS 1.5.4 - [Temporary Solution] How to fix the deleted files not being displayed in trash

Hello everyone,

I have noticed recently that sometimes when deleting files, either with the Files app, the PLEX and Jellyfin clients, or through SMB shares, the space on a drive, where the files were deleted from, remains unchanged. Apparently, there is a “sync issue” that prevents files from being properly displayed in the Trash of Files app. It also doesn’t seem like it’s a BTRFS issue, as it happened on a internally mounted NTFS drive as well. Have not tested external USB drives yet.

It turned out that the deleted files were actually moved to:

/var/lib/casaos_data/.media/Mounted-Drive-Label/.trash

To verify and confirm that, I run the du command:

du -sh /var/lib/casaos_data/.media/*/.trash

This will list the “disk usage” of the .trash folder of every mounted drive.

I have stumbled upon this helpful Github Issue that solved this problem for me. At least temporarily.

First, we need to stop two services by running:

sudo systemctl stop icewhale-files
sudo systemctl stop smb.service

Next, we can remove all the .trash folders in each mounted drive:

cd /var/lib/casaos_data/.media/Mounted-Drive-Label
sudo rm -R ‘.trash’

Finally, we can start both services up again and, additionally, use sync to “synchronize cached writes to persistent storage”:

sudo systemctl start icewhale-files
sudo systemctl start smb.service
sync

This seemed to do the trick for me. Every file I deleted since had been properly displayed in the Trash section of the Files app. Unfortunately, a few days and reboots later, I’ve found the issue is still present and had to go through each step again.

Hope it might be helpful for some. Cheers!

Same problem for me, did loose some data my wife recently deleted….