The only cases I know where rm will fail are:
- Trying to delete a file from a filesystem which is mounted readonly. This may be because the filesystem type does not support writing (e.g. iso9660), because the fileysystem has been explicitly mounted readonly, or the OS was automatically remounted the filesystem readonly because errors were detected.
- Corrupted directory entries
- Permissions (check the owner and permissions of the parent directory)
Eliminate these before virus checking, although a virus check won't hurt, but you'll probably be wasting your time.
To check the filesystem, do this command:
Code:
mount |fgrep $(df -k /home/matthew/.mozilla/ |tail -n 1 |awk '{print $1}')
The last column will show mount flag. If you see "ro" as one of the items in the comma separated list in brackets , it's mounted read-only ("ro" on it's own, not "remount-ro").
You should also see the error message when you try to delete the file as "read-only filesystem".
For corrupted filesystem entries, you tend to see junk in the file attributes. So if you do ls -l [parent-directory], you'll see some files with really messed up file-permissions and size, and owner etc.
Finally, make sure the parent directory of the file you want to delete is writable, readable and executable by the user who you want to do the delete as. Of course, root can do pretty much anything to any directory regardless of permissions, so I expect it's a corrupt filesystem.
follow the usual fsck procedures. Anyone have a good link for handling corrupt filesystems on Linux?