Help - Search - Members - Calendar
Full Version: Cannot Delete Folder
OESF Forums > General Forums > Desktop Operating Systems Issues > Linux Issues
Bulldog58
I tried to install the zgcc environment as described by Jeff Fox at
http://s91215199.onlinehome.us/zaurus/zgcc2install.html

to make a long story short I have this file path created

/mnt/card/cdev/.zgcc

and "ls -a" issued from /mnt/card/cdev/.zgcc returns nothing.
If I try to "rm -r .zgcc" from /mnt/card/cdev I get "unable to remove '.zgcc': Directory not empty

I can rename the cdev directory, but I cannot rename the .zgcc directory. If I try to rename .zgcc directory I get "unable to rename '.zgcc': no such file or directory

I really need to delete the cdev directory and all files in it. Any help would be greatly appreciated.
iamasmith
QUOTE(Bulldog58 @ Feb 11 2005, 07:17 PM)
and "ls -a" issued from /mnt/card/cdev/.zgcc returns nothing.
If I try to "rm -r .zgcc" from /mnt/card/cdev I get "unable to remove '.zgcc': Directory not empty

I can rename the cdev directory, but I cannot rename the .zgcc directory. If I try to rename .zgcc directory I get "unable to rename '.zgcc': no such file or directory

*


...sounds like the directory is not empty smile.gif you may also need to be root....

try...

rm -rf .zgcc
Bulldog58
I tried that, and to no avail. I get back
"rm: unable to remove '.zgcc': Directory not empty.
I still see nothing in the directory, I am begining to think something is accessing the directory not allowing me to remove it.

I am logged in as root.

any help would be appreciated.
iamasmith
QUOTE(Bulldog58 @ Feb 11 2005, 07:47 PM)
I tried that, and to no avail. I get back
"rm: unable to remove '.zgcc': Directory not empty.
I still see nothing in the directory, I am begining to think something is accessing the directory not allowing me to remove it.

I am logged in as root.

any help would be appreciated.
*


Can you eject the card ? If so then nothing is accessing it. If not then your easiest route may be to shutdown -r to reboot and try again.

If nothing is accessing the card though and you are still unable to eject then you may want to check the file system. What file system are you using ?
Bulldog58
I am able to eject the card. I think I have found the issue.
it reports that the superblock is bad. How can I fix this? I would think that there would be a utility for this, but I am not sure.

any help is appreciated
Pyrates
Hey Bull.

I can help you a bit. Firstly, important data on it? If NOT, just reformat it with ext2, that's really the easiest solution.

If there is important data, save it and reformat your card. If you can't access that data, read below. The procedure works both for the card itself as well as a copy, but of course with a copy you're pretty much safe if it's screwed up (happened quite a bit of times for me).

Step 1) Make a copy of the filesystem: "dd if=/dev/sda1 of=/wherever/backup.sd". Of course, adjust the paths as needed.
Step 2) There are backup superblocks in every ext2 filesystem. You can find them with "dumpe2fs backup.sd". There probably is a switch to show just the backup superblocks, but you can also just scroll through the output.
Step 3) Once you have found a backup superblock, you can use the "-b" switch for e2fsck in order to repair the filesystem. If you're running it on your backup, use the "-y" switch for non-interactive mode. It probably screws the whole thing, but since it's your backup (or a copy of a backup or whatever...) you can just try.
Step 3) Once the backup is repaired, you can mount it with "mount -o loop -t ext2 backup.sd /mnt/backup" as root and retrieve your data.

PLEASE read all the manpages before doing what I said. I might be dead wrong.

Of course, you could try to repair the filesystem on your sd-card with the above procedure, but for one, it can get screwed, and second, I don't really trust it, so reformatting is the best idea. You can run badblocks (check the -o option) on the card and use the info for your new filesystem, just in case there are any bad blocks...

Hope that helps, let us know how it turns out.

Cheers
Philipp
Bulldog58
I saved what data I could, and then I just reformatted. It was just quicker to do it this way. I appreciate the responses. Pyrates, lots of good info there, that is the kind of detail that I will reference for quite a while.

thanks
Pyrates
Yeah, it took a LONG time for me to gather that, but just recently I just HAD to rescue something from a bunked ext2 partition. I made a 42gb copy into a file smile.gif But it worked as described above and saved my ass... Nice yours was easier to rescue *G*

Cheers
Philipp
bluedevils
<>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.