How To Flash a Recovery Image Using Heimdall

Some people have been asking me how to flash the recovery using Heimdall.
I’m going to give you a quick step-by-step guide.

Using the GUI

  1. Download and install Heimdall. It’s open-source and supports Windows, Mac, GNU/Linux (including Ubuntu and Fedora) and a few other operating systems, as opposed to ODIN which is proprietary and supports only Windows.
  2. Reboot your phone in download (or ODIN) mode  (usually by holding volume down, home and power and by following the on-screen directions) and connect it to the computer; on Windows, wait for the device drivers to be loaded.
  3. Run Heimdall as administrator/root ( sudo heimdall-frontend).
  4. If it’s the first time you flash something to your phone using Heimdall, follow the following steps toobtain a PIT file; if you already have a PIT, skip them.
    1. Go to the Utilities tab.
    2. Press Detect to make sure the phone has been recognised.
    3. Click Save as under Download PIT and select a place to store the new file.
    4. Click Download.
    5. When it’s done, take the battery off your phone and put it back. Boot back to download mode.
  5. Go to the Flash tab and Browse for the PIT you just downloaded.
  6. Click Add under Partitions (Files).
  7. In the Partition Name menu select RECOVERY or your phone’s equivalent (names are usually pretty clear: BOOT is usually the kernel (never touch ABOOT though unless you know what you’re doing), SYSTEM is /system, USERDATA is /data, etc.)
  8. Click Browse under File and open the recovery image you downloaded. It should be in “.img” format (looking for a recovery for Samsung Galaxy Express SGH-I437? You can find one here!)
  9. Repeat steps 6 to 8 for any other partitions you need to flash, if any. If you’re done, click Start to start flashing!
  10. Enjoy!

Using the command line (much quicker)

The command lines is quicker, almost always. If you want to save 2 minutes of your life, just run (as root/admin) the following command:

heimdall flash --RECOVERY filename.img 

Replace filename.img with your recovery image file. Writing the command up to –RECOVERY and dragging the file onto the terminal usually works.

You can also replace RECOVERY with any other partition on your phone ( heimdall print-pit may help), or flash multiple partition at a time by adding –PARTITION_NAME filename.img.

I hope you found this useful! If you have any questions, let me know in the comments below! 🙂

There is a mobile optimized version of this page, view mobile Version.

18 Replies to “How To Flash a Recovery Image Using Heimdall”

  1. Hi David. I followed the instructions and succesfully flashed the RECOVERY partition:

    Session begun.

    Downloading device’s PIT file…
    PIT file download successful.

    Uploading RECOVERY
    RECOVERY upload successful

    Ending session…
    Rebooting device…
    Releasing device interface…
    Re-attaching kernel driver…

    But after rebooting, the recovery system ins still the factory default, not teamwin. Any ideas?

    1. Note to myself: You need to boot into recovery immediately after flashing. You can do this by running heimdall with –no-reboot option and the reboot by holding VolUp+Home+Power

    2. Hello Mike, as you said in your second comment, you need to boot to recovery immediately after flashing. The Samsung stock ROM flashes back the recovery on boot if it’s not their official one. TWRP does not have the ability to fix it, however if you flash a custom ROM, it won’t happen any more. If you want to stick with stock (I’m punny 😀 ) there is a CWM-based recovery that can disable this. I can post a link if you want.

  2. Hey,
    Thank you!
    Your tips save (at least) my life.
    It work likes a charm on Samsung Galaxy S4 mini LTE Int (serranoltexx). Merry christmas!

      1. I know, I only use the GUI to make Heimdall packages 😉 Command line is faster for a lot of stuff, GUI usually needs to load and controls are often nested in subwindows. And with command line you can usually do things like filtering stuff, which you can’t always do with GUI.
        By the way I’m glad you found my guide useful!

    1. I don’t have a Galaxy S6. You should ask for such information to Heimdall developers.
      Newer high-end phones are usually more problematic than lower end ones, as the OEMs tend to make them more secure.

  3. Hi there, I ran into a similar problem. I had CM 12 with its home made recovery installed. I used Heimdall to flash the newest twrp 3.0.2-0. Heimdall said flashing completed successfully, but after immediate reboot into recovery the old CM’s recovery was still in place. How can this be possible? On a second phone I ran into no such issues..!?!? Ideas?

    1. Hi,
      I’m not sure what’s causing your problem. You should try to ask Heimdall developers in their website. In the meantime, make sure you’re flashing to the right partition and that you’re not selecting the wrong options. Try to use the GUI, as it downloads the list of all partitions from the phone and shows them in a simple list. Also check the filename hint in heimdall’s GUI: it usually suggests what the file name for that partition should be.

Leave a Reply