View previous topic :: View next topic |
Author |
Message |
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 9:21 am Post subject: Impossible to delete a file |
|
|
I have a file in
Code: | /usr/portage/sci-electronics/magic/files |
which I cannot delete. Here more information:
Code: |
cd /usr/portage/sci-electronics/magic/files
#ls
10magic?
#rm 10*
rm: cannot remove `10magic\b': No such file or directory
#cd ..
#rm -rf files
rm: cannot remove directory `files/': Directory not empty
|
When I type ls 10 and push the tab I get:
what is going on here. I have never seen something like that. |
|
Back to top |
|
|
kfiaciarka Veteran
Joined: 20 May 2005 Posts: 1498 Location: Dobre Miasto, Poland
|
Posted: Fri Apr 07, 2006 9:31 am Post subject: |
|
|
Try use mc to that:) |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 10:07 am Post subject: |
|
|
does not work with mc |
|
Back to top |
|
|
Akkara Bodhisattva
Joined: 28 Mar 2006 Posts: 6702 Location: &akkara
|
Posted: Fri Apr 07, 2006 10:24 am Post subject: |
|
|
Could your filesystem have become corrupted? Maybe try to boot from a live-cd and do a fsck -f on it?
What does ls -la in that directory give? |
|
Back to top |
|
|
BlackEdder Advocate
Joined: 26 Apr 2004 Posts: 2588 Location: Dutch enclave in Egham, UK
|
Posted: Fri Apr 07, 2006 10:45 am Post subject: |
|
|
I just tested a file with a ? and that doesn't seem to be a problem
Code: | edwin@zaphod:~/tmp$ touch bla?
edwin@zaphod:~/tmp$ rm bla\? |
|
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Fri Apr 07, 2006 11:54 am Post subject: |
|
|
zbindere, can you post the output of these two commands:
Last edited by Darkael on Fri Apr 07, 2006 12:02 pm; edited 2 times in total |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 12:00 pm Post subject: |
|
|
Code: | #rm 10magic\?
rm: cannot remove `10magic?': No such file or directory |
as I said bash completion gives me: 10magic^H |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 12:02 pm Post subject: |
|
|
KarnEvil wrote: | zbindere, can you post the output of these two commands:
|
Here the output:
Code: | #ls -lq
ls: 10magi: No such file or directory
total 0 |
Code: | #ls -lb
ls: 10magic\b: No such file or directory
total 0 |
Code: | #ls -la
ls: 10magi: No such file or directory
total 0
drwxr-xr-x 2 portage portage 72 Apr 7 10:31 .
drwxr-xr-x 3 portage portage 72 Apr 7 10:29 .. |
I even cannot move the directory to anoder partition. really strange.
Last edited by zbindere on Fri Apr 07, 2006 12:04 pm; edited 1 time in total |
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Fri Apr 07, 2006 12:04 pm Post subject: |
|
|
Try:
(don't escape the ?) |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 12:05 pm Post subject: |
|
|
KarnEvil wrote: | Try:
(don't escape the ?) |
Output:
Code: | #rm 10magic?
rm: cannot remove `10magic\b': No such file or directory |
|
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Fri Apr 07, 2006 12:13 pm Post subject: |
|
|
Ok, now try to delete it with its inode number. Here is how to do it:
-first find the inode number of the file with ls
-use find to delete the file
Code: |
find . -inum XXXXXXX -exec rm -i {} \;
|
(replace XXXXXXX with the inode)
If it doesn't work, as Akkara said check if your fs is not corrupted or something (unless anyone has another suggestion)
By the way, what is your shell? (bash?) |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 12:27 pm Post subject: |
|
|
I am getting crazy here
Code: |
#ls -i
ls: 10magi: No such file or directory |
Yes its bash.
And yes I am going to do a fscheck. |
|
Back to top |
|
|
guduri Apprentice
Joined: 04 Apr 2005 Posts: 230 Location: Ann Arbor, Michigan
|
Posted: Fri Apr 07, 2006 12:30 pm Post subject: |
|
|
I have seen this before. I use reiserfs and it turned out to be a file system corruption. Had to rebuild the tree in single user mode and then the problem went away. It really drove me nuts. _________________ Power is about what you can control. Freedom is about what you can unleash. |
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Fri Apr 07, 2006 12:37 pm Post subject: |
|
|
zbindere wrote: | I am getting crazy here
Code: |
#ls -i
ls: 10magi: No such file or directory |
Yes its bash.
And yes I am going to do a fscheck. |
Try to find the inode with:
It it still doesn't work, do as guduri and Akkara said |
|
Back to top |
|
|
zbindere Guru
Joined: 27 May 2004 Posts: 356 Location: Switzerland
|
Posted: Fri Apr 07, 2006 12:47 pm Post subject: |
|
|
Code: | #stat -c %i *
stat: cannot stat `10magic\b': No such file or directory |
OK it is the fs. I will never user reiser again. it is not stable enough. It is the third time I have a
reiserfs issue on my servers. for servers I will use from now on ext3.
thanks everybody for you help. |
|
Back to top |
|
|
niskel Guru
Joined: 17 Nov 2004 Posts: 457 Location: Fredericton, NB, Canada
|
Posted: Fri Apr 07, 2006 2:21 pm Post subject: |
|
|
zbindere wrote: | Code: | #stat -c %i *
stat: cannot stat `10magic\b': No such file or directory |
OK it is the fs. I will never user reiser again. it is not stable enough. It is the third time I have a
reiserfs issue on my servers. for servers I will use from now on ext3.
thanks everybody for you help. | I had the same problem, fsck.reiserfs --rebuild-tree fixed it for the moment but it was only a matter of time before 3 more came up. I am thuroughly disappointed with reiser as well. I have since moved to ext3 and have never been happier . |
|
Back to top |
|
|
|