[HOWTO] Flashing recovery image via shell / via LGMDP.exe on unrooted phone

Search This thread
D

doktornotor

Guest
This HOWTO is only useful for people who have NOT yet installed a stock recovery or who have lost the custom recovery after KDZ or LGMDP flash.

Why I posted it? Since I have had enough of complaints about screwed phones via ROM Manager, also there is some broken rf.sh script I have heard of.

Step 1:
- Download (see attachment) the flash_image.zip
- unzip it
- and put the flash_image binary on the root of your SD card (via USB cable).

Step 2:
- Dowload a recovery of your choice (CWM or AmonRA) from this thread.
- Unzip it on your local box and find the recovery.img file.
- Put the recovery.img to the root of your SD Card (via USB cable)

Step 3a - via terminal emulator

- Run terminal emulator on your phone (download one from market if you do not have it yet, duh!)
- type these command exactly: $ denotes a normal user, # denotes root. This character should NOT be typed into terminal emulator!

Code:
$ su
# mount -o remount rw /system
# cat /sdcard/flash_image > /system/xbin/flash_image
# chmod 755 /system/xbin/flash_image
# flash_image recovery /sdcard/recovery.img
# mount -o remount ro /system
# reboot recovery

or

Step 3b:
- Install Android SDK (EXE installer recommended for Windows users.)
- run command prompt (cmd.exe) on your Windows box, or run the following from shell on your Linux box:
Code:
> adb shell
$ su
# mount -o remount rw /system
# cat /sdcard/flash_image > /system/xbin/flash_image
# chmod 755 /system/xbin/flash_image
# flash_image recovery /sdcard/recovery.img
# mount -o remount ro /system
# exit
$ exit
> adb reboot recovery

Step 4:

Now you should find yourself in your shiny new custom recovery. Do whatever you need there. :p

Q: Is not there an easier way? This seems like a lot of typing? It sucks - I have heard about ROM Manager!
A: ROM Manager's way of flashing recovery is broken by design. Do NOT use it unless you are comfortable with rescuing your phone via ADB/fastboot like many people before.

Q: I already have custom recovery. Do I need to do this if I want to switch from CWM to AmonRA or vice versa?
A: No. This thread has recovery ZIPs when can be flashed from recovery itself.

Q: HELP!!! I screwed and now my phone is stuck in fastboot mode! What should I do?!?!
A: You are officially lame, very lame person. :p Now go here to fix it.

Q: But my phone is not rooted (no su binary) - the above does not work! I tried to root it via z4root, GingerBreak, SuperOneClick but everything failed! What should I do? Am I stuck with stock ROM?
A: No! See the LGMDP method below.
 

Attachments

  • flash_image.zip
    4.9 KB · Views: 5,303
Last edited:

22VIN

Senior Member
Feb 2, 2010
320
65
Bucharest
Nice guide :)
This way newbies won't be confused where to search.

BTW, a little mistake: in the adb codes it's flash_image recovery /sdcard/recovery.img
 
D

doktornotor

Guest
Alternative method: Flashing custom recovery via LGMDP.exe

Tried to root it via z4root, GingerBreak, SuperOneClick but everything failed? No problem! Flash the recovery via LGMDP.

Step 1:

Download P500-CWM-3.1.0.0.zip (CWM 3.1.0.0 included, if you want something else, replace recovery.img with whatever you want) and unzip it.

Step 2:

- Browse to the folder where you unpacked the ZIP and run LGMDP-v1.5.exe
- Click Download in menu
- Select Port
- Choose your phone, click Connect
- Click Image Folder button, browse to the directory where you unpacked this
- Click OK about 3 times on the warnings
- Close the window
- Click Download button
- Let it do the job. It will backup your IMEI and MACs to .NV2 file, reboot your phone, flash recovery and restore the NV2 backup. Do NOT interrupt it or disconnect your phone until it says "Download complete"! Do NOT delete the NV2 backup!

Step 3:

Done! Now when you press Home + Volume Down + Power, you should find yourself in your shiny new custom recovery. Now you can flash a rooted ROM via flash zip menu.

Q: I am a moron and have interrupted the process. Now I get a black screen with some weird fastboot text, what to do? HELP!!!!
A: Yes, you are a moron. See [HOWTO] Revive a bricked P500 on fastboot mode (the SHORT way) thread.

Q: Can I just quickly root my stock ROM after flashing recovery? I do not want a custom ROM.
A: Yes. Download su-2.3.6.3-efgh-signed.zip and flash it from recovery. Reboot, download Busybox Installer from the market, run and install busybox on your phone.
 
Last edited:

pindey02

Member
Jan 16, 2011
34
6
Manila
"Q: Can I just quickly root my stock ROM after flashing recovery? I do not want a custom ROM.
A: Yes. Download su-2.3.6.3-efgh-signed.zip and flash it from recovery. Reboot, download Busybox Installer from the market, run and install busybox on your phone."

In reference to the above words, cud i use this as a method to root my stock GB 2.3.3??? cos nothing else seems to root it and installing sdk and adb and all tat, seems too complex!
 

IamIrene

Senior Member
Mar 15, 2011
2,314
818
nice guide TS
but this guide also can use for thunderg recovery right ???
and i not quite understanding ur step 3a
which is this :

type these command exactly: $ denotes a normal user, # denotes root. This character should NOT be typed into terminal emulator!

but in my mind just type EXACTLY what the below quote write

$ su
# mount -o remount rw /system
# cat /sdcard/flash_image > /system/xbin/flash_image
# chmod 755 /system/xbin/flash_image
# flash_image recovery /sdcard/recovery.img
# mount -o remount ro /system
# reboot recovery

but you say the things in 1st post make me confuse
so just follow and type the word exactly ???
 
D

doktornotor

Guest
No comment, everything I wanted to say has been censored :rolleyes:
 

evripidis

Senior Member
Dec 16, 2010
147
10
Athens
When I type
flash_image recovery /sdcard/recovery.img
I take the error message
mtd: not writing bad block at 0x00440000
error writing recovery : No space left on device

But I have at least 60MB on my phone's memory...

edit:
OK,that error bricked my phone again...
 
Last edited:

evripidis

Senior Member
Dec 16, 2010
147
10
Athens
Has nothing to do with the space for /recovery on a separate partition.

KDZ is always saving me always! :p

How can I fix that about /recovery?
Because I don't understand, I don't have a partition for recovery?
If is that, why after KDZ update, original recovery works properly?

I am worried about bad block that error message said...
 
D

doktornotor

Guest
I am worried about bad block that error message said...

Yeah, am I worried too, should not report any bad sectors (at least not on this phone).

Code:
> adb shell cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00440000 00020000 "boot"
mtd1: 0be00000 00020000 "system"
mtd2: 00500000 00020000 "recovery"
mtd3: 002c0000 00020000 "lgdrm"
mtd4: 00100000 00020000 "splash"
mtd5: 00180000 00020000 "FOTABIN"
mtd6: 005c0000 00020000 "FOTA"
mtd7: 00040000 00020000 "misc"
mtd8: 04000000 00020000 "cache"
mtd9: 0c780000 00020000 "userdata"
 

evripidis

Senior Member
Dec 16, 2010
147
10
Athens
I get this

Code:
>adb shell cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00440000 00020000 "boot"
mtd1: 0be00000 00020000 "system"
mtd2: 00500000 00020000 "recovery"
mtd3: 002c0000 00020000 "lgdrm"
mtd4: 00100000 00020000 "splash"
mtd5: 00180000 00020000 "FOTABIN"
mtd6: 005c0000 00020000 "FOTA"
mtd7: 00040000 00020000 "misc"
mtd8: 04000000 00020000 "cache"
mtd9: 0c780000 00020000 "userdata"

In google I found this http://android.modaco.com/content-p...kmod-recovery-for-zte-blade-oled-tft/page/20/
He gets the error at the same point.
And this http://androidforums.com/647576-post25.html
 
Jul 10, 2011
5
0
I did everything as I was meant to, but when I get to the point to insert the text, both on pc or on phone I get an error message...What's wrong?
 
Jul 10, 2011
5
0
When I have to write the codes in the terminal emulator or in cmd.exe, I get these messages:
TE: su: permission denied
and the rest doesn't obviously work
CMD: doesn't work at all even if I installed the program you said...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    After I my thank you reply, I realised superuser was gone. No problem with superoneclick. I followed your advise and checked SD5sum of both images with MD5 &SHA Checksum. The downloads were valid suggesting that something else caused my problem. Any advise please?

    ---------- Post added at 05:00 PM ---------- Previous post was at 04:53 PM ----------



    Thank you for replying so promptly. I just managed to get into the emergency mode and connect to my pc and used KDZ (LG) . When restarting I got an android and white triangle with orange exclamation. Used the vol buttons and got a message that the update.zip failed to install. After rebooting (taking out battery) it did start up with all settings and apps still there as before the flashing. Not sure whether the recovery is working or not and hesitant to start in recovery mode. If that mode is corrupted must it be de-installed and if so how?
    Here is a link to a short script that I use in terminal emulator:
    http://www.mediafire.com/?7baf5u85iah4fa0
    Included in the zip are several recoveries (in corresponding folders). Exract the zip, and open the readme.txt for instructions. [emoji4]
    This is only for LG p500.

    sent from my towelrooted LG L34C using tapatalk
    1
    Yo,added this to the N00B repo. ;)
    1
    Method 3: Use Flash Image GUI (needs a rooted phone :p)

    Step 0: Install the application, duh!
    Step 1: Put recovery image somewhere on your SD card via USB cable
    Step 2: Browse and select recovery.img
    Step 3: Press Flash Image button and confirm.
    Step 4: Wait for a while for confirmation.

    Done!
    1
    So my phone has CM7 (Mik_OS)/rooted of course but i want to sim unlock it.What would be the procedure for me to revert to stock ROM, do the sim unlock and revert back to MikOS (without losing the apps i have installed and without bricking the phone). Better yet if I can somehow get the sim unlock menu to show up, i dont even want to go back to custom ROM. Many thanks! If I can get this right, you are my hero :)

    You already have the recovery? Go there.

    - make a nandroid backup
    - wipe all
    - flash some v10 based ROM from ZIP (list)
    - boot, unlock
    - back to recovery
    - wipe all
    - restore the backup

    Anyway, this is a wrong thread to ask.
    1
    I rooted my LG P500 / Android 2.3.3 /kernel 2.6.35.10-pref/ softw LG-P500-V20G using Superoneclick via my PC in order to install oxygen_ics.
    I then installed Astro file manager and a Terminal emulator.
    I checked that I had root access and saved a recovery rom CWM 5.0.2.7 (as advised for this phone) to the root dir of the SD card.

    I typed these instructions (by doktornotor xda-developers thread 1146566) in the terminal emulater

    # mount -o remount rw /system
    # cat /sdcard/flash_image > /system/xbin/flash_image
    # chmod 755 /system/xbin/flash_image
    # flash_image recovery /sdcard/recovery.img
    # mount -o remount ro /system
    # reboot recovery saved

    All commands were executed but I ended up with a smiling LG logo where it gets stuck.
    It doesnt switch off and looks as if it is unable to boot.
    Tried factory reset but only the logo appears and hangs.

    Can you please advise why the recovery boot failed and how to fix it?
    Thanks
    Probably have a corrupted recovery.img. This can happen in several ways, but usually poor transmission over network. First unplug it, and pull out the battery. Reinsert battery, press and hold HOME and POWER buttons. If you see a black screen with very small print in the upper left corner, this is fastboot mode SPL (secondary program loader ). You can use the tool from this thread:
    http://xdaforums.com/showthread.php?t=1827723
    Extract the zip.
    It includes Windows drivers for the p500 (if you don't already have them installed). Download a fresh copy of recovery.img, and if a md5 sum is available, use it to verify the integrity of your download. Now run Android Flash Recovery program as administrator. Browse button is towards the upper right in the program (has dots). Browse to recovery.img, and select it. Now install (or flash). Should reboot into new recovery.

    sent from my towelrooted LG L34C using tapatalk