Android: Installing System Images using flashboot

By Akbar 1 min read 19 comments

In my previous article, Installing Jelly Bean on Nexus One, I discussed how I was able to install Jelly Bean on my NexusOne using couple of tools and helper applications.

However, after a couple of days of exploring it, I decided to try to downgrade it back to Gingerbread (mainly because of the Camera issues). This step was even more simple than installing the Jelly Bean on my nexus one. The good thing was that I took the full backup of my Gingerbread before upgrading to the Jelly Bean (using ROM Manager). This backup folder had flash-able images of the system, boot and recovery partitions. So all I had to do to revert back the original version was to run couple of commands in the bootloader mode.

Here are the exact commands (for your info, and my future reference):

1. First you need to boot into bootloader mode. You can do this from key combination of your phone (for Nexus-One, it’s Power+Trackball down), or you can reboot into bootloader mode using the following adb command:

adb reboot-bootloader

2. Wait for your cell to reboot in bootloader mode, and once you see it, test it by running following command:

fastboot devices

If the above command lists your device, then you are good to go forward. Otherwise wait for few more second and/or check USB cable connection.

3. Once the fastboot mode is detecting the device, you can flash your Image and System flashable images using following commands:

fastboot flash boot boot.img
fastboot flash system system.img

4. The next step is to simply clear your cache and user-data to avoid any problem with previous ROM data.

fastboot erase userdata
fastboot erase cache

5. And at last, simply reboot your phone:

fastboot reboot

If everything went well, you should be able to see your previous version without any problems.

Feedback & Comments

19 Responses

  1. Romin

    Hi,My Lenovo A 6000 plus is stuck in boot loop, I am trying to flash system.img file using fastboot. It is succesfully flash but butmy device cannot out from bot loop. How can i recovery my device from boot loop ?
    Thanks.

    • adminAuthor

      This looks like either a problem with the flashing or the ROM you are trying to flash is not compatible. If you have the original ROM, did you try to flash it and see if this works correctly?

      Regards, Akbar

  2. Carmelo

    Hi, I’ve a big problem, I flash img and system, the messages are OKay (finished) 2 times.
    But when I restart, it’s always via Team win recovery project !
    Where the zip file is copied ?
    Thanks for your help

    Regards, Carmelo

  3. José

    Hi. I tried this command “fastboot flash system system.img” on a htc desire 510 0pcv220
    and I got this message

    C:Android>fastboot flash system system.img
    target didn’t report max-download-size
    erasing ‘system’…
    FAILED (remote: not allowed)
    finished. total time: 0.004s

    Thanks

    • Akbar

      Jose,

      Can you please make sure you bootloader is unlocked? Here is one thread discussing this in detail:
      http://forum.xda-developers.com/showthread.php?t=2603245

      Regards, Akbar

    • Raakib Zargar

      You dont have unlocked bootloader on your device

      • adminAuthor

        You need to unlock your bootloader first (but be careful as this may wipe user data). Search for “unlock bootloader” in google for your phone model, and carefully review the implications before going forward. You have been warned! 🙂

        Regards, Akbar

  4. Lwin Min Khant

    Hi admin,normaly how long to erasing system while flash?fastboot flash system system.img,is this right.I wait for about an hour,but it’s does’t run next.What should I do.

    • admin

      Lwin,

      It should not take that long. It may depend on the type of Mobile, but one hour is very long. Can you please make sure that ADB connection is correctly established, and does phone show any kind of progress or failure during this operation?

      Regards, Akbar

  5. Rodney

    Hello! My name is Rodney, I live in Brazil. I wanted to know if I can install system.img file starting from the recovery stock with the option: “aplly update from adb”

    • admin

      Hi Rodney,

      Even though I have never tried this option before (I think my phone doesn’t have this option), but from looking at the description of this option from web, it seems like it can do the job. So, you can give this a shot.

      Regards, Akbar

  6. sh: /sbin/postrecoveryboot.sh: not found please any help

    • admin

      Bene,

      I don’t remember listing this recovery command? Is this an error you are getting? If yes, running which command?

      Regards, Akbar

  7. Hi i cant because when the process begun it says erasing system and never run anymore. Also let it for a hour nth happens

    • admin

      Devkota,

      Exactly what process/command is taking long? If you can provide more details, I can see if I can help you.

      Regards, Akbar

  8. Kevin

    Hi,

    Great instructions, thanks.
    Any idea on what to do when you get the message: FAILED (remote: Heap not enough) when flashing the system.img?

    Thanks in advance.

  9. Kshitij Kapoor

    Hi Akbar,

    I have soft bricked my tablet by editing build.prop file. I am unable to adb push the default file I have. I want to flash the original system.img i hav obtained. I Just want to know if it is necessary to flash boot.img while flashing the new system.img.

    Thanks in advance

    • admin

      Kshitij,

      I’m not expert in Android OS, but as far as I know you can fix this by just flashing the system.img i.e. no need to flash boot.img.

      Regards, Akbar

Leave a Reply