Can't delete files, driving me nutsSupport

Last Updated:

  1. asdf12321

    asdf12321 Member

    Hello all.
    Once again I'm in need of help. This time with an issue which I've been strugling with the whole weekend and it's driving me nuts:
    Firstly, I have a Galaxy Nexus which does not have an external SD, but instead uses an internal partition that works as an SD card. Second, I currently have a stock, rooted ICS 4.0.4 but I've restored nandroid backups with 4.0.2 and the leaked JB 4.1 to see if they help somehow, but the problem remains:

    I have in the aforementioned SD partition a folder containing two rather large files which I need to delete. Altough its a bit technical for me, I've checked they have read and write permisions, yet they refuse to go. I have tried using 3 methods:
    1. Via USB cable: When I connect my phone to my PC, browse to the folder where the files are and delete them, they appear to be gone. But as soon as I reconect the cable or refresh the view, the files reappear.
    2. Remotelly with programs such as airdroid and Wifi file explorer: I use my computer's internet browser to navigate through my SD partition and delete those files as per each of the programs usage. Again the files appear to be deleted, but when I refresh the folder contents, the files remain.
    3. On the phone itself, with file explorers such as Astro filemanager: Same. I use the app to try delete the offending files and depending on the app I might get a message saying "files deleted" or something similar, but nothing happens with the files.
    I am at a loss on what to do because I can't think of what's causing this or how to solve it and I've reached my technical capabilities, so any help would be greatly, greatly appreciated.

  2. chanchan05

    chanchan05 The Doctor Guide

    Maybe they're system files, which the OS recreates as soon as you delete them?
    scary alien likes this.
  3. asdf12321

    asdf12321 Member

    Hi. They are definitely not system files. I copied them from my pc a few days ago. They are play station games I wanted to try with an emulator I bought, and because they are "images" extracted from CDs, they are rather large.
  4. jefboyardee

    jefboyardee Well-Known Member

    Do their filenames have periods in front?
    scary alien likes this.
  5. asdf12321

    asdf12321 Member

    Not in front, and I can't rename them either.

    If this were an external sd card,I'd just format it and be done with it, but I don't know if that can be done with "virtual" storage
  6. iowabowtech

    iowabowtech root@android:/ #

    What happens if you drag and drop the files from the internal storage to the PC desktop while connected via USB cable?
    scary alien likes this.
  7. asdf12321

    asdf12321 Member

    The files get copied normally to my PC. On my PC I can rename, delete or do whatever to those copies.
  8. lunatic59

    lunatic59 Moderati ergo sum Moderator

    You can format your internal storage which will wipe out all your files, app settings etc. But it should also get rid of those pesky game roms. Your internal storage is just a partition in internal memory much like a hard disk partitioned into multiple virtual drives.

    Back up all the files - including the hidden files - in your internal storage to a folder on your PC, then reformat the partition. Copy all the files back EXCEPT the game roms, overwriting any duplicates, and then reboot the phone.

    I can't guarantee it will work 100% but it should get rid of the files for you.
    9to5cynic and scary alien like this.
  9. asdf12321

    asdf12321 Member

    Do I understand you correctly in that you recommend I do a "factory wipe"? I might have to end up doing that, but I'd end up losing everything. I have a good backup, but I lack the time and willpower.
    Is there a way to format the "virtual sd" partition and only that, so the rest of my info remains?
  10. jefboyardee

    jefboyardee Well-Known Member

  11. lunatic59

    lunatic59 Moderati ergo sum Moderator

    I actually wasn't suggesting a factory reset. I was suggesting you format only your internal SD partition.
    scary alien likes this.
  12. Gmash

    Gmash Well-Known Member

    Have you tried using Root Explorer?
    scary alien likes this.
  13. asdf12321

    asdf12321 Member

    I have, same result: I get a confirmation popup stating that the files got deleted, but they don't.

    Great! That's a perfect workaround. Could you tell me how to do that without affecting my other stuff?
  14. lunatic59

    lunatic59 Moderati ergo sum Moderator

    Go to menu>settings>storage and you should see where you can format the internal storage. On my phone it's called USB storage and the SD card is called SD storage, but it's not consistent across phones of versions, so you'll have to figure out which one is the internal partition. The easiest way is to turn off the phone and remove the SD card. When you start it up what's left will be the internal partition.

    Remember to back up everything first because formatting this will clear a lot of app data and could even remove apps that were installed to SD card. It will also remove pictures, ringtones files, etc anything you've saved to your phone.
    scary alien likes this.
  15. asdf12321

    asdf12321 Member

    That was actually the first place I looked. I don't have any options to format anything. The one and only option I have there is "USB computer connection" where I'm asked if I want to "connect as Media device" or "connect as Camera". That is it. As stated on my OP I don
  16. lunatic59

    lunatic59 Moderati ergo sum Moderator

    scary alien likes this.
  17. Harry2

    Harry2 Well-Known Member

    With ICS there seems to be the option removed for to format the SD card.

    I don't find that option on my updated HTC Sensation any more, only the option to erase the SD card (that might mean, formating is included ;) ).

    scary alien likes this.
  18. breadnatty08

    breadnatty08 pain rustique VIP Member

    This is correct. I think the only way to do it is in a custom recovery.
    For mounting to your pc, you want to do it as a Media Device.
    Harry2 and scary alien like this.
  19. scary alien

    scary alien not really so scary Moderator


    Luna gave me a quick heads-up re. this thread, so I'm trying to get my bearings here, so I've got a couple of questions and ideas for you:

    1. First, if you know how to use adb, can you publish here the full path name and size of the files in question? Ideally, if you could do an adb shell ls -a -l filepathname and report the output here, that would be very helpful.

    Barring that, you could use Android Terminal Emulator (free in the Market) to do the same thing and capture a screen shot showing the output.

    2. Also, the output of a df /data command (adb shell df /data or just df /data from the Android Terminal Emulator) would show us your disk usage stats for the /data partition.

    3. As you've noted, the "SD card" is actually a soft-mount of /sdcard to the /data/media location on your filesystem (there's actually a program called fuse that facilitates this, too). So, that's why you don't see an option to format the SD card and you certainly don't want to try to format /data since its used for other "stuff" (that you need :)).

    4. I don't have a stock ROM booted-up at the moment (I'm running AOKP M4), but check to see if Settings -> Storage -> menu shows a "USB computer connection" option. If it does, there's a Media device (MTP) option that is typically checked. Try unchecking this to see if that helps you delete your file (I have no idea if it will or not, just an idea).

    5. If you able to, you could try to remove the files manually via an adb shell or from the Android Terminal Emulator as discussed above (i.e., via the rm filepathname command). Its possible that the file is actually open by something and that's why it cannot actually be deleted. Is there an app you have installed that might know about these files and might be holding them open?

    That's all I got for now, pending your feedback.

  20. iowabowtech

    iowabowtech root@android:/ #

    Agree with Scary, I'd try adb although it's odd other means keep failing. I made a mock up session with a fake file called Here are the steps I used to delete from /sdcard (/data/media):


    Oops, there's one other command I should have circled just under adb data/media.
  21. scary alien

    scary alien not really so scary Moderator

    Beautiful! :)

    Thanks, IBT! :)
    iowabowtech likes this.
  22. asdf12321

    asdf12321 Member

    I sincerely wish to thank all of you who helped me on this thread.
    Using the rm command on the adb command prompt I was able to finally get rid of those two files I couldn't before.
    I was so excited to try that out that I did it before doing what scary alien asked me on points 1 and 2, but its moot anyway since the files are gone for good. The difference this time, and the reason I know they will not appear again, is that the space they occupied on my SD partition is now free.
    So thank you all, my problem is solved, and I appreciate your time and advices.
  23. scary alien

    scary alien not really so scary Moderator


    This thread is a good example of what we try to do here at AF :).

    Lots of very helpful members chipping-in to help one another out--that's what makes this place so great.

    We hope you'll hang-around and make our little forum your home, too!

    Cheers and thank you for your post--that was really cool.
  24. scary alien

    scary alien not really so scary Moderator

    Hey guys, I've moved this thread to the Samsung Galaxy Nexus area since it seemed to be a pretty device-specific issue ("SD card" differences, etc.).

    Don't think the solution was really root-related, so I've placed it in the main GNex area (a few minor root references, notwithstanding ;)).

    Cheers and thanks to dreadnatty08 for the heads-up re. this!

    Have a great 4th, everyone!

    drkokandy, lunatic59 and iowabowtech like this.
  25. drkokandy

    drkokandy Member

    Hi all,
    I am having a nearly identical issue, but this is not working for me. I apologize if I should have started a new thread, but this is nearly identical.

    What might be making this more impossible is that the files I'm trying to delete are pinned music files from Google Music. Before I rooted, I had pinned almost 7GB of music onto my Galaxy Nexus. I used adb backup & restore, but Google Music could not function (I got a weird "No space available" that prevented streaming or pinning). I solved that issue by renaming the "artwork" and "music" folders in the Google Music. But now there's no way to get rid of those folders or the files within them.

    I can't post screenshots because I'm new, but I can tell you that the permissions are:
    drwxrwxr-x root sdcard_rw 2012-07-07 11:07 nameoffolder
    [and the files inside have the same permissions]

    1. using chmod after su doesn't do anything (and in fact the Root Explorer app says that it's not possible to change permissions in the sdcard).
    2. Using rm -r results in permission denied.
    3. Using rm -rf isn't recognized.

    Now the one thing that I don't get: is in iowabowtech's picture, you're listed as root@android - but I'm always shell@android (in adb shell) or app(somenumber) in the terminal emulator. How can I actually log in as root (or add my terminal app to the sdcard_rw group)?

    Any other ideas? :confused:

Share This Page