Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The power went out at home and my Linux server (Plugbox Linux) went down. After it came back up, one of the files on the USB drive that was connected is corrupt. "ls -il" gives this:

 ? -????????? ? ?  ?         ?            ? server.prefs

How can I remove this file? I googled a bit and found out how to delete a file by inode number, but I can't even get the inode number of this file.

Any ideas?

share|improve this question
up vote 3 down vote accepted

Did you try fsck on that unit?

share|improve this answer
fsck did the trick – Nate Dec 2 '10 at 3:34

Run fsck first to ensure the data is consistent. You may have to use sudo to gain the require privileges to repair.

Then you can use rm -i to remove the file. You may want to use less or more to read the file first to see if you want to keep it first.

There are a number of tools which allow you to browse and delete files. I use mc and emacs from the command line. If you use a graphical interface, the file browser will also handle the cleanup.

share|improve this answer
fsck by itself should take care of it. You'll typically see that kind of output from ls when a file listed in a directory isn't actually present on the volume. It prints question marks because it can't stat() the file to get the permissions, size, etc. fsck will see and should be able to correct this inconsistency. The downside is that the server.prefs file is almost certainly gone, so hopefully Nate has a backup if he needs it. – James Sneeringer Dec 2 '10 at 3:16

Your Answer


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.