Posts: 186
Joined: Tue Jun 17, 2014 12:41 pm

Cannot delete files

Tue Sep 21, 2021 8:12 pm

IThere are a few files that don't have rwx rights and I cannot delete those.
When trying it returns a DISK I/O error.
It is not possible to chown or to chmod

Any help is appreciated.
screen10.jpg (37.63 KiB) Viewed 497 times
Who knows knows
Who doesn't doesn't

Posts: 2606
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Cannot delete files

Tue Sep 21, 2021 9:53 pm

I'd suspect your filesystem has got corrupted and you might need to run fsck on it, I'd back up as much as you can before doing that. However, firstly .....

Assuming your filesystem isn't corrupted run

Code: Select all

sudo lsattr *.jpg

To see if there are any attributes locking the files, "e" is normal, "a" or "i " will lock it and you will need to use chattr to change those attributes.

Posts: 285
Joined: Thu Mar 22, 2018 1:02 pm
Location: Finland

Re: Cannot delete files

Wed Sep 22, 2021 8:02 am

Deteleting a file requires write access to the directory containing the file, not the file itself. Check the rights of the directory.

Posts: 784
Joined: Fri Dec 04, 2015 11:22 am

Re: Cannot delete files

Wed Sep 22, 2021 9:44 am

The root user shouldn't care which is why it is more likely corrupted disk.

Posts: 1510
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Cannot delete files

Mon Sep 27, 2021 6:37 pm

zero size and wacked time stamp means that something likely has gone rather amiss, since I sincerely doubt you were creating files back at the epoch.

It might be worth clarifying how said files came into existence and what device/file system you are storing them on, as that might shed more light on the situation.

Return to “General programming discussion”