Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to remove a file that is corrupted?

In Linux (Fedora based), when I type: ll I get

drwxr-xr-x.  2 dmiller3 dmiller3     4096 Jul 26 13:57 SomeFile
??????????   ? ? ?                   4096 Jul 26 13:57 CorruptedFile    

I can't do anything with this CorruptedFile. I can't use it in delete or anything. It's the only file in the entire system that is like this. What causes this, and how can I remove it?

File system is ext2.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You are likely going to need to run a file system check (man fsck or man fsck.ext2) on that particular file system.

I'd encourage doing some man lookups first as it never hurts to verify the commands for your particular distro/setup.

If it's on the root file system, that could pose other problems and questions. As for what causes it... quite a few things, like powering off the machine without proper shutdown, for example.

share|improve this answer

If the corrupted file is on your root filesystem you might want to boot with a LiveCD and 1) Back up anything you really can't afford to lose; 2) run fsck on the questionable filesystem. Depending on how bad the corruption is , even if fsck succeeds (gets the disk into a self-consistent state) you may have to reinstall the OS and programs anyway. Using fsck is often times more art than science and a lot depends on pure luck.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.