Home Forum Blog Private Support Courses
Our courses are now on YouTube! Start Watching
Hovatek Forum OPERATING SYSTEMS Android How to extract .img from .lz4/.tar & convert .img to .lz4/.tar for Samsung | Odin

How to extract .img from .lz4/.tar & convert .img to .lz4/.tar for Samsung | Odin

How to extract .img from .lz4/.tar & convert .img to .lz4/.tar for Samsung | Odin

hovatek
hovatek
hovatek
Administrator
50,906
22-03-2021, 10:39 AM
#1



This guide will explain how to unpack a Samsung .tar or .lz4 image to get a .img image and how to convert a .img into .lz4 or .tar for flashing in Odin. In this example, we'll be using a recovery.img.lz4. We'll look at both Windows & Ubuntu (Linux) methods.

Note
  • The order for extraction is .tar > .lz4 > .img, and the order for compression is .img > .lz4 > .tar 
  • The file names used in the commands below are for example and should be modified accordingly

Windows



Requirements


Steps to extract recovery.img from recovery.img.lz4 using Windows


Follow the steps below to unpack .img.lz4 to obtain .img


See the video below or @ https://youtu.be/UxqwsFe9pj8


  1. Extract the contents of the tool and the recovery.img.lz4 into the same folder

    [Image: How-to-unpack-recovery.img_.lz4-to-recovery.img-1.webp]

  2. Drag the recovery.img.lz4 and drop it on lz4.exe

    [Image: How-to-unpack-recovery.img_.lz4-to-recovery.img-2.webp]

  3. Wait while the image file is extracted

    [Image: How-to-unpack-recovery.img_.lz4-to-recovery.img-3.webp]

    You should now see a recovery.img which can be unpacked using your favorite kitchen

    [Image: How-to-unpack-recovery.img_.lz4-to-recovery.img-4.webp]

Steps to convert recovery.img to recovery.img.lz4 or recovery.img.tar using Windows


  • Drop the recovery.img on lz4.exe
  • Compress the generated recovery.img.lz4 to tar using 7zip


Ubuntu (Linux)



Requirements

  • Install lz4, tar and md5sum

Steps to extract recovery.img from recovery.img.lz4 or recovery.tar (same command as recovery.tar.md5) using Ubuntu



Run the command
Code:

tar -xvf recovery.tar.md5 lz4 -d recovery.img.lz4

Steps to repack recovery.img to recovery.img.lz4 or recovery.tar.md5 using Ubuntu



Run the following commands:

Code:

lz4 -B6 --content-size recovery.img recovery.img.lz4 tar -H ustar -c recovery.img.lz4 > recovery.tar md5sum -t recovery.tar >> recovery.tar mv recovery.tar recovery.tar.md5
[/list]
This post was last modified: 23-01-2026, 05:32 PM by hovatek.

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Jk josh
Jk josh
Jk josh
Newbie
2
26-07-2025, 11:20 PM
#2
What about how to download the md1db &apdb files in the firmware
maxpayne
maxpayne
maxpayne
Intern
4,774
31-07-2025, 04:05 PM
#3
(26-07-2025, 11:20 PM)Jk josh What about how to download the md1db &apdb files in the firmware

Create a thread by clicking Ask Question at the top

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
WhTlYt