OESF Portables Forum

Everything Else => Desktop Operating Systems Issues => Zaurus General Forums => Archived Forums => Linux Issues => Topic started by: Bulldog58 on February 11, 2005, 02:17:22 pm

Title: Cannot Delete Folder
Post by: Bulldog58 on February 11, 2005, 02:17:22 pm
I tried to install the zgcc environment as described by Jeff Fox at
http://s91215199.onlinehome.us/zaurus/zgcc2install.html (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.
Title: Cannot Delete Folder
Post by: iamasmith on February 11, 2005, 02:41:54 pm
Quote
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

[div align=\"right\"][a href=\"index.php?act=findpost&pid=66654\"][{POST_SNAPBACK}][/a][/div]

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

try...

rm -rf .zgcc
Title: Cannot Delete Folder
Post by: Bulldog58 on February 11, 2005, 02:47:19 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.
Title: Cannot Delete Folder
Post by: iamasmith on February 11, 2005, 03:06:36 pm
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=66657\"][{POST_SNAPBACK}][/a][/div]

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 ?
Title: Cannot Delete Folder
Post by: Bulldog58 on February 11, 2005, 04:39:43 pm
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
Title: Cannot Delete Folder
Post by: Pyrates on February 12, 2005, 04:13:21 am
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
Title: Cannot Delete Folder
Post by: Bulldog58 on February 12, 2005, 01:54:17 pm
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
Title: Cannot Delete Folder
Post by: Pyrates on February 12, 2005, 02:06:52 pm
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  But it worked as described above and saved my ass... Nice yours was easier to rescue *G*

Cheers
Philipp
Title: Cannot Delete Folder
Post by: bluedevils on February 12, 2005, 04:07:19 pm
<>