1

I happen to have an old phone laying around with messed up system partition(a couple of files accidentally deleted). This phone has an internal storage of max 1.5 GB(total 4gb, after setting everything up leaves me with 1.5 GB). I downloaded the stock firmware for the phone and the system.img size is almost 1.7GB I have twrp recovery. Is it possible to flash with an external sdcard. N.B: I unfortunately don't have my pc with me atm.

  • It would help if you could tell us what phone (manufacturer, model) this is. Apart from that: no worries about the size, /system is not "internat storage" but a different partition – which is one reason why only 1.5G are "left" from the 4G announced (the remaining ~800M are on the other partitions, like recovery, cache etc). – Izzy Sep 15 '20 at 23:51
  • 1
    Yes you can flash from SD card. There must be some free space out of 1.7GB, so you can put it in an archive to reduce size. Or expose system partirion through UMS to a PC and flash image there. Or stream the image over network (using adb/nc) and write to partition at the same time. There are even more possibilities. – Irfan Latif Sep 16 '20 at 04:48
  • @Irfan Latif, hey, turns out I can only flash boot partition using twrp, guess I'll have to settle for the pc then. I also came across this that it can be done with dd command as well. Like dd if=/storage/sdcard/system.img of=I forgot the name from twrp terminal. is that possible – silly goose Sep 16 '20 at 06:51
  • Yes. dd is the most commonly used tool in Linux world to read and write raw partitions. The methods I mentioned above are meant to be combined with dd to solve the problem of space shortage. – Irfan Latif Sep 16 '20 at 07:28
  • Yep, I know about dd disk dump, but am confused about the of=? directory as in where should I dump the contents to, at which directory. An idea just popped in my head, what if I extracted the files in system.img and replaced everything under / to the contents of the files from image. Isn't that the same thing as doing dd? – silly goose Sep 16 '20 at 13:56
  • Sorry, the link I mentioned earlier was suppossed to be this https://android.stackexchange.com/a/125422/332427 – silly goose Sep 16 '20 at 14:40
  • 1
    See this answer to know how you find correct block device. The answer is about userdata partition. Replace that with system. – Irfan Latif Sep 16 '20 at 15:09
  • 1
    Yep! found it in /dev/block/platform/mtk-msdc.0/by-name/system I did a ls -l on system and found that it is a symbolic link to /dev/block/mmcblk0p20 Now, should I do dd if=/storage/sdcard0/system.img of=/dev/block/platform/mtk-msdc.0/by-name/system or should I do dd if=/storage/sdcard0/system.img of=/dev/block/mmcblk0p20 Which one should I do? – silly goose Sep 16 '20 at 21:12
  • This idea also popped in my head, the stock rom was in a zip file. Is it possible to flash the entire thing using twrp? That would be super easy. – silly goose Sep 17 '20 at 02:48

0 Answers0