Sunday, December 8, 2013

How to: Copy ROM zip file to the freshly wiped device


Have you ever been in a situation where you mistakenly (or not) wiped the content of the internal storage (including system partition and virtual SD cardon your phone or tablet and unfortunately it doesn't support external storage? Now you can't flash desired custom ROM because you removed it and the device can't be booted due to wiped system partition. Don't worry - it's very easy to fix!

Here are the steps you need to follow to copy the correct rom.zip package to your internal storage:
  1. Download this mini-sdk package and extract it to c:\mini-sdk
  2. Rename the custom ROM package you want to flash to "rom.zip" and copy it to c:\mini-sdk
  3. Connect your device to the PC
  4. Boot your device in recovery mode
  5. Open a command prompt on the PC (cmd.exe), type and confirm each command with ENTER:
  6. cd /d c:\mini-sdk
  7. adb shell
  8. mount /data (error might mean that /data partition is already mounted)
  9. on Android 4.2 and above: mkdir -p /data/media/0
  10. on Android 4.1.2 and below: mkdir -p /data/media
  11. exit
  12. on Android 4.2 and above: adb push rom.zip /data/media/0
  13. on Android 4.1.2 and below: adb push rom.zip /data/media
  14. Wait for a few minutes until the file is copied. It will looks like command shell is not responding, but that means it's still copying. Wait patiently until you'll see blinking cursor again.
  15. Depends on your custom recovery, use the navigation keys to flash the custom rom.zip package in a typical way you used to flash custom ROMs. It should be on your internal storage now. Done!
Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!

34 comments:

  1. You can use this as alternative:

    - Enable Sideload in custom recovery
    - Enter command "adb sideload rom.zip"

    ReplyDelete
    Replies
    1. Yes, but sideload is supported only on Jelly Bean and up. Older Android versions doesn't support sideload.

      Delete
    2. I'm desperate here. I was using Revolution HD 31.6 and I mistakenly tried to install 40.1 and I'm on Sprint. I went back and flashed my back up and got stuck in a boot loop. I erased cache and davlik and that didnt' work. I tried to side load and I get this message. c:\Android\sdk\platform-tools>adb sideload viperrom.zip
      * failed to write data 'protocol fault (no status)' * When Revolution 31.6 wouldn't work I tried Viper. Now I have to work in the morning. I need GPS and I'm screwed.. PLEASE... Any help would be greatly appreciated!!

      Delete
  2. If I Sideload the Android 4.0 with 5.5 sense to my HTC ONE in order to free up my internal storage am I able to flash back my recovery afterwards? It would seem 25G or so is just not available so I don't think it's saved in my recovery is it? Just trying to avoid having to reinstall all of my apps ect. I have apps for reinstalling them but.. then you have to reposition and sign in to everything ect... I will if I must but.. Thoughts?

    ReplyDelete
  3. I've been there. I always use push command to push the file I want from recovery adb

    ReplyDelete
  4. Wow! What a helpful tutorial you did here. Its my real pleasure that your tutorial helps me to know that how to copy ROM zip file to the freshly wiped device and I hope now I will able to do it. Thanks and will come back soon. :)

    ReplyDelete
  5. Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Windows\System32>cd /d c:\mini-sdk

    c:\mini-sdk>adb devices
    List of devices attached


    c:\mini-sdk>
    c:\mini-sdk>
    c:\mini-sdk>
    c:\mini-sdk>adb devices
    List of devices attached
    SH26CW100515 recovery


    c:\mini-sdk>adb shell
    ~ # mount /data
    mount /data
    ~ # mkdir -p /data/media/0
    mkdir -p /data/media/0
    ~ # adb push rom.zip /data/media/0
    adb push rom.zip /data/media/0
    /sbin/sh: adb: not found
    ~ # adb push rom.zip
    adb push rom.zip
    /sbin/sh: adb: not found
    ~ # push rom.zip /data/media/0
    push rom.zip /data/media/0
    /sbin/sh: push: not found
    ~ #


    I am getting the above error when i tried the above mentioned steps

    ReplyDelete
    Replies
    1. You need to exit adb shell before pushing the ROM. Type "exit" in the cmd and then type the push command.

      Delete
    2. sorry i forgot to click exit

      Delete
    3. I am not able to locate the /data/media/0 directory the push process has completed successfully. I am using Philz recovery

      Delete
  6. after "adb shell" I'm getting the next error: " - exec '/system/bin/sh' failed: No such file or directory (2) - "

    How can I fix this?

    Thanks :)

    ReplyDelete
    Replies
    1. Then you are in the adb shell already. Type "exit".

      Delete
    2. I'm not sure if I'm already in the adb shell because the "mount /data" command give me an error "mount is not a command" or something similar.
      Also the command "mkdir -p /data/media" is not working.

      Please see my last post on this forum with more details about my problem.
      I really need some help, I'm noob with android and I really need my phone.

      Thanks,

      Delete
    3. Please see my last post on this forum with more details about my problem:

      http://padfoneclub.com/pl/forum/forum_viewtopic.php?13241.0#post_13266

      Delete
    4. I fix it! The only way to make it work was to install the Ubuntu Emulator and all SDK drivers.

      Delete
  7. After "adb shell" I´m getting "error: device not found". But I connected the device to my computer and have installed all drivers..
    What can I do?

    ReplyDelete
  8. When I put command: '' adb push rom.zip /data/media/0 '' in prompt, it says this: cannot stat 'rom.zip': No such file or directory

    What I should do ? :(

    ReplyDelete
  9. Hi Dear
    Thanks for Android Revolution HD. I have 33.1 on my HTC One X. I wana ask if there is any option to do automatic update? Every time I need to check on google for update. And why there is no sound while turning ON/OFF the HTC One X?

    ReplyDelete
  10. Hi mike1986, I am Vikram, I have a htc one x+, I rooted my phone one day I tried to install a rom. I deleted EVERYTHING from my phone accidentally. So I tried to do what you said but the ADB push stuff. I side loaded a rom to my htc one x+, the rom started to install and it asked me to delete the user partition and I checked yes, after that it started to install up to 30% and went back to recovery. Nothing happened, so I redid it again but this time I didn't check delete user partition, then it started to install but this time it went up 30% and was stuck there for like an hour. I dont't know to do mike, I want my phone back. Can you help me. My email is vikramnagendran@gmail.com please I really need your help.

    ReplyDelete
  11. Jadwal Resmi Adu Ayam SV388 9 Maret 2019 di Situs Judi Sabung Ayam Online Melalui Agen Resmi Taruhan Sabung Ayam Live Asli Thailand.

    Situs Judi Sabung Ayam Online SV388 Merupakan Situs Judi Asal Thailand Yang Sangat Terkenal Dengan Permainan Sabung Ayam Yang Fair dan Menghibur Para Penonton Judi Sabung Ayam.

    Untuk Info Lebih Lanjut Bisa Hub kami Di :
    wechat : bolavita
    line : cs_bolavita
    whatsapp : +628122222995
    BBM: BOLAVITA

    ReplyDelete
  12. このブログは素晴らしいです。このブログは非常に興味深く、機知に富んでいると思います。あなたのリソースはとても興味深く、私にとって有益であり、この記事ではすべてを詳細に説明しました。

    Daftar Sbobet88
    Agen Bola Terpercaya Deposit 25Rb
    Daftar Sbobet338
    Daftar Sbobet365
    Agen Sbobet88 Terpercaya
    Link Login Sbobet88 Terbaru
    Login Sbobet88 Versi WAP
    Login Sbobet88 Versi Mobile
    Sbobet88 Deposit Pulsa
    Sbobet88 Deposit OVO

    ReplyDelete
  13. I am also interested in android devlopment. I do my coding with Android AIDE app. I have spent lots of time over android app devlopment. I have gain basic knowledge + little bit advance also.
    **Visit my blog**
    To Ashu4Tech.com (A4T) .

    ReplyDelete
  14. I really enjoy your web’s topic.

    ReplyDelete
  15. Great job for publishing such a beneficial web site

    ReplyDelete
  16. I think it will improve the value of my website.

    ReplyDelete
  17. Greetings! Very helpful advice in this particular post!

    ReplyDelete
  18. I finally found what I was looking for! I'm so happy.

    ReplyDelete