[How-To] Unroot your phone and return to stock

Status
Not open for further replies.
So I have to do this from recovery because a fried bricked it. I'm stuck in recovery and following all these steps. I got to the part where I have to type 'su'. It says this.

/ # su
su
/sbin/sh: not found

As I said I'm stuck and the android recovery screen. I do have the # and not the $, so that means I'm rooted right? I'm not sure why I can't 'su' if I'm rooted. I also tried to just skip it put in "chmod 755 /data/local/tmp/flash_image", but it doesn't find that either. Help please so I can finish fixing my phone!
 
Last edited:
So I have to do this from recovery because a fried bricked it. I'm stuck in recovery and following all these steps. I got to the part where I have to type 'su'. It says this.

/ # su
su
/sbin/sh: not found

As I said I'm stuck and the android recovery screen. I do have the # and not the $, so that means I'm rooted right? I'm not sure why I can't 'su' if I'm rooted. I also tried to just skip it put in "chmod 755 /data/local/tmp/flash_image", but it doesn't find that either. Help please so I can finish fixing my phone!

You are correct # means that you are rooted.
More precisely it means that you are already at a root prompt.
su is essentially gksu or sudo on most linux machines it produces a different prompt separate from the standard shell.
In other words, if you are looking at #, su wouldn't work because you are already in the super user prompt.

Not having attempted a restore of this type I can't answer the second question regarding the chmod 755...
But I'd definitely like to wish you luck.
 
Last edited:
You are correct # means that you are rooted.
More precisely it means that you are already at a root prompt.
su is essentially gksu or sudo on most linux machines it produces a different prompt separate from the standard shell.
In other words, if you are looking at #, su wouldn't work because you are already in the super user prompt.

Not having attempted a restore of this type I can't answer the second question regarding the chmod 755...
But I'd definitely like to wish you luck.

Thanks. but it still doesn't doesn't get me any further with this. My phone is stuck on the recovery screen, and I'm trying to go along with the unroot, but I get stuck after the 'su'. Need to find out what to do.
 
Obviously you have a root shell, as evidenced by the presense of a # symbol. Regarding your chmod issue, have you tried /system/bin/chmod?

Edit: when you said that "it doesn't find it" did you mean it didn't find chmod or it didn't find flash_image?
 
/ # su
su
/sbin/sh: not found

As I said I'm stuck and the android recovery screen. I do have the # and not the $, so that means I'm rooted right? I'm not sure why I can't 'su' if I'm rooted. I also tried to just skip it put in "chmod 755 /data/local/tmp/flash_image", but it doesn't find that either. Help please so I can finish fixing my phone!
The reason you can't run "su" is because the executable file doesn't exist in the recovery boot image.

The reason your chmod is failing is there is no /data/local/tmp in the recovery boot, as /data isn't mounted. You don't really need that whole section as you already have root.

Try typing
mount /sdcard

Then do
ls -l /sdcard

Make sure the recovery-RA-GNM-thunderc-s-1.1.0.img file is there (if not, redo step 6 from a different command prompt), then type (in your adb shell session)
/sbin/flash_image recovery /sdcard/recovery-RA-GNM-thunderc-s-1.1.0.img

If that is successful, continue with step (12)
 
Last edited:
The reason you can't run "su" is because the executable file doesn't exist in the recovery boot image.

The reason your chmod is failing is there is no /data/local/tmp in the recovery boot, as /data isn't mounted. You don't really need that whole section as you already have root.

Try typing


Then do


Make sure the recovery-RA-GNM-thunderc-s-1.1.0.img file is there (if not, redo step 6 from a different command prompt), then type (in your adb shell session)


If that is successful, continue with step (12)

Ok I did all that, and it worked. I got into my sdcard after it was mounted, and I saw the recovery-RA-GNM-thunderc-s-1.1.0.img in the list of files. but when I type in
/sbin/flash_image recovery recovery-RA-GNM-thunderc-s-1.1.0.img
this is what I get back...
error opening recovery-RA-GNM-thunderc-s-1.1.0.img: No such file or directory

I pushed the flash_image and recovery to my sdcard as shown in the steps, and I see it in the list of stuff on my sdcard, but it can not open it. What do I do now? So frustrating! :p

Edit: I also tried to mount my data, as someone pointed out before, that chmod wasn't working because my data wasn't mounted. So I mounted my data, and entered
chmod 755 /data/local/tmp/flash_image
but got back the same "no such file or directory". So that didn't work.
 
Ok I did all that, and it worked. I got into my sdcard after it was mounted, and I saw the recovery-RA-GNM-thunderc-s-1.1.0.img in the list of files. but when I type in
this is what I get back...
Sorry, I had a typo in the original post, the flash_image command should have been
/sbin/flash_image recovery /sdcard/recovery-RA-GNM-thunderc-s-1.1.0.img

I inadvertently left out the /sdcard portion (which I have now corrected in the OP)
 
Sorry, I had a typo in the original post, the flash_image command should have been

I inadvertently left out the /sdcard portion (which I have now corrected in the OP)

oh my goodness, I can't thank you enough! It worked! Thank you! I finally have my phone back.... :D
 
Cannot push through ADB

Rooted, wiped via privacy menu = Fail

Trying to fix, Cannot seem to push the recovery image.. apk's work fine, but not the image


I get Cannot stat "imagefilehere" no such file or directory found...

what is going on, how come these will not push

also when i adb shell it goes right to

\ #


Is this right?
 
Rooted, wiped via privacy menu = Fail

Trying to fix, Cannot seem to push the recovery image.. apk's work fine, but not the image


I get Cannot stat "imagefilehere" no such file or directory found...

what is going on, how come these will not push

also when i adb shell it goes right to

\ #


Is this right?
Did u brick ur phone?
 
I'm trying to return my Optimus S to stock in case my mom needs it, problem is a lot of the download links are broken (recovery, flash_image, V9 upgrade). Anyone have these?
 
I'm trying to return my Optimus S to stock in case my mom needs it, problem is a lot of the download links are broken (recovery, flash_image, V9 upgrade). Anyone have these?

i've got them... on another computer that i'm not near at all right now. I'll try to remember to zip them up and post them later this morning, before 8 hour traffic school.
 
Okay didn't figure it out, still having issues trying to get to the command prompt area...this is getting kind of bothersome...
 
Last edited:
Computer won't read phone...

Could it be a problem with my USB cable? I have all the drivers needed from LG.

Thanks.
 
Status
Not open for further replies.