Can't delete some files from Trash

There’s a couple of files from a long time ago that were still in my Trash, I think they are from around August-September, it’s 5 SVG files that I can’t delete, I keep getting.

Could not delete file /run/media/gustavo/OS/.Trash-1000/files/file-i-cant-delete.svg

I went to that location and tried to delete manually or using rm but it’s not possible, here I get the error

rm: cannot remove ‘/run/media/gustavo/OS/.Trash-1000/files/file-i-cant-delete.svg’: Read-only file system

So I’m not sure how I can delete those files, I’m not even sure why these files are there since Trash should be in ~/.local/share/Trash/files/ and new deleted files go to that location and can be deleted.

I’d be glad if someone could point me in the right direction, thanks in advance.

Sometimes files that are corrupted or that have illegal file names are very difficult to delete. You may have better luck using a live boot disk and chrooting to delete the files from outside your running Garuda install.

Also check that the files don't have the immutable flag set.

1 Like

Can we see the output of findmnt /run/media/gustavo/OS

Are those files owned by you? I've had situations where through various twisted events you delete things while sudo'ing and you end up with things in your trash owned by root. Have you checked permissions or tried just done sudo rm -rf /run/media/gustavo/OS/.Trash-1000/*

Also welcome!

I'm starting to think this might be the issue, probably corrupted since the name doesn't look that illegal, the names look like this "CodeCogsEqn (1).svg", even though I don't know why the errors say that the files are Read-only.
Also, this might be the way to delete them, but I'm not sure how to proceed.

Output is more or less like this, didn't find a better way to format this sorry:
TARGET=/run/media/gustavo/OS
SOURCE=/dev/sda3
FSTYPE=fuseblk
OPTIONS=ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other, blksize=4096

Yeah, I'm the owner of the files, while checking the Permissions tab under the Properties of those files I'm in both the User and Group. Can't use sudo rm, it'll say that the files are Read-only.

Thanks!

Yeah that sound immutable or corrupt. I'll lean to corrupt given how would you have got immutables there in the first place or not remember marking them as immutable after being in the trash. Have you tried yelling loudly?

Yeah, didn't really know about immutable files until now, so if they're corrupt is the only way to delete them outside Garuda, as tbg suggested?

sudo chattr -i filename

check file with

lsattr filename

It looks like it is mounted read-only.

What is it? Is it ntfs?

@SGS
chattr won’t work, the output looks like this

chattr: Read-only file system while setting flags on CodeCogsEqn.svg

And lsattr says

—D-adA-E—TeCx----m CodeCogsEqn.svg

@dalto
Yes, that’s my Windows 10 install, it’s mounted as read-only, is there any way to mount it differently? That would explain why I was never able to modify anything there, also why would Garuda Trash show files from that folder?

That is why you can’t delete them from trash. It is read-only.

This is exactly what the error message is telling you:

Trash isn’t in one place. Each volume has a separate trash location. The trashcan shows you what is in all your trash locations.

It is probably being mounted read-only because you haven’t disabled fast startup in Windows. This causes Windows to leave the disks marked dirty so Linux will mount them read-only.

5 Likes

Alright, that makes sense, I'll disable fast startup on Windows and hopefully, OS will be mounted correctly now, thanks!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.