LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-12-2006, 02:25 AM   #1
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
Bad file problem--can't delete (or anything else)


New frustrating problem here. I seem to have developed some unmanipulatable files.

Something has happened to about 5 files in one directory I'm trying to delete. I don't know if it's the filenames that are corrupt, or if there was some filesystem error, or something, but nothing I do can remove them. The names have been reduced to question marks making it impossible to actually match the file name. And every command I try (even using wildcards) just gives a 'no such file' error.

Here's what ls shows:
Code:
/usr/src/linux-source-2.6.16/block# ls -A
total 0
?--------- ? ?    ?      ?                ?  ?
?--------- ? ?    ?      ?                ? ?
?--------- ? ?    ?      ?                ? ?
?--------- ? ?    ?      ?                ? ?
?--------- ? ?    ?      ?                ? ioctl.c
/usr/src/linux-source-2.6.16/block#
And when I try 'rm -v ./*'

Code:
/usr/src/linux-source-2.6.16/block# rm -v ./*
rm: cannot lstat ` \303': No such file or directory
rm: cannot lstat `\001': No such file or directory
rm: cannot lstat `\001': No such file or directory
rm: cannot lstat `\t': No such file or directory
rm: cannot lstat `ioctl.c': No such file or directory
/usr/src/linux-source-2.6.16/block#
And of course, trying to delete the directory doesn't work either, because there are still files in it. I haven't found any other commands that affect it either. Some of them do show strange changes in the file name though. Attempting Tab complete shows some bizarre characters.

Here's the background: I'm in the process of trying to update my system to use udev, and I was trying to recompile a kernel so I could use it. But I was having problems and had to do it again.

So I ran 'make clean' on the source directory and went to recompile. But it failed with an error at the block/ioctl.o point. Tried again--same result. I wondered if there was something wrong with the source tree, so I decided to delete it and start fresh. That's when I discovered the bad files.

I'm guessing something happened when I used either 'make clean' or 'make menuconfig', because the previous attempt compiled fine (it just didn't boot ).

I'm not sure what to do to diagnose this one. Should I try to run reiserfsck? I'm not exactly sure how to do that. It would be a bit difficult since this is my boot partition it's on. Has anyone else had this happen?
 
Old 05-12-2006, 04:37 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Can you use "rmdir --ignore-fail-on-non-empty"?
 
Old 05-12-2006, 06:28 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,848

Original Poster
Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
Problem resolved. I booted up a Kanotix liveCD and ran 'reiserfsck --check' on it. Sure enough, there was some corruption. I had to back up my data and run --rebuild-tree on it. After that, all seems to be well.

Y'know, I didn't even realize there was a separate rmdir program with options like that. One of my first attempts at bash scripting was a script to interactively remove directories, using 'rm -r', which I aliased to rmdir. If only I had known. I'll have to remember that if this ever happens again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange problem: can not delete file as root ?? hendrixx Linux - General 29 11-11-2004 12:46 AM
bad problem opening a bin file. dirky Linux - Newbie 1 09-25-2004 10:13 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
wrong fs type ,bad option, bad superblock on /dev/hda3, or too many mounted file syst Vencalator Linux - Newbie 4 09-20-2003 01:58 PM
wrong fs type, bad option, bad superblock on /dev/cdrom, or too many mounted file sy TheCyberDude Linux - Software 1 02-11-2002 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration