• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Help Can't delete files, driving me nuts

asdf12321

Newbie
Jun 9, 2012
22
5
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.
 
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

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.
 
Upvote 0
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. ...

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?
 
Upvote 0
Have you tried using Root Explorer?
I have, same result: I get a confirmation popup stating that the files got deleted, but they don't.

I actually wasn't suggesting a factory reset. I was suggesting you format only your internal SD partition.
Great! That's a perfect workaround. Could you tell me how to do that without affecting my other stuff?
 
Upvote 0
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?

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.
 
  • Like
Reactions: scary alien
Upvote 0
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 ;) ).

Harry

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.
 
Upvote 0
asdf12321,

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.

Cheers!
 
Upvote 0
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 aaa.zip. Here are the steps I used to delete from /sdcard (/data/media):





adb.png



Oops, there's one other command I should have circled just under adb shell...cd data/media.
 
Upvote 0
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.
 
Upvote 0
asdf12321,

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.
 
Upvote 0
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!

:)
 
Upvote 0
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? :thinking:
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones