Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I recently tried updating my Motorola Atrix 4g. It downloaded, and then it booted down to try to update. However, instead of updating, it ends up booting to a screen that just says

Failed to boot 2
Starting RSD mode

If I take out the battery, I boot up the phone for about 60 seconds before it starts shutting down again.

The phone is rooted, and it seems like it starts shutting down as soon as Android starts giving out root privileges.

Looking through different forums online, it seems as though the best solution to stop the phone from trying to update (without erasing all my data by resetting the phone to factory settings) is to clear the Dalvik cache.

The problem I am having is that so far, it seems that in order to clear the cache, I need root, but as soon as my phone has been on long enough to give out root, it restarts, and I can't do anything with it. To make the problem worse, I seem to be unable to boot into recovery...

Is there any way to clear the Dalvik Cache (really, really fast, and) without root (or recovery)?

share|improve this question

3 Answers 3

I finally figured it out, here's how I did it:

Even though adb can't get root, and the phone it's self can't get root, as it turns out, there is in fact one more way to clear the cache without fully booting the phone.

  • Turn the phone off
  • Make sure you have fastboot working on your computer
  • Press the power button on the phone and then hold down the volume down button until you see fastboot, then hit the volume up button.
  • Open a terminal window, and type the following

    sudo su
    fastboot erase cache
    

And (apparently) voilà! The cache is cleared!!

share|improve this answer
    
Yepp, /cache is cleared. But not /data/dalvik-cache. Quoting rootzwiki: fastboot erase is very straight-forward: It erases the specified partition. Example: fastboot erase cache will erase the contents of the /cache partition. To say it again: that's the app-cache, and not the Dalvik-Cache. –  Izzy Apr 12 '13 at 22:45

That's unlikely to be possible. Dalvik cache is stored in /data/dalvik-cache, and doing an ls -l /data (as root) shows:

drwxrwx--x system   system            2013-03-29 14:54 dalvik-cache

As you can see, it is owned by user system of the group system, and all other users only have "execute" permission (i.e. they are only permitted to change into that directory). Digging a little deeper with ls -l /data/dalvik-cache shows e.g.:

-rw-r--r-- system   app_17    6416640 2013-03-02 00:28 data@app@com.google.android.apps.maps-1.apk@classes.dex

All files in here are again owned by system, which is again the only user with write permission (i.e. also the only one who could delete files). The app corresponding to each .dex file is represented as group; but as all "other" users, only has read-permissions.

Conclusion: only root can delete stuff here -- be it from a regular shell or via a custom recovery like e.g. ClockworkMod. Or via a , of course...


One thing you could try, though, is booting into . If any user app is causing the trouble, the device should boot up fine (as all user apps are skipped in safe-mode). A second suggestion is to attach your device via USB and try to capture a logcat (via adb logcat) to get some more hints on what could causing the trouble. This would of course require USB Debugging to be enabled. In case it was not yet enabled, you might be able doing so from safe-mode (I'm not sure about this, as I've never tried).

share|improve this answer

Do this:

sdk/platform-tools/adb shell

 shell@android:/ $ su system                  # switch from user "root" to "system"
 system@android:/ $ cd data/dalvik-cache/
 system@android:/data/dalvik-cache $ rm *
 system@android:/data/dalvik-cache $ exit
 shell@android:/data $ exit

and reboot your phone.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.