Android users who want to have a little adventure use many mods and frequently change ROMs to make their devices brand new everyday. But you might never know when your device might get into a boot loop after installing a Mod or in the worst case it might get bricked and you need to restore the device. So it’s always advisable to take Nandroid backup of your device whenever possible, so that you can restore your device whenever you face a little ill fate. If you don’t know how to take a nandroid backup, follow our guide from the below link.
How To Take Nandroid Backups Using Custom Recoveries
But what if you have an old CWM nandroid backup of your device but you’ve moved to TWRP recently.(or Vice Versa) We know how frustrating it would be, but don’t lose your hope yet as we are going to show you how to convert your nandroid backup into a flashable Zip so that you can flash it using any custom recovery. Once you got a Zip file, you can either transfer it to the SDcard on your bricked device or if your device doesn’t sport an external SDcard, then you can sideload it using the ADB tool.
So let’s begin our little tutorial on creating flashable Zip files from CWM and TWRP backups.
Create Flashable Zipย from CWM/TWRP Backup
The method for creating flashable Zip from CWM and TWRP backups are different as both the recoveries use different techniques to backup the device.
For CWM Backup
- Transfer the CWM backup from Phone to PC.
- Extract system.ext4.tar file with any of the archive apps like Winrar or 7zip, you will get the system folder of your device containing all the files.
- Gather the boot.img from the CWM backup.
- Now collect a META-INF folder from any custom ROMย which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
- Selectย theย META-INF, System folders and theย boot.img and right click your mouseย and select add to Archive.
- In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
That’s it, your flashable Zip is now ready and you can flash it using any custom recovery.
For TWRP Backup
- Transferย the TWRP backup from Phone to PC.
- You’ll see a file named system.ext4.winย which is the System partition backup of your device.ย Rename itย to system.ext4.tar (Changing its extension from .win to .tar)
- Extract the system.ext4.tar using an archive software like Winrar or 7zip.
- If yourย TWRP backup is not in compression mode, you will directly get the system folder,ย elseย you will get a file named system.ext4, which should be renamed again toย system.ext4.tarย and extract it to get the system folder.
- Takeย the boot.emmc.winย file and rename itย to boot.img.
- Now collect a META-INF folder from any custom ROMย which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
- Selectย theย META-INF, System folders and theย boot.img and right click your mouseย and select add to Archive.
- In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
Now you can use this Zip file to flash it on your Custom recovery.
Leave your feedbackย regarding the guide in the comments section below.
use assayyed kitchen, put both system file and boot.img in the working folder. open the kitchen and chose number 6 and stand alone, this will give you the meta-inf
what if there isn’t any meta-inf folder for my device? how can i generate it?
Complete BS.
You Windows users stick to Windows phone continue renaming extensions all your file.
this is not bs! it works on windows computer..
Take backup again and try renaming it
Then you have to write all by yourself or somehow make it compatible to use it with Android kitchen (easiest method)..
Can-do from Android device itself?
yes. use rar or es file explorer to extract the twrp system backup
By following this procedure appears that only a part of the copy made with the recovery will be replenished. I do not see that the partition “/Data” is replenished. Probably I’m in mistake, but I need this clarification
I want to make a ZIP from the existing CUSTOM ROM, and can I get the META-INF folder from that CUSTOM ROM? (Monde7 rom for Note4 ExyNos)
Hi, I don’t have boot.img in the backup folder. can I get it elsewhere?
you cant.
hi,
Why do i need META folder from any custom ROM ? My stock ROM backup wont have that folder? (resulting flashable ROM will be the stock rom from the device i guess)
Every custom recovery has their own backup method resulting in different compression techniques and stuff. So you can restore it with the same recovery because other recoveries might use different decompression technique(sometimes, I even faced issues with different versions of same recovery). When you want to use your backup as flashable zip to flash it from any recovery, you need a universal code that can be understood by any recovery. Hence we need Meta-inf folder, in which you have an updater script of your device which tell a recovery what to do with the flashable zip.
thank naveen for the info…..
Prob is my backup do not have sys.ext4. file but there is sys.rfs. file… still need to use same method?
2. off topic, why ODIN (samsung) needs diff files for flashing (Modem,PIT etc) but flashable files are single alone
best wishes
1. How did you take the backup in the first place? Anyway, all you need to do is to place all the contents of system folder of your device in the flashable zip. So you can look for a rfs extractor and extract the system.rfs file. Usually system directory contain folders like app, bin, etc, usr, framework and many more. If you have these contents after extracting the rfs file, you’re good to go.
2. ODIN Firmware is usually in .tar or .tar.md5 format. The PIT file contains partition details of the device, so if you ever need to re-partition your device, you will need it. Modem.bin is used for restore radio (2G, 3G related) on your device.
1. I took backup with CWM via recovery mode. Backup folder has 5 files.. (nandroid.mdf ,cache.rfs.tar, .android_secure.vfat.tar ,data.rfs.tar and system.rfs.tar
2. flashable zip dont need these PIT,MODEM files like ODIN uses ?
3. Can i use this flashable zip on another phone (same make and model) ?
Got an interesting side question: Would this be useful to convert ext4 to f2fs? As TWRP creates ISO-like files, you can’t just restore an ext4 backup to a f2fs partition. Would this zip be similarly file-system dependent/ISO-like, or would it instead work by installing the data to any filesystem? Thanks in advance. There are a lot of people that could really benefit from this.
IMO, the f2fs partition support is embedded in the kernel of the device (boot,img). In this method, you’re restoring the boot.img which replaces the kernel as per the backup. Additionally, you need to edit the updater script of the ROM to replace the ext4 specific code to the relevant f2fs code. If you use a ext4 compatible kernel and updater-script on a f2fs partitioned system, it might lead to a soft/hard brick. However, if you’re sure to unbrick your device, you can give your idea a try but we would recommend you to take necessary measures in case of any misfortunes.
Can i get any META-INF that compatible on my Device?
Yes, download any flashable zip meant for your device, extract it and copy it.