[Q] Can't write to /storage/sdcard0/

Search This thread

Michele31415

Senior Member
Feb 14, 2011
70
9
This is a mystery. I have a Verizon Samsung Galaxy Note 2, running 4.1.1, rooted. A few days ago I ran out of space on the internal storage so I wanted to move /data/media/Download to /mnt/extSdCard/ and then symlink to it. But I screwed up and accidentally moved all of /data/media to the external SD card. I realized I did that and immediately moved it back to /data/. I did this using the Move command in RootExplorer.

Now I find I can no longer write to /storage/sdcard0/. For example, my S-Note files go there but when I try to save a note it says "Unable to save file". I have another app that also keeps data there and it too complains that it can't write to its own directory on /storage/sdcard0/. I also find there are files on sdcard0 I can't delete myself either with RootExplorer or from a terminal window, even with a "#" prompt.

/sstorage/sdcard0 has perms of 775, owned by root in group sdcard_rw. /storage has perms 775, owned by system in group sdcard_r.

I'm really stumped here. What the heck did I do to my phone? Any help would be *greatly* appreciated. Thanks!
 

MunkinDrunky

Senior Member
Feb 25, 2012
349
54
This is a mystery. I have a Verizon Samsung Galaxy Note 2, running 4.1.1, rooted. A few days ago I ran out of space on the internal storage so I wanted to move /data/media/Download to /mnt/extSdCard/ and then symlink to it. But I screwed up and accidentally moved all of /data/media to the external SD card. I realized I did that and immediately moved it back to /data/. I did this using the Move command in RootExplorer.

Now I find I can no longer write to /storage/sdcard0/. For example, my S-Note files go there but when I try to save a note it says "Unable to save file". I have another app that also keeps data there and it too complains that it can't write to its own directory on /storage/sdcard0/. I also find there are files on sdcard0 I can't delete myself either with RootExplorer or from a terminal window, even with a "#" prompt.

/sstorage/sdcard0 has perms of 775, owned by root in group sdcard_rw. /storage has perms 775, owned by system in group sdcard_r.

I'm really stumped here. What the heck did I do to my phone? Any help would be *greatly* appreciated. Thanks!

Do you have a nandroid backup? extsdcard and sdcard0 will stay untouched but maybe all you need its the system and data back to working order. I figure that's the first idea. I couldn't say what's happened though.
 

Michele31415

Senior Member
Feb 14, 2011
70
9
Do you have a nandroid backup? extsdcard and sdcard0 will stay untouched but maybe all you need its the system and data back to working order. I figure that's the first idea. I couldn't say what's happened though.
That would be nice but unfortunately I don't have nandroid. I just back up my files to the external SD card with Titanium Backup and then store a copy on my PC. To be honest, I was afraid of screwing up something by running nandroid so I never got it.

In the meantime, none of my apps that are parked on /storage/sdcard0 run anymore, all claiming they can't create files there. The only thing I've been able to do there is chmod and chown but it doesn't seem to help. If I delete a file with Root Explorer, it says it's deleted but when I refresh the directory, it's still there.

I don't see how the two could be related, but I keep coming back to /data/media. I also have a Galaxy S3 that's working. /data/media on the S3 is 775, whereas it was 770 on the Note 2. I changed it to 775 and rebooted - didn't help. I changed the group of /storage from sdcard_r to sdcard_rw - didn't help either.

Could you tell me what the properties are on your Note 2 of /data, /data/media, /storage, and /storage/sdcard0? I'm thinking that Root Explorer munged up something when I moved /data/media/ to the extSdCard and then back again. The subdirectories and files are all there but sdcard0 isn't happy now.

Thanks very much for the reply.
 

MunkinDrunky

Senior Member
Feb 25, 2012
349
54
That would be nice but unfortunately I don't have nandroid. I just back up my files to the external SD card with Titanium Backup and then store a copy on my PC. To be honest, I was afraid of screwing up something by running nandroid so I never got it.

In the meantime, none of my apps that are parked on /storage/sdcard0 run anymore, all claiming they can't create files there. The only thing I've been able to do there is chmod and chown but it doesn't seem to help. If I delete a file with Root Explorer, it says it's deleted but when I refresh the directory, it's still there.

I don't see how the two could be related, but I keep coming back to /data/media. I also have a Galaxy S3 that's working. /data/media on the S3 is 775, whereas it was 770 on the Note 2. I changed it to 775 and rebooted - didn't help. I changed the group of /storage from sdcard_r to sdcard_rw - didn't help either.

Could you tell me what the properties are on your Note 2 of /data, /data/media, /storage, and /storage/sdcard0? I'm thinking that Root Explorer munged up something when I moved /data/media/ to the extSdCard and then back again. The subdirectories and files are all there but sdcard0 isn't happy now.

Thanks very much for the reply.

Did you want to know what permissions those directories have?

/data rwx rwx --x
/data/media rwx rwx ---
 

Michele31415

Senior Member
Feb 14, 2011
70
9
Did you want to know what permissions those directories have?

/data rwx rwx --x
/data/media rwx rwx ---
Yes, thanks. That's the same I have on the Note 2, so that's not the problem (though oddly enough, on the S3, /data/media is rwxrwxr-x).

Still, it has to be *some* permission somewhere that's wrong and is preventing apps from writing or deleting files they have in sdcard0. What about /storage? I've got:

/storage r-xr-x--- owner=system, group = sdcard_r
/storage/sdcard0 rwxrwxr-x, owner = root, group = sdcard_rw

/storage in particular doesn't seem correct. ???

FWIW, here's someone else with the exact same problem - unfortuntely he didn't get a resolution: http://androidforums.com/android-lounge/716573-unable-delete-move-files-directories-sdcard0.html

And this one too: http://android.stackexchange.com/questions/30113/cant-delete-any-files-in-my-download-folder I tried the same things suggested there and they didn't work for me either.
 
Last edited:

MunkinDrunky

Senior Member
Feb 25, 2012
349
54
I dont know enough about the permission system. You said you tried terminal. Maybe try another root enabled file explorer. I've only used es and root browser. Maybe your binaries need to be updated.

You might consider starting fresh if you can't find a solution. From here on out I'd take care to be meticulous and read up on the how to threads for rooting and unlocking bootloader just so you have an idea of where what your going to do fits in with everything else. It sounds like you've just beet rooted and left your phone stock.

Perhaps the internal memory need to be reformatted and everything taken back to a stock working order? If your bootloader is unlocked and you have a custom recovery (like twrp or cw) you could back up all contents of your ext and internal sd to a computer, do a nandroid backup(just in case), and back up your apps with titanium, then wipe everything, system data cache dalvick through recovery then reformat internal sd and re flash the stock rooted image of 4.1.1 or 4.1.2.

If your bootloader is locked up still you could use Odin to get back to stock factory image. You would no longer be rooted but you can then reroot. This is always the end of the line and one can run into some bigger problems here.
 

Michele31415

Senior Member
Feb 14, 2011
70
9
I dont know enough about the permission system. You said you tried terminal. Maybe try another root enabled file explorer. I've only used es and root browser. Maybe your binaries need to be updated.
Yup - I've tried Root Explorer, File Expert, Terminal Emulator, and adb USB from the PC. Same result from all of them. Oddly enough, Root Explorer and FE both claim that files I select on /storage/sdcard0 have been deleted, but when I refresh the file list, they're baaaack...

You might consider starting fresh if you can't find a solution. From here on out I'd take care to be meticulous and read up on the how to threads for rooting and unlocking bootloader just so you have an idea of where what your going to do fits in with everything else. It sounds like you've just beet rooted and left your phone stock.
Yes, I only flashed the Verizon rooted stock ROM because that's all I needed. I just want to be able to use apps like Titanium Backup, get rid of that stupid clicking sound the camera makes, and other things you need root for. I'm happy with the other features of the standard ROM. I never bothered unlocking the boot loader.


Perhaps the internal memory need to be reformatted and everything taken back to a stock working order? If your bootloader is unlocked and you have a custom recovery (like twrp or cw) you could back up all contents of your ext and internal sd to a computer, do a nandroid backup(just in case), and back up your apps with titanium, then wipe everything, system data cache dalvick through recovery then reformat internal sd and re flash the stock rooted image of 4.1.1 or 4.1.2.
Yes, I've considered that, and it may come to that. But it's not a very intellectually appealing solution. It's sort of like burning down your house because you've got termites. I'm still hoping there's a less drastic solution. In the meantime, this may be locking the barn door after the horse is gone, but I downloaded a nandroid app and took a nandroid backup. Don't know if wiping and then restoring that will also restore the problem.


If your bootloader is locked up still you could use Odin to get back to stock factory image. You would no longer be rooted but you can then reroot. This is always the end of the line and one can run into some bigger problems here.
Yup, if that doesn't do it, it's time for a new phone :)

UPDATE:

I started looking at /data/media and comparing permissions there to what my S3 was showing. It seems /data/media was owned by media_rw in group media_rw on the Note2, but owned by root in group root on the S3. So in adb on the Note 2 I did #chown root:root /data/media. To my surprise, that worked. I then changed the permission from 770 to 775 to match what the S3 has. I then tried saving an S-Note - didn't work. So I went into /data/media/S Note and changed *its* owner/group to root, and permissions to 777 also. I tried saving a note and ... success! It saved it OK.

I'm starting to think that when I copied /data/media back to /data from /mnt/extSdCard/data/media, Root Explorer bollixed up the owner/group/permissions. I'm going to try some other directories there and see if that helps too. And see if this survives a reboot. So that's some progress at least...
 

MunkinDrunky

Senior Member
Feb 25, 2012
349
54
That is indeed good news. At least the permission will work through terminal on a subdirectory basis in the media dir. You could recursively change permission for all subdirectory in media. I belive -R probably best to Google that.
 
  • Like
Reactions: Michele31415

Michele31415

Senior Member
Feb 14, 2011
70
9
That is indeed good news. At least the permission will work through terminal on a subdirectory basis in the media dir. You could recursively change permission for all subdirectory in media. I belive -R probably best to Google that.
Well that seems to have done it. Everything is working once again. In the final analysis, it appears that you just can't change permissions or delete files from /storage/sdcard0/. However, this is apparently just a mount point (I may be wrong here) for /data/media/ and you *can* change permissions/owners/etc. there. Once I did that, the apps I had that had installed themselves on sdcard0/ started working again. Go figure.

And as a bonus, I got the motivation I needed to start doing nandroid backups and learned a little about the storage hierarchy of Android. So big thumbs up for taking the time to read all this and help me out.
 
  • Like
Reactions: Whitest

MunkinDrunky

Senior Member
Feb 25, 2012
349
54
Well that seems to have done it. Everything is working once again. In the final analysis, it appears that you just can't change permissions or delete files from /storage/sdcard0/. However, this is apparently just a mount point (I may be wrong here) for /data/media/ and you *can* change permissions/owners/etc. there. Once I did that, the apps I had that had installed themselves on sdcard0/ started working again. Go figure.

And as a bonus, I got the motivation I needed to start doing nandroid backups and learned a little about the storage hierarchy of Android. So big thumbs up for taking the time to read all this and help me out.

Yeah I leaned more bout this too. As an after thought, I have only ever moved items from sdcard0 to extsdcard by going to /storage then copying items from one to another. I too believe this is just a mount point. Nevertheless, probably most items in /data/media you were trying to move to extsdcard are found in sdcard0 and accessible through the mounting folder: /storage, well at least /downloads are there in /storage/sdcard0/ and i have always navigated to /storage first then to /sdcard0/ to grab /downloads or /android/data/ to copy to external whatever.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I dont know enough about the permission system. You said you tried terminal. Maybe try another root enabled file explorer. I've only used es and root browser. Maybe your binaries need to be updated.
    Yup - I've tried Root Explorer, File Expert, Terminal Emulator, and adb USB from the PC. Same result from all of them. Oddly enough, Root Explorer and FE both claim that files I select on /storage/sdcard0 have been deleted, but when I refresh the file list, they're baaaack...

    You might consider starting fresh if you can't find a solution. From here on out I'd take care to be meticulous and read up on the how to threads for rooting and unlocking bootloader just so you have an idea of where what your going to do fits in with everything else. It sounds like you've just beet rooted and left your phone stock.
    Yes, I only flashed the Verizon rooted stock ROM because that's all I needed. I just want to be able to use apps like Titanium Backup, get rid of that stupid clicking sound the camera makes, and other things you need root for. I'm happy with the other features of the standard ROM. I never bothered unlocking the boot loader.


    Perhaps the internal memory need to be reformatted and everything taken back to a stock working order? If your bootloader is unlocked and you have a custom recovery (like twrp or cw) you could back up all contents of your ext and internal sd to a computer, do a nandroid backup(just in case), and back up your apps with titanium, then wipe everything, system data cache dalvick through recovery then reformat internal sd and re flash the stock rooted image of 4.1.1 or 4.1.2.
    Yes, I've considered that, and it may come to that. But it's not a very intellectually appealing solution. It's sort of like burning down your house because you've got termites. I'm still hoping there's a less drastic solution. In the meantime, this may be locking the barn door after the horse is gone, but I downloaded a nandroid app and took a nandroid backup. Don't know if wiping and then restoring that will also restore the problem.


    If your bootloader is locked up still you could use Odin to get back to stock factory image. You would no longer be rooted but you can then reroot. This is always the end of the line and one can run into some bigger problems here.
    Yup, if that doesn't do it, it's time for a new phone :)

    UPDATE:

    I started looking at /data/media and comparing permissions there to what my S3 was showing. It seems /data/media was owned by media_rw in group media_rw on the Note2, but owned by root in group root on the S3. So in adb on the Note 2 I did #chown root:root /data/media. To my surprise, that worked. I then changed the permission from 770 to 775 to match what the S3 has. I then tried saving an S-Note - didn't work. So I went into /data/media/S Note and changed *its* owner/group to root, and permissions to 777 also. I tried saving a note and ... success! It saved it OK.

    I'm starting to think that when I copied /data/media back to /data from /mnt/extSdCard/data/media, Root Explorer bollixed up the owner/group/permissions. I'm going to try some other directories there and see if that helps too. And see if this survives a reboot. So that's some progress at least...
    1
    That is indeed good news. At least the permission will work through terminal on a subdirectory basis in the media dir. You could recursively change permission for all subdirectory in media. I belive -R probably best to Google that.
    1
    That is indeed good news. At least the permission will work through terminal on a subdirectory basis in the media dir. You could recursively change permission for all subdirectory in media. I belive -R probably best to Google that.
    Well that seems to have done it. Everything is working once again. In the final analysis, it appears that you just can't change permissions or delete files from /storage/sdcard0/. However, this is apparently just a mount point (I may be wrong here) for /data/media/ and you *can* change permissions/owners/etc. there. Once I did that, the apps I had that had installed themselves on sdcard0/ started working again. Go figure.

    And as a bonus, I got the motivation I needed to start doing nandroid backups and learned a little about the storage hierarchy of Android. So big thumbs up for taking the time to read all this and help me out.