LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 12-28-2005, 03:02 PM   #1
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
can't delete directory - reiserfs


i accidentally deleted some stuff before it was backed up, and i tried to recover it with the reiserfsck tools. part of what got recovered is an empty directory that now i can't get rid of. when i try to remove it, it says it's not empty, but there's nothing in it but an empty subdirectory, and no hidden (dot) files anywhere.

i've renamed it, moved it to another location, changed all the permissions to 777 -- nothing works. for example:

Code:
[36] root:/mnt/media/torrents # rm -rvf bad-directory/
rm: cannot remove directory `bad-directory//cd1': Directory not empty

[37] root:/mnt/media/torrents # cd bad-directory/

[38] root:/mnt/media/torrents/bad-directory # lal
total 1
drwxrwxrwx   3 root root   72 2005-12-28 15:43 ./
drwxrwxrwx  12 root users 552 2005-12-28 15:51 ../
drwxrwxrwx   1 root root  128 2005-12-28 15:42 cd1/

[39] root:/mnt/media/torrents/bad-directory # rm -rvf cd1/
rm: cannot remove directory `cd1/': Directory not empty

[40] root:/mnt/media/torrents/bad-directory # cd cd1/

[41] root:/mnt/media/torrents/bad-directory/cd1 # lal 
total 0
drwxrwxrwx  1 root root 128 2005-12-28 15:42 ./
drwxrwxrwx  3 root root  72 2005-12-28 15:43 ../

[42] root:/mnt/media/torrents/bad-directory/cd1 # rm *
rm: cannot remove `*': No such file or directory

[43] root:/mnt/media/torrents/bad-directory/cd1 # cd ../../

[44] root:/mnt/media/torrents # rm -rvf 'bad-directory'
rm: cannot remove directory `bad-directory/cd1': Directory not empty
it's weird that when i try to delete it, it appends the subdirectory name and the two slashes: "cannot remove 'bad-directory//cd1'" - what is that about i wonder? nothing else i've tried will get rid of this. what can i do?


>>edit: i just tried deleting it from a knoppix cd and got the same thing. so i guess it's nothing linked to a tmp directory or something like that, but some corruption in the filesystem "encoding" for the directory itself?

ps2: i can "move" it within the partition, but not out to any other partition. i get the same messages about it not being empty.

Last edited by slackhack; 12-28-2005 at 03:26 PM.
 
Old 12-28-2005, 04:35 PM   #2
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
I appear to remember linux uses dev0 as a black hole to write things to that must be erased. Maybe you could 'mv' it there.
 
Old 12-28-2005, 06:10 PM   #3
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Original Poster
Rep: Reputation: 47
same result: it says the directory isn't empty and won't let me move it. will i actually have to move all the data and reformat the partition?


edit:
-----
unmounted the filesystem and ran reiserfsck --fix-fixable, fixed some stuff but didn't allow me to delete the directory. i'll read through the reiserfsck man pages, in the meantime any other ideas?

Code:
[7] root:~ # reiserfsck --fix-fixable /dev/hda5
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will check consistency of the filesystem on /dev/hda5
Will put log info to 'stdout'
Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
reiserfsck --fix-fixable started at Wed Dec 28 19:48:49 2005
Replaying journal..
Trans replayed: mountid 191, transid 2388328, desc 2315, len 1, commit 2317, next trans  offset 2300
2.6.14-ck5]replayed
Checking internal tree..finished                  
Comparing bitmaps..finished
/torrents/.BitTornado/datacachevpf-10650: The directory [518 1817] has the wrong size in  the StatData (720) - corrected to (1000)
/bad-directory/cd1vpf-10650: The directory [1865 652] has the wrong size in the StatData  (128) - corrected to (48)
vpf-10650: The directory [2 70] has the wrong size in the StatData (336) - corrected to  (344)
finished       
No corruptions found
There are on the filesystem:
        Leaves 4591
        Internal nodes 34
        Directories 92
        Other files 730
        Data block pointers 4547047 (103486 of them are zero)
        Safe links 0
###########
reiserfsck finished at Wed Dec 28 19:49:11 2005
###########

Last edited by slackhack; 12-28-2005 at 06:53 PM.
 
Old 12-29-2005, 10:24 AM   #4
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Original Poster
Rep: Reputation: 47
SOLVED
--------

there was a cd1 directory in /dev0, whether from the attempt to move the bad-directory there or not i don't know. i rm-ed that, and it deleted, and then i was able to delete the bad-directory. thanks for pointing me in the right direction.
 
  


Reply



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
cant delete (or do anything else) to files, reiserfs c0uchm0nster Linux - Software 5 10-06-2005 04:46 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
mkfs.reiserfs: No such file or directory murray_linux Slackware 2 05-15-2004 03:32 PM
Delete directory mfo6463 Linux - Newbie 8 04-20-2004 05:04 PM
How do you delete a directory? R4z0r Linux - Newbie 1 12-25-2002 11:16 AM

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

All times are GMT -5. The time now is 03:57 AM.

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