Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reiser4: can't delete a directory after corruption recovery
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Sun Jan 09, 2005 7:32 am    Post subject: Reiser4: can't delete a directory after corruption recovery Reply with quote

Hi all, yesterday my system hung on "Deactivating swap..." and then I wrongly pressed the power button to force shutdown (I should have pressed the "reboot" button instead...), then my system was unable to boot, since the / filesystem was corrupted.

Then I fsck.reiser4 it to check for error, and followed the instruction to run "fsck.reiser4 --build-fs". Then my system was back. However, I found something weird: there is a directory:
Code:

/var/db/pkg/app-arch/tar-1.15.1/

seems can't be deleted!
Code:

# rm -rf tar-1.15.1/
rm: cannot remove directory `tar-1.15.1/': No such file or directory

However, it IS there:
Code:

# ls -ld tar-1.15.1/
drwxr-xr-x  2 root root 1 Jan  8 23:44 tar-1.15.1/

And it can be renamed and get the following error:
Code:

# mv tar-1.15.1 tar-1.15.1.bak
mv: cannot move `tar-1.15.1/' to a subdirectory of itself, `tar-1.15.1.bak'

Now it's name is "tar-1.15.1.bak", it IS there, I could see it with "ls" the current directory and bash autocomplete, but, when I:
Code:

# ls -l tar-1.15.1.bak
ls: tar-1.15.1.bak: No such file or directory

After I "ls" & "ls -l" about two times, now there it is again:
Code:

# ls -ld tar-1.15.1.bak/
drwxr-xr-x  2 root root 1 Jan  8 23:44 tar-1.15.1.bak/

Notice that there is a "/" after it now... try to rm it again:
Code:

# rm -rf tar-1.15.1.bak/
rm: cannot remove directory `tar-1.15.1.bak/': No such file or directory


OK, here is my question: how can I possibly delete this directory?? Why can't I delete it?

TIA!
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
()
l33t
l33t


Joined: 25 Nov 2002
Posts: 610

PostPosted: Sun Jan 09, 2005 8:36 am    Post subject: Reply with quote

I think the same thing happened to me once, looks like the filesystem is messed up. You could always back up everything but the corrupt entry, reformat the partition, and extract the data back.
_________________
to be concerned is good
Back to top
View user's profile Send private message
Jake
Veteran
Veteran


Joined: 31 Jul 2003
Posts: 1132

PostPosted: Sun Jan 09, 2005 9:36 am    Post subject: Reply with quote

Did "fsck.reiser4 --check" come up clean after --build-fs?
Back to top
View user's profile Send private message
EricHsu
Bodhisattva
Bodhisattva


Joined: 03 May 2004
Posts: 591
Location: Aragon Consulting Group, Beijing, China

PostPosted: Wed Jan 12, 2005 2:06 am    Post subject: Reply with quote

Jake wrote:
Did "fsck.reiser4 --check" come up clean after --build-fs?


Jake, thank you very much for your hint! The first time I did the "fsck.reiser4 --build-fs", the result came up with "the filesystem is consistent", and my system was usable again, then I thought everything should be OK. However, after I read ()'s (OMG, what a nickname ;) ) and your post, I tar'd up my whole system and ran "fsck.reiser4 --check" again last night. Then - fsck.reiser4 ended with "a fatal error" and suggested me to run "--build-fs" to fix it. oh my!

Then I ran "--build-fs", the verbose output told me that it found some errors & fixed them, deleted some nodes which pointed to nowhere... and I double checked - ran "fsck.reiser4 --check" twice after "--build-fs" - to make sure everything did get fixed.

After rebooted back to my system, wow, I deleted that ghost "tar-1.15.1/" directory!! :lol:

However (I "hate" this word, hehe), there is still a problem: I can't delete some entries in the /lost+found directory, they look like this:
Code:

eric@gentux ~ $ ls /lost+found/
ls: /lost+found/lost_name_10001:6d6f64756c6573:411d92Z„±¤¹:0     @õ°:0 : No such file or directory
[snip]
ls: /lost+found/lost_name_10001:6d7461622e746d:3e2ac9Z„±¤¹:0     @õ°:0 : No such file or directory
eric@gentux ~ $

"No such file or directory" - but they ARE there... I can't delete them... I know, I could tar up my system, reformat the partition & extract the system back again as () suggested, but, isn't there a more elegant way to delete them?

TIA :D
_________________
- http://nkbit.com
- http://twitter.com/xuyihua
Back to top
View user's profile Send private message
Rainmaker
Veteran
Veteran


Joined: 12 Feb 2004
Posts: 1650
Location: /home/NL/ehv/

PostPosted: Wed May 18, 2005 8:34 pm    Post subject: Reply with quote

bit late, but this is probably because of those special chars in the file name, which get eaten up by your shell.

Try a very basic shell, which will eat less special characters, such as sh, ash or something.

Also try putting the names in " "
_________________
If you can't dazzle them with brilliance, baffle them with bullshit.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum