How to make an Odin flashable .tar from .img

Search This thread

sk8erwitskil

Senior Member
Apr 11, 2010
1,368
2,635
San Jose
So i just wanted to share this info as it has been very helpful to me in my development process. When making custom recoveries you often end up with a recovery.img and with Samsung devices there isn't really a good way to flash those. The best way to flash these is to run the following on a linux box:

$ tar -H ustar -c recovery.img > recovery.tar
$ md5sum -t recovery.tar >> recovery.tar
$ mv recovery.tar recovery.tar.md5

Now you can flash that recovery.tar.md5 through Odin in the PDA tab. Im guessing you can use the same process on any .img file (userdata.img, etc.) you create but i havent tested that. Ive only tested this on recovery.img and it works great.

Sorry if this is old information but i couldn't find any posts in the Skyrocket section and just wanted to share this.

Thanks
 

cdshepherd

Senior Member
May 16, 2011
1,908
1,145
Easiest way I've found to flash a recovery img on skyrocket is to rename recovery file to recovery.img and place it on internal SD. (This won't work if your soft bricked and a tar file will be necessary )

Then type: dd if=/sdcard/recovery.img of=/dev/block/mmcblk022 in adb shell or terminal emulator.

That should work for any of our recovery images as long as you rename it to recovery.img and put it in your internal SD. I suppose you could replace /sdcard/ with /external_sd/ if you wanted to flash from external SD. Oh and don't be supprised if you catch a little heat for posting this in dev section.

Sent from my SAMSUNG-SGH-I727 using xda premium
 
Last edited:
  • Like
Reactions: SOHKis and ALD3

sk8erwitskil

Senior Member
Apr 11, 2010
1,368
2,635
San Jose
Easiest way I've found to flash a recovery img on skyrocket is to rename recovery file to recovery.img and place it on internal SD. (This won't work if your soft bricked and a tar file will be necessary )

Then type: dd if=/sdcard/recovery.img of=/dev/block/mmcblk022 in adb shell or terminal emulator.

That should work for any of our recovery images as long as you rename it to recovery.img and put it in your internal SD. I suppose you could replace /sdcard/ with /external_sd/ if you wanted to flash from external SD. Oh and don't be supprised if you catch a little heat for posting this in dev section.

Sent from my SAMSUNG-SGH-I727 using xda premium

dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p22 bs=4096

And not sure if there is a windows way. Try googling for Windows tar and md5sum. There most likely is a way.


Sent from my SAMSUNG-SGH-I727 using XDA App
 

jtdc

Senior Member
Aug 17, 2008
680
81
Geylang
Noob question.... Is there a way to do this on windows vs linux?

funny... nobody bothered to answer this.

The way to do this in Windows as I know:

1. Ensure the fastboot drivers for your device is installed.
2. Acquire the fastboot binary (this is fastboot.exe).
3. Test if fastboot can see your device. Open DOS Command prompt, go to the fastboot binary folder and run "fastboot devices" command.
Example: C:\FASTBOOT\fastboot devices ---> The output should be some sort of serial number.
4. Flash the img file you have via command "fastboot flash boot <image_filename>"
Example: C:\FASTBOOT\fastboot flash boot boot.img
 
Last edited:

ebaul

Senior Member
Mar 7, 2008
226
32
York
funny... nobody bothered to answer this.

The way to do this in Windows as I know:

1. Ensure the fastboot drivers for your device is installed.
2. Acquire the fastboot binary (this is fastboot.exe).
3. Test if fastboot can see your device. Open DOS Command prompt, go to the fastboot binary folder and run "fastboot devices" command.
Example: C:\FASTBOOT\fastboot devices ---> The output should be some sort of serial number.
4. Flash the img file you have via command "fastboot flash boot <image_filename>"
Example: C:\FASTBOOT\fastboot flash boot boot.img

What if this is for the note, where there is no fastboot? I can get to odin mode, or to recovery mode, but no fastboot...unless i'm missing something..??

Thanks
 
  • Like
Reactions: lpsrl

roqnla

Member
Jan 25, 2008
23
12
Burbank
Thank you for the post. I used your method but to flash TWRP as follows:

1. Downloaded recovery file (openrecovery-twrp-2.2.0-skyrocket.img) for Samsung Skyrocket from TWRP website on Linux.
2. Renamed file to recovery.img
3. Ran the following commands to covert IMG file to a TAR file:
tar -H ustar -c recovery.img > openrecovery-twrp-2.2.0-skyrocket.tar
md5sum -t openrecovery-twrp-2.2.0-skyrocket.tar >> openrecovery-twrp-2.2.0-skyrocket.tar
mv openrecovery-twrp-2.2.0-skyrocket.tar openrecovery-twrp-2.2.0-skyrocket.tar.md5
4. Flashed recovery using ODIN as customary.


It worked flawlessly with no issues. I highly recommend TWRP over CWM Touch Recovery. TWRP wipes things cleanly. You DO NOT have to wipe 3x which will reduce the wear and tear on your device.
 
  • Like
Reactions: sup2069

omar300

Senior Member
Jul 2, 2012
294
74
Toronto
What if this is for the note, where there is no fastboot? I can get to odin mode, or to recovery mode, but no fastboot...unless i'm missing something..??

Thanks

use samsung tool kit v2.3. i had same issue as u and this page only sort of helped me and i guessed my way to tool kit. you only need to install it and place the recovery you need to transform in its input folder, where ever you installed it. then run it and just follow the instructions its pretty easy.
 

mahanddeem

Senior Member
Nov 13, 2011
1,213
122
Thanks for the Pakistanian guy above me for reviving this vital topic ...

this method is great :
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p22 bs=4096

BUT to be sure no leftovers are there :
dd if=/dev/zero of=/dev/block/mmcblk0p22
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p22 bs=4096

Can be done inside Android if you're rooted , and a terminal emulator app is installed ...
 
Last edited:
  • Like
Reactions: omar300

omar300

Senior Member
Jul 2, 2012
294
74
Toronto
Thanks for the Pakistanian guy above me for reviving this vital topic ...

this method is great :
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p22 bs=4096

BUT to be sure no leftovers are there :
dd if=/dev/zero of=/dev/block/mmcblk0p22
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p22 bs=4096

Can be done inside Android if you're rooted , and a terminal emulator app is installed ...
Lol
its pakistani :p
btw great the other method worked for you :)
 

basha.ram

Member
Jul 30, 2010
47
6
So i just wanted to share this info as it has been very helpful to me in my development process. When making custom recoveries you often end up with a recovery.img and with Samsung devices there isn't really a good way to flash those. The best way to flash these is to run the following on a linux box:

$ tar -H ustar -c recovery.img > recovery.tar
$ md5sum -t recovery.tar >> recovery.tar
$ mv recovery.tar recovery.tar.md5

Now you can flash that recovery.tar.md5 through Odin in the PDA tab. Im guessing you can use the same process on any .img file (userdata.img, etc.) you create but i havent tested that. Ive only tested this on recovery.img and it works great.

Sorry if this is old information but i couldn't find any posts in the Skyrocket section and just wanted to share this.

Thanks

Would it be the same approach whilst with custom zImage? and load into PDA tab? or are they any other settings to flash custom kernel with odin... I tried flashing with heimdall v.1.3.1 and 1.3.2 both version results "fail to initialise protocol". could please provide any pointes on how to flash custom built kernel image on S2 lte.
 
  • Like
Reactions: mrbeers

mindmajick

Senior Member
Nov 26, 2010
3,999
3,034
Cape Coral, FL
Moto G Power
Anyone have a CWD backup for the Repp? I am both newb & noob to the rooting scene and deleted my backup when I factory reset my phone. Any help will be appreciated. I'm gonna spam this message until I get my 10 posts then I'll post a new thread. Sorry mods! My family is without a phone until I fix this!

I don't recommend that if you want help

Sent from my SGH-I727 using Tapatalk 2
 

Pure Drive GT

Senior Member
Jan 14, 2013
219
104
Huge thanks !

So i just wanted to share this info as it has been very helpful to me in my development process. When making custom recoveries you often end up with a recovery.img and with Samsung devices there isn't really a good way to flash those. The best way to flash these is to run the following on a linux box:

$ tar -H ustar -c recovery.img > recovery.tar
$ md5sum -t recovery.tar >> recovery.tar
$ mv recovery.tar recovery.tar.md5

Now you can flash that recovery.tar.md5 through Odin in the PDA tab. Im guessing you can use the same process on any .img file (userdata.img, etc.) you create but i havent tested that. Ive only tested this on recovery.img and it works great.

Sorry if this is old information but i couldn't find any posts in the Skyrocket section and just wanted to share this.

Thanks

Hi! First of all, thx a lot really was trying to find this out for a long time. One Question i have tough. I Only used the first command and left it as a simple tar file, flashed it with odin and all was well. So what do you actally do by adding md5sum and then renaming it? Is it better to add the md5sum or does it make no difference?

again huge thanks! I always used mskip toolkit, but i like to not depend on additional software ;)
 

RK

Senior Member
Feb 8, 2012
867
441
I believe ODIN will verify the md5 sum of the .img if the .md5 file is in the tar. Just in case your .img in the tar gets corrupted. If that happens ODIN will abort the flash and report something like md5 mismatch

Sent from my SAMSUNG-SGH-I727 using xda app-developers app

---------- Post added at 12:21 PM ---------- Previous post was at 12:20 PM ----------

So its not necessary but a good practice.

Sent from my SAMSUNG-SGH-I727 using xda app-developers app
 
  • Like
Reactions: Pure Drive GT

penditagila

Senior Member
Jul 28, 2012
72
9
Johor Bahru
www.hafizkadir.my
So i just wanted to share this info as it has been very helpful to me in my development process. When making custom recoveries you often end up with a recovery.img and with Samsung devices there isn't really a good way to flash those. The best way to flash these is to run the following on a linux box:

$ tar -H ustar -c recovery.img > recovery.tar
$ md5sum -t recovery.tar >> recovery.tar
$ mv recovery.tar recovery.tar.md5

Now you can flash that recovery.tar.md5 through Odin in the PDA tab. Im guessing you can use the same process on any .img file (userdata.img, etc.) you create but i havent tested that. Ive only tested this on recovery.img and it works great.

Sorry if this is old information but i couldn't find any posts in the Skyrocket section and just wanted to share this.

Thanks

very helpful... thx mate :D
 

DemonGloom

Senior Member
Jan 8, 2009
413
171
That's strange but command from first post don't work for me. Tablet says about incorrect file (.img, not .img.md5). So I've modified commands to make them work with Galaxy Tab 8.9 and Odin 1.8.5:
Code:
cp recovery.img recovery.img.md5
md5sum -t recovery.img.md5 >> recovery.img.md5
tar -H ustar -c recovery.img.md5 > recovery.tar
md5sum -t recovery.tar >> recovery.tar
mv recovery.tar recovery.tar.md5
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    So i just wanted to share this info as it has been very helpful to me in my development process. When making custom recoveries you often end up with a recovery.img and with Samsung devices there isn't really a good way to flash those. The best way to flash these is to run the following on a linux box:

    $ tar -H ustar -c recovery.img > recovery.tar
    $ md5sum -t recovery.tar >> recovery.tar
    $ mv recovery.tar recovery.tar.md5

    Now you can flash that recovery.tar.md5 through Odin in the PDA tab. Im guessing you can use the same process on any .img file (userdata.img, etc.) you create but i havent tested that. Ive only tested this on recovery.img and it works great.

    Sorry if this is old information but i couldn't find any posts in the Skyrocket section and just wanted to share this.

    Thanks
    3
    Noob question.... Is there a way to do this on windows vs linux?

    funny... nobody bothered to answer this.

    The way to do this in Windows as I know:

    1. Ensure the fastboot drivers for your device is installed.
    2. Acquire the fastboot binary (this is fastboot.exe).
    3. Test if fastboot can see your device. Open DOS Command prompt, go to the fastboot binary folder and run "fastboot devices" command.
    Example: C:\FASTBOOT\fastboot devices ---> The output should be some sort of serial number.
    4. Flash the img file you have via command "fastboot flash boot <image_filename>"
    Example: C:\FASTBOOT\fastboot flash boot boot.img
    2
    Easiest way I've found to flash a recovery img on skyrocket is to rename recovery file to recovery.img and place it on internal SD. (This won't work if your soft bricked and a tar file will be necessary )

    Then type: dd if=/sdcard/recovery.img of=/dev/block/mmcblk022 in adb shell or terminal emulator.

    That should work for any of our recovery images as long as you rename it to recovery.img and put it in your internal SD. I suppose you could replace /sdcard/ with /external_sd/ if you wanted to flash from external SD. Oh and don't be supprised if you catch a little heat for posting this in dev section.

    Sent from my SAMSUNG-SGH-I727 using xda premium
    1
    funny... nobody bothered to answer this.

    The way to do this in Windows as I know:

    1. Ensure the fastboot drivers for your device is installed.
    2. Acquire the fastboot binary (this is fastboot.exe).
    3. Test if fastboot can see your device. Open DOS Command prompt, go to the fastboot binary folder and run "fastboot devices" command.
    Example: C:\FASTBOOT\fastboot devices ---> The output should be some sort of serial number.
    4. Flash the img file you have via command "fastboot flash boot <image_filename>"
    Example: C:\FASTBOOT\fastboot flash boot boot.img

    What if this is for the note, where there is no fastboot? I can get to odin mode, or to recovery mode, but no fastboot...unless i'm missing something..??

    Thanks
    1
    Thank you for the post. I used your method but to flash TWRP as follows:

    1. Downloaded recovery file (openrecovery-twrp-2.2.0-skyrocket.img) for Samsung Skyrocket from TWRP website on Linux.
    2. Renamed file to recovery.img
    3. Ran the following commands to covert IMG file to a TAR file:
    tar -H ustar -c recovery.img > openrecovery-twrp-2.2.0-skyrocket.tar
    md5sum -t openrecovery-twrp-2.2.0-skyrocket.tar >> openrecovery-twrp-2.2.0-skyrocket.tar
    mv openrecovery-twrp-2.2.0-skyrocket.tar openrecovery-twrp-2.2.0-skyrocket.tar.md5
    4. Flashed recovery using ODIN as customary.


    It worked flawlessly with no issues. I highly recommend TWRP over CWM Touch Recovery. TWRP wipes things cleanly. You DO NOT have to wipe 3x which will reduce the wear and tear on your device.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone