Cannot delete two folders on SDCard
I have a VZW Galaxy Nexus, rooted 4.0.4 using WUG's tool. Previously it was at 4.0.2 and I had CWM recovery, so OTA wouldn't work; I downloaded 4.0.4 from Google, flashed and rooted using WUG's. I then restored the data backup and the phone backup that I took prior to rooting.
Root was successful, I have superuser access, everything works in that regard. But, the restore somehow corrupted permissions on the DCIM and Nitrodesk folders (used for the camera of course, and for Touchdown's attachments). As a result, the camera became unable to save pictures, and Touchdown became unable to save attachments.
After research, I found that renaming the problematic folders was the solution. I renamed DCIM to DCIM_bad and Touchdown to Nitrodesk_bad. I then rebooted the phone, took a picture with the camera - it saved correctly - and downloaded an email attachment - it also saved correctly. As expected, the camera and Touchdown both created new DCIM and Nitrodesk folders.
Now, I have DCIM_bad and Touchdown_bad folders left over on the SD Card. I tried connecting the phone to my computer and deleting the folders via Windows Explorer. They disappear from the Explorer window, but are not in fact deleted from the SD Card; next time I connect the phone, they reappear. When I look at the SD Card contents via EStrong's File Explorer, I can see both Nitrodesk_bad and DCIM_bad, even though I "deleted" both of them via Explorer.
If I try to delete the folders or any of their contents on the phone via EStrong's, I receive a message "<BLAH> cannot be deleted!", where <BLAH> is the name of the object I'm trying to delete. This applies to folders, subfolders and individual files of any time. If I look at Properties of the files/folders in question, they are showing readable and writable and not hidden. I can copy them, but not delete them. EStrongs has Superuser permissions.
This is really disturbing and maddening. Could someone please help?
06-14-2012 03:05 PM
Try to install terminal emulator and do it from the command line.. su to root first.
Open terminal emulator:
Type su then press enter
Type 'cd /sdcard' press enter
Type ls then press enter (to make sure you're in the right dir, and you see your DCIM_bad directory.)
Type 'rm -r ./directoryname' (where directoryname is the name of the directory you wish to delete)
Remember that the command prompt is case sensitive. and don't include the ' marks around the commands
Last edited by fnmetal; 06-14-2012 at 03:39 PM.
Permission denied on attempt to delete either directory. Attributes on both directories are drwxrwxr -x.
Hmm, that really is strange..
If all other options are exhausted...I'd relock/unroot using wugs...then unlock/root...restore the backup you originally restored...then run fix permissions see if that clears it up
Swyped from my sourcerized Lte Gnex via tapatalk 2
Hells no, not worth it. We're talking about 50MB space at most.
How can this be anyway? This is a Linux OS, and even an MS guy like myself understands that root should have "godlike" access?
Under Windows, it is actually possible to take away all permissions from an object, and then an administrator won't be able to manipulate it. BUT, the administrator can change permissions on the said object, and give himself rights, and then manipulate the object. Is this what happened here? Do I need to grant myself permissions on the two folders? What would be Linux commands for that?
I am pretty comfortable with command line.
Anyone? Bueller? Anyone?
I thought you Linux people hated it when your own OS told you you can't do stuff as root.
There's corrupted data in the folder, i doubt its a problem with permissions, everything in the SD folder should be rw, especially if you're logged in as root. I think the problem is, you can't mount the SD partition like you can mount a physical SD, because the /sdcard partition is just a portion of all the memory on the device, which is being used by the phone, so it can't be unmounted and remounted by windows, therefore you can't use a dos utility like chkdsk or something to check it for errors, I don't know if there's a way to do it via adb shell, or terminal emulator.. fsck is the command for Linux to check a filesystem for errors, but the sdcard partition would have to be unmounted to run that command..
The fact that you're dealing with shared memory makes everything difficult unfortunately ..
You need to relax, I think no one here was being a Linux fan or response you in any offensive terms.
Originally Posted by Helpless_In_Seattle
Anyway, I'm expecting this in a Samsung Galaxy S3 (running CM10) with the internal SDCard and I think it's related and hopefully with more details we can go through the original issue in the Nexus as well:
- I create two folders using FileZilla connnecting through SHH with SSHDroid
- I want to remove them and have problems from FileZilla interface
- If I connect from SSH I can remove all the stuff in /storage/sdcard0 except the two folders. I'm root and it says permission denied. i.e I want to make a ls
- Additional to this strange behaviour, I notice that I can rename the folder without problems, even copy to /data or another rw fylesystem but I can't cut the folder or delete it from the internal sdcard
ls: can't open 'folder/': Permission denied
With the rename option I rename the folders to .garbage and .trash but I can't delete them either
- I tried creating two folders with same name in my PC and upload them to the phone to overwrite the original ones and get Permission problems again
- Create a file inside the folders fails too
From CMW I go to the option Mounts & storage->Format sdcard and I have this output:
# touch .garbage/algo
touch: .garbage/algo: Permission denied
Expected since there is no a specific mount point for the internal SDCard
Error mounting /sdcard!
As fnmetal said, it beign shared memory and no particular mount point complicates everything, I can't run fdisk i.e and in that case I don't even know which format do I have to give to the 'partition' because /storage/sdcard0 appears to be mounted with fuse
If you need additional info just let me know
Thanks in advance
Last edited by cristianpark; 10-12-2012 at 07:47 AM.
Guys, I put this double post because this one has the solution in it
I see in mount points something that gets my attention
Here you can see that /data/media is mounted with specific user and group ID. I discover by executing 'ps' and 'id' commands that 1023 ID belongs to media_rw user with wich the /data/media folder is mounted. I think login as media_rw user should do the trick but what I did in order to delete the folders was:
/dev/fuse on /storage/sdcard0 type fuse (rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1. Login as root (unnecesary if connected via SSH with SSHDroid)2. Mount /system with write permissions
3. Run sdcard command again (as root)
mount -o rw,remount -t ext4 /dev/block/mmcblk0p9 /system
4. Go to /data/media and delete the unwanted folders (let's say they are called .trash y .garbage)
/system/bin/sdcard /data/media 1023 1023
5. Mount /system with read only permissions again (for security reasons)
rm -rf .trash .garbage
6. Check that the folders doesn't exists
mount -o ro,remount -t ext4 /dev/block/mmcblk0p9 /system
the output must be something like this (no .trash or .garbage folders in here )
ls -lsa /data/media/
I hope this can help the thread creator to solve his problem and stop talking bad about Linux users
# ls -lsa /data/media/
4 drwxrwxr-x 14 media_rw media_rw 4096 Oct 12 10:25 .
4 drwxrwx--x 23 system system 4096 Oct 12 06:01 ..
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:06 .mmsyscache
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Alarms
4 drwxrwxr-x 3 media_rw media_rw 4096 Oct 12 06:03 Android
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 DCIM
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Download
4 drwxrwxr-x 5 media_rw media_rw 4096 Oct 12 06:09 GOLauncherEX
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Movies
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Music
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Notifications
4 drwxrwxr-x 3 media_rw media_rw 4096 Oct 12 08:55 Pictures
4 drwxrwxr-x 2 media_rw media_rw 4096 Oct 12 06:01 Ringtones
136520 -rw-rw-r-- 1 media_rw media_rw 139791302 Oct 11 23:06 cm-10-20121011.zip
85104 -rw-rw-r-- 1 media_rw media_rw 87138923 Oct 11 23:02 gapps-jb.zip
4 drwxrwxr-x 3 media_rw media_rw 4096 Oct 12 06:06 xiialive