"files" that can't be deleted

Using applications, configuring, problems
Message
Author
Saladin
Posts: 94
Joined: Sun 28 Aug 2011, 03:19

#21 Post by Saladin »

Code: Select all

root# chattr -i -a America
chattr: Input/output error while trying to stat America
root# rm -f America
rm: cannot remove 'America': Input/output error

User avatar
flea
Posts: 5
Joined: Mon 13 Aug 2018, 17:33
Location: Minnesota, USA

#22 Post by flea »

You could try the following. Make sure the partition is not mounted (boot off a usb-stick or CD ROM if necessary)

Code: Select all

fsck /dev/sdxx
sdxx being a substitute for your partition name (i.g. /dev/sda1, etc.) If necessary use

Code: Select all

lsblk
to identify your partition.

Then try to delete the file. If that doesn't work, you probably have a hardware issue.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#23 Post by musher0 »

Saladin wrote:

Code: Select all

root# chattr -i -a America
chattr: Input/output error while trying to stat America
root# rm -f America
rm: cannot remove 'America': Input/output error
Shucks. :twisted: (Please note that I myself live on this continent!)

Silly joke aside, if we are talking about the /usr/share/zoneinfo directory,
"America" is a sub-directory of it, with stuff in it. So rm -f only won't cut it.
The command needs to be:

Code: Select all

rm -f -r America
That "-f -r" means -force and -recurse.
Without the -r you will only erase the first level.

And to make double sure it's gone, it won't hurt to use

Code: Select all

rmdir --ignore-fail-on-non-empty America
right after the rm command above, because rm can be fussy with dirs.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply