05 November 2011

Android Boot Loop: SD Card Related Fixes

Even though I haven’t done anything other than use my Android Samsung Galaxy SII normally it sometimes gets into a boot loop. This happens whenever I un-mount the USB storage or when having just installed an app onto the SD card.
The system boots up as per normal and then just after it displays a message "media scanner running (SD card)" it just re-boots. If I leave it alone it will just continue doing this ad infinitum. If I take out the SD card and re-boot it will operate without any problems. However, most of my apps are installed on the SD so that’s not much use.
I have found two fixes for this very annoying problem: re-formatting the SD card; and inserting the SD after boot.


Reformat the SD card
Even though I use an SD to micro SD adapter for this purpose it still takes ages but on the positive side it does make me create a backup of my SD card.
    1. Take out the SD card (you can turn the phone on without it, but none of the apps installed on the SD will work).
    2. Copy the files to another computer and re-format it (as fat 32).
    3. Re-copy the files back again
    4. Reinsert it into the phone.
Insert SD card after boot
This is possible on my phone (Samsung Galaxy SII) but may not be on yours. Useful when you’re on the move and re-formatting isn’t an option.
    1. Place the SD in the card slot but do not push it home.
    2. Carefully put the battery in place and hold the battery so the contacts are just touching the phone’s (the battery will not be fully in). If you’re doing it correctly the SD card shouldn’t be fully in it’s slot. Its fiddly and might take a few attempts but it works for me on my Galaxy SII
    3. Then turn the phone on and wait for it to completely finish booting.
    4. When it has, push the battery home which will push the SD card up into the slot. Media scanner should run and then it should work as normal.
I haven’t yet found the actual cause so for the time being these fixes will have to do. Unfortunately my search results are over crowded with those unrelated to SD. I find it very annoying that the system can’t just overcome whatever problem it’s having with my SD, particularly because I feel if inserting it after boot works there can’t be any major problem with the SD.


Remove Offending Apps
The previous solutions are ok as a temporary solution. My phone started by doing it only every so often e.g. when I disconnected USB file transfer or installed some apps. Then it started doing it on any app install and every time I connected USB storage. ENOUGH!


I had already figured out it was something to do with the SD card. Reading other peoples fixes they found a resolution when they uninstalled all apps from the SD. This isn't an option for me as I have too many to move them to the phone and anyway this is the whole point: not to use up valuable phone memory with installed apps.


I had a hunch that it is caused when apps installed on SD are run before the SD is ready so the system flops. These were the steps I took to find the culprit:
  1. Establish possible causes: Install Advanced Task Killer (other task managers are available) on the phone and after a reboot (using the “Insert SD after boot” method above) load it up to see what apps were running all by themselves. Write these down and note which are running as services, and which are installed on the SD.
  2. Backup those Apps: Install Astro File Manager or another utility that allows App backups. Use Astro to backup the Apps you wrote down in step 1 (Menu, Tools, Application Backup). This is so you don't have to re-install them from the market.
  3. Uninstall: Remove any that you just don’t want running randomly by themselves, don’t use or that you think would try to access the SD card. For me these included: Flickr (probably accessing my camera pictures located on SD), Facebook (which has an Uploader service, again which will probably need my SD) and Contapps which I haven’t used of late.
After taking these steps try connecting USB storage and transfer some files across, disconnect it and install a (non service) app on the SD.
    This seemed to fix the problem for me, although of course to really find the culprit I should have done them one by one but I didn’t have time.

    [Update1] After a month or so of trouble free operation after taking these steps I am going to try installing the apps again one by one and will post results here.



    [Update2] This has definitely solved my problem. It's a few months now and I haven't seen the issue re-surface.


    [Update3] I think it's Facebook


    In Conclusion
    Only install one app at a time and test operations like connecting and disconnecting USB storage in between.


    I am using a Samsung Galaxy SII with Android 2.2 aka Froyo. NB I have not rooted it.

    9 comments:

    1. what rom you are using ? i have the exact thing with checkrom and tried many methods none seemed to work even replaced sd card

      ReplyDelete
    2. I haven't installed a new rom, I'm just using the stock Orange supplied one: currently 2.3.3

      In my case it's seems to be an app trying to use the SD before it's ready but if you have taken the SD out (and therefore out of the equation) then it could be something more fundamental. Do you have any apps installed on it? If you can remove them and try that.

      If it's in a boot loop cycle just after flashing the new rom perhaps try again either the same or with a different rom. Be warned it is said you can only flash a rom so many times before it gives up though, although a few times is ok in my experience 20 might not be.

      I don't have any experience with Checkrom, just Cyanogen which I installed on an old G1 which I covered here: http://blog.coultard.com/2011/03/install-android-22-on-t-mobile-g1-dream.html

      ReplyDelete
    3. my loop is caused by sd card, i found out if u plug the sd to pc and copy the files , format the card and reput them some times the problem will go away , i thought the problem from my sd card so i bought a new 32 gb samsung class 10 , but the same problem happends -_-

      i tried to use task manager and uninstalled any app thats on sd thats runs a service , but no use

      this weird thing never happend to me with sgs 1 only with my sgs 2

      ReplyDelete
    4. @faDol I doubt it's your SD card, more likely an app. I know it's a pain but maybe try un-installing ALL apps then check it works, then install one by one? Rather than just deleting them you can use an app like Astro File Manager to backup apps to the sd card first then you can re-install them from there rather than from the market.

      ReplyDelete
    5. Hello.

      I have encountered today the same problem, but I can call myself lucky because I solved it quick.
      So, just as I got home, I turned on the WiFi on my Samsung Galaxy Gio. It started syncing the calendar and contacts as usually (displayed by a rotating icon in the notification bar) and right after it stopped, I wanted to launch an application called Compass. It didn't seem to start, and after a while it force closed unexpectedly. Not knowing what happened, I have gone to Settings -> Applications -> Manage applications. There I have noticed that the application Compass does not have an icon and that it has a weird name. I scrolled further until I found out that another app as well encountered the same thing. So not knowing what to do, I reboot my smartphone. (bad idea, hehe) And after that I was stuck in this reboot loop while the media scanner was running. Desperately not wanting to have my phone rooted, or flashed or whatever complicated stuff, I just pulled out the sd card from the slot. After that, the phone booted perfectly fine. From here, I could navigate back to Manage Applications and uninstall both faulty apps. Then I put my sd card back, and voila! Everything ran perfectly. So next time you reboot your phone, don't forget to check if all apps have the correct icon.

      ReplyDelete
    6. Thanks Phil for taking time for helping us!. I did the "insert sdcard after boot" method and worked great.
      In my case the problem started after my PC went into "sleep" mode (after a while not using it), while i had the phone connected as a mass storage unit. I found it looping after that.

      ReplyDelete
    7. wow I'm having the same problem on my Galaxy Note. Started happening about a month after I moved some apps to sd. works fine without Sd, and boot loops when I have the sd in soon after the "loading feeds" icon appears. trying to delete all apps on Sd. unfortunately not quick enough to get to the apps manager by the time the leading feed icon appears. looks like I will have to reformat on pc with an Sd adaptor.

      ReplyDelete
    8. thanks this helped me a lot!

      ReplyDelete
    9. I got by the boot loop by disabling "sync accounts in background" in accounts manager.. now uninstalling apps on sd.

      ReplyDelete