# How To flash [ SYSTEM.IMG ] using TWRP



## vinay durva (Feb 17, 2017)

Hii..  All ,  I'm using A Lyf wind mobile  , I have my my orginginel  ( system.img  )   file I don't have PC Computer . ,  I'm using TWRP 3.0  ..   Somebody help me how to flash a System.img  using TWRP 
        _ THANKS _


----------



## Droidriven (Feb 17, 2017)

vinay durva said:


> Hii..  All ,  I'm using A Lyf wind mobile  , I have my my orginginel  ( system.img  )   file I don't have PC Computer . ,  I'm using TWRP 3.0  ..   Somebody help me how to flash a System.img  using TWRP
> _ THANKS _

Click to collapse



TWRP can flash .img files without having to do anything special.

Sent from my SM-S903VL using Tapatalk


----------



## vinay durva (Feb 17, 2017)

Droidriven said:


> TWRP can flash .img files without having to do anything special.

Click to collapse



Sir .. I was tried ,  there was only 2 options in TWRP 1st one recovery & 2cond one boot .. Which 1 ican  select ,,  I need to flash system.img


----------



## Droidriven (Feb 17, 2017)

vinay durva said:


> Sir .. I was tried ,  there was only 2 options in TWRP 1st one recovery & 2cond one boot .. Which 1 ican  select ,,  I need to flash system.img

Click to collapse



I dont think you've booted into TWRP yet, I think you're looking at bootloader, select recovery and see if it boots to TWRP.

TWRP has more than just 2 options, are you sure you have TWRP? What version is it? Does it look like this?
http://cloud.tapatalk.com/s/58a730280544c/Screenshot_2017-02-17-12-15-48.png?


If that's what you have, select Install then find your .img and flash it.



Sent from my SM-S903VL using Tapatalk


----------



## vinay durva (Feb 18, 2017)

Droidriven said:


> I dont think you've booted into TWRP yet, I think you're looking at bootloader, select recovery and see if it boots to TWRP.
> 
> TWRP has more than just 2 options, are you sure you have TWRP? What version is it? Does it look like this?
> http://cloud.tapatalk.com/s/58a730280544c/Screenshot_2017-02-17-12-15-48.png?
> ...

Click to collapse



   Yes sir I'm Booting Into TWRP , Then > install > install images >. I found 2 options 1st one BOOT 2cond RECOVERY    , but I won't to flash SYSTEM.img


----------



## Droidriven (Feb 18, 2017)

vinay durva said:


> Yes sir I'm Booting Into TWRP , Then > install > install images >. I found 2 options 1st one BOOT 2cond RECOVERY    , but I won't to flash SYSTEM.img

Click to collapse



I remember now that TWRP doesn't flash system.img  correctly, system.img isn't a standard .img, you need PC and use fastboot.

Sent from my SM-S903VL using Tapatalk


----------



## vinay durva (Feb 18, 2017)

Thanks Sir..  Any Another way to flash system ,  i don't have A PC


----------



## Droidriven (Feb 18, 2017)

vinay durva said:


> Thanks Sir..  Any Another way to flash system ,  i don't have A PC

Click to collapse



I wouldn't try it without PC

Sent from my SM-S903VL using Tapatalk


----------



## Aex12 (Dec 14, 2017)

vinay durva said:


> Thanks Sir..  Any Another way to flash system ,  i don't have A PC

Click to collapse



I know it is too late, but you can enter in Advaced > Terminal and then run this command:
dd if=/sdcard/system.img of=/dev/block/bootdevice/by-name/system

If your mobile phone doesnt have by-name symlinks you will need to enter the correct partition.


----------



## bettisg (Jan 26, 2018)

Aex12 said:


> I know it is too late, but you can enter in Advaced > Terminal and then run this command:
> dd if=/sdcard/system.img of=/dev/block/bootdevice/by-name/system
> 
> If your mobile phone doesnt have by-name symlinks you will need to enter the correct partition.

Click to collapse




hi aex, I have the same problem but I dont have the folder 

/bootdevice/by-name............

can you help me?


----------



## alterpeople (Aug 3, 2018)

it will not work.

try to make a folder and "mount -o loop file in it.
and it will be not mounted also if you specify file system type.
(if it work probably you can use the file)

so ,i don't know how fastboot write in partition or probably 
in to file system.

however if you do a dd  of your current system partition in a file , after  will be correctly mounted , or rewrited correctly in the original partition if you need.

then probably you cannot use fastboot system.img directly in twrp shell (using dd)

this is my experience (e2303 sony / pexorom 3.0 twrp 3.1.1)

if you are searching a fast way to know system partition device block 

cat /etc/fstab

and look for system

or just mount system in twrp , then in a terminal do a 

df -h 

and search for system

for e2303 was /dev/block/mmcblk0p30
(example)


twrp have busybox and light kernel.
so , is linux.

for better support try to ask 

tonystark88


----------



## alterpeople (Aug 3, 2018)

u need to use simg2img 
(sparse file format compression)












system partition device name can  be different on other phones.

done.
img can be write by twrp whitout pc/fastboot.

c'ya 

giuseppe


----------



## Andvelop (Sep 4, 2018)

just go to file manager and search for system partition, and on first part type your system.img location and 2 part type just system location


----------



## chr2002 (Sep 23, 2018)

I did this Steps on my Huawei P8. Sim2Img reported a non sparse image, so i moved directly to the DD steps. But after writing the image to the partition, the /system Partition cannot get mountet...
What the hell iam doing wrong ????

I extracted the system.img from an update.app Firmware file.
Its the same Firmware file i flashed before with the dload method.

I want to install TWRP on my Phone with an faulty USB Port. So i have no PC / ADB. I Installed the Firmware via the official Dload Method from Huawai. Then i used this crappy Kingroot to get root and installed TWRP.  Now i wanted to flash the stock system partition to get rid of Kingroot for Safetynet. 
But why i cant just flash the systempartition ?

Or is there another way to gain root for 15 seconds without traces ?


----------



## Droidriven (Sep 23, 2018)

chr2002 said:


> I did this Steps on my Huawei P8. Sim2Img reported a non sparse image, so i moved directly to the DD steps. But after writing the image to the partition, the /system Partition cannot get mountet...
> What the hell iam doing wrong ????
> 
> I extracted the system.img from an update.app Firmware file.
> ...

Click to collapse



Why not just use the settings in Kingroot to remove root? Or convert from Kingroot to SuperSu then use SuperSu app settings to remove root?

You don't have to flash the stock system to remove root.

Sent from my LGL84VL using Tapatalk


----------



## chr2002 (Sep 24, 2018)

Kingroots uninstall leaves traces in /system/xbin and Safetynet wont work. Why i did not try Supersu ? :-/

But i managed to flash the system.img without problems.
First i tryed an extracted system.img from the Huawei Firmware extractor and Sim2img reported an invalid sparse image. So i thought it must be a raw image.....And this was my mistake. It is a useless image for TWRP.
So i created a flashable zip (TWRP cant flash this, too and the /system partition is not mountable after flashing / installing this zip.
BUT, the system.img INSIDE this zip is a spase image, which sim2img can handle. It gave me a nice raw image which i just dd´d to /system and BINGO, my phone starts up normally 

The Short Version :

- Create a FLASHABLE ZIP with the Huawei Firmware Extractor
- use SIM2IMG in TWRP Terminal to get a RAW Image.
- dd´it to the /system partition


----------



## jab5555 (Oct 15, 2018)

*System img*

You use the restore in twrp to flash your system img, you just until the other boxes


----------



## ~phoeny~ (Jan 18, 2019)

Edit: Sorry wrong thread


----------



## ShmuelCohen (Oct 27, 2019)

*Lenovo K5 Pro ROM img*

After flashing img file (using TWRP 3.3.1) the phone (Lenovo k5 pro) starts in bootloader mode. Everyone can help?


----------



## Ho3eiN 10Q (Jul 11, 2020)

*Help u*

Hi u can download a deodexed rom because ais doesn't support some stock roms for ex ch Samsung roms. then decompile it.then decompile it with rar or zarchiver or etc. Then install android image studio (ais) from google

Then open it and tap unpack/mount and select system.img or system.img.ext4 file in decompiled rom . After mounting, copy all files to a directory for ex emulated/0/system/system or another. Attention if you copy it in another directory, rename it as (system) now copy the boot.img from decompiled rom into  emulated/0/system .then download this file 
https://forum.xda-developers.com/an...oid-o-beta-redesigned-emoji-set-t3608280/amp/
Extract meta-inf file into emulated/0/system using winrar or zarchiver or etc. Now you need to have a system folder,boot.img file and a Meta-inf in diractory emulated/0/system. Now compress system,boot.img and meta-inf into one archive and after completing, turn of your device and boot it into  twrp recovery and wipe data and cache without wipping internal storage then select install. Then tap select storage and select internal storage.then go to the file and select it and turn off zip singuature verification and install it after installing tis rom, install root zip file and wipe cache/dalvik art and then reboot your device. It may take between 5-25 minutes to boot. Enjoy your new rom

#issues
Sometimes your device maybe take bootloop so you need to install your stock boot.img file and after installing your root zip file choose wipe cache/dalvik art and then reboot your system.

#Alert 
1.Don't install the recovery.img file which exists in the decompiled rom because it takes your device into recovery mod and not boot anymore and after you need to install the stock rom using PC
2.your device maybe take bootloop in this method so do it with your own risk 

---------- Post added at 07:58 AM ---------- Previous post was at 07:53 AM ----------




ShmuelCohen said:


> After flashing img file (using TWRP 3.3.1) the phone (Lenovo k5 pro) starts in bootloader mode. Everyone can help?

Click to collapse



Reboot your device and install twrp official app and open it and select flash image from a directory and select your own twrp and reboot your device [root]
Connect your phone to a PC and install stock rom using ADB or another app which was made for your smartphone [no root]


----------



## vinay durva (Feb 17, 2017)

Hii..  All ,  I'm using A Lyf wind mobile  , I have my my orginginel  ( system.img  )   file I don't have PC Computer . ,  I'm using TWRP 3.0  ..   Somebody help me how to flash a System.img  using TWRP 
        _ THANKS _


----------



## ykgetnet (Oct 30, 2020)

*TWRP not showing system.img flashing option*

I have one problem after backup my frimware using miracle box I ported TWRP recovery version 3.1.1 using my backup recovery ( stock recovery which I backup it using miracle box) and flashed it to my phone Tecno pop 2 plus it's running mt6580 chipset on Android 8.1 go edition & everything is working fine but when I try to flash gsi rom wihch is supposed to be flashed in to  system.img but the only choice I got is 
1- boot 
2- recovery 
it doesn't show system. in short it doesn't give me a choice to flash system.img file


----------



## lebigmac (Mar 13, 2021)

Hi is it safe to flash system or super partition directly from TWRP using dd command? Do you have to use the bs and truncate option or not?
@munjeni told me that it's not good idea to use dd for this because it can cause hard brick.

What about lpflash from the partition tools? I tried it but it gives weird error.

Another option I was thinking about was flashing using this twrp command from the command line but it doesn't support super partition
`restore PARTITION-TO-RESTORE BACKUP-NAME`


----------



## ineedroot69 (Mar 13, 2021)

lebigmac said:


> Hi is it safe to flash system or super partition directly from TWRP using dd command? Do you have to use the bs and truncate option or not?
> @munjeni told me that it's not good idea to use dd for this because it can cause hard brick.
> 
> What about lpflash from the partition tools? I tried it but it gives weird error.
> ...

Click to collapse



you need to be very careful flashing system.img it might trigger dm-verity


----------



## ineedroot69 (Mar 13, 2021)

here's a screenshot of me flashing system just to show i'm *alpha male* 
don't try this unless you know nothing would go wrong


----------



## lebigmac (Mar 13, 2021)

Here is screenshot of me flashing system from recovery using dd command.
Funny thing is it actually worked LOL!
Took almost 8 minutes though as you must use raw file. Doesn't work with sparse file! I know because I've tried it lol






ineedroot69 said:


> you need to be very careful flashing system.img it might trigger dm-verity

Click to collapse



Thanks but I already disable dm verity and verification like this:

```
avbctl disable-verification
avbctl disable-verity
```


----------



## ineedroot69 (Mar 13, 2021)

lebigmac said:


> Here is screenshot of me flashing system from recovery using dd command.
> Funny thing is it actually worked LOL!
> Took almost 8 minutes though as you must use raw file. Doesn't work with sparse file!
> 
> View attachment 5248501

Click to collapse



The development on my device is quite dead also I'm the one who dump that system.img so I know it's completely stock at first I was worried about that sparse error but done flashing system.img multiple times and it always work  also I already trigger dm-verity that's why I'm not afraid casually flashing it .. does disable dm-verity would work if you already trigger it? One way to found out I do experiment then


----------



## Greydesk (Sep 21, 2021)

I'm in this thread to learn how to flash system.img from TWRP. I have a moto g8power that I successfully installed lineageos, twrp, root with magisk, and gapps. I want to take gapps off. I have found out that I can do this by wiping the system partition and flashing the original system.img. I have the system.img on the phone and I can see it in TWRP. However, the available partitions to flash to are:
Boot
DTBO
Super
Recovery
Logo
super

Which partition do I flash system.img to? When I installed LineageOS, I used adb and the fastboot commands. With TWRP installed, I don't have access to the fastbootd mode so I can't use ADB to install. 

Any help appreciated.

Greydesk


----------



## Greydesk (Sep 23, 2021)

I'm in this thread to learn how to flash system.img from TWRP. I have a moto g8power that I successfully installed lineageos, twrp, root with magisk, and gapps. I want to take gapps off. I have found out that I can do this by wiping the system partition and flashing the original system.img. I have the system.img on the phone and I can see it in TWRP. However, the available partitions to flash to are:
Boot
DTBO
Super
Recovery
Logo
super

Which partition do I flash system.img to? When I installed LineageOS, I used adb and the fastboot commands. With TWRP installed, I don't have access to the fastbootd mode so I can't use ADB to install. 

Any help appreciated.

Greydesk


----------

