Hi all
My brother bought an HTC G2 (Desire) and he want's to Root it himself, and I want to do a nandroid backup of the original system.
Is it possible to do a Nand backup (or something that will give me a system.img) without Rooting my phone ?
Anyone ?
Anyone ?
As far as I'm aware the only way to make a backup is with the mkyaffsimage tool which needs root to read (I think) so, as far as I'm aware, no you can't do it without root.
thanks for u'r reply
Actually I just thought of something and I'd like to correct myself. If you have linux or cygwin installed you could technically mount the system in adb shell then run mkyaffs2image on it and that would give you a backup of the stock /system folder. To simplify things the command to mount the system (temporarily) as read-write in an adb shell is
Code:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
, kinda thinking as I type so you might still need root for that command to work properly, adb shell needs root to mount i think,not sure. You could try it and if it doesn't work you need root,if it works then you don't to make a backup. Either way post back and let us know what happens ok?
Hmmm...some useful info for me
currently I am trying to root my Spice CSL MI410 manually (where I am stuck in midway...:-(...)
So I have t wait till I succeed in that and then only I
thanks alot
gopitry to do a nandroid backup
---------- Post added at 06:00 AM ---------- Previous post was at 05:59 AM ----------
Hmmm...some useful info for me
currently I am trying to root my Spice CSL MI410 manually (where I am stuck in midway...:-(...)
So I have t wait till I succeed in that and then only I try to do a nandroid backup
thanks alot
gopi
.
Thread moved to Q&A due to it being a question. Would advise you to read forum rules and post in correct section.
Failure to comply with forum rules will result in an infraction and/or ban depending on severity of rule break.
i guess you have to be root , if you want to change the recovery and then make a backup...
Related
I have followed both parts of Toast's root guide. I have then flashed 1.0.8 of JoeyKrim's rooted stock build ROM - odex version if that really matters, though I doubt it.
I find that using ConnectBot on the device, I can indeed type SU and get the hash prompt. So far so good, but even after killing all apps, I cannot manage to delete the Sprint*.apk files. I get a read-only filesystem error.
I'm assuming this is possible through booting into my custom recovery, but I thought one of the benefits to the NAND unlock was ability to do this "live" within Android.
Am I missing something, or is /system/app just a special case of read-only settings when running normally?
First, please post in the proper section. This is development not q&a. Second, you need to remount. It defaults to read only, but can be changed. Enter the following command sequence:
su
mount -o rw,remount /dev/block/mtdblock4 /system
rm /system/app/Sprint*
Beware, that gets rid of visual voicemail too. I use Google voice personally, but it should be known.
axlebot said:
First, please post in the proper section. This is development not q&a. Second, you need to remount. It defaults to read only, but can be changed. Enter the following command sequence:
su
mount -o re,remount /dev/block/mtdblock4 /system
rm /system/app/Sprint*
Beware, that gets rid of visual voicemail too. I use Google voice personally, but it should be known.
Click to expand...
Click to collapse
Well, I figured this was more specific than Q&A since it was directly related to root and custom ROM, and I've seen those questions asked here in numerous threads...
As to your point, I did try that, but kept getting the same error. Have confirmed ability to write to /system outside of /system/app, which seems odd.
Sorry the evo auto corrected where it shouldn't have. I fixed it. it shoukd have been rw instead of re.
axlebot said:
Sorry the evo auto corrected where it shouldn't have. I fixed it. it shoukd have been rw instead of re.
Click to expand...
Click to collapse
Not a problem - caught the issue when I read your post. But I saw an issue where even that command was not giving me R/W access. Strangely, pulling the battery and rebooting seemed to help. Odd.
Thanks for the assist. I had kept thinking with full unlock you would not have to run that command each time.
Clarification: I did not think about this myself!
I just found it in a post in Modaco explaining how to Unroot a Droid X and it worked for my Galaxy S as well, so I thought it should be worth posting, as I wanted to unroot my Galaxy S and failed to find a good method.
So First, I'm not responsible for any damage caused to your phone.
Anything you are doing is solely your responsibility.
Second, ALL credit goes to the user itsluy from Modaco who wrote this.
This is the link, by the way:
http://androidforums.com/motorola-droid/39303-factory-reset-updates-apps-root.html#post294672
These are the instructions:
While you still have root go to terminal emulator and run the following:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/app
rm Superuser.apk
mount -o ro,remount -t yaffs2 /dev/block/mtdblock3 /system
sync
reboot
*****end of instructions****
I would like to emphasize that you HAVE to type EXACTLY what it says.
Before every new row you obviously need to press enter.
If you're doing it right, you shouldn't be seeing any messages of any kind during the process.
A good way of making sure it works is after you have removed Superuser.apk, type the command ls and then make sure it doesn't appear in the list.
Then, of course, continue as usual.
I repeat, you have to type exactly what it says, if not it will not work.
For example, there's a space between modblock3 and /system .
Another example is that you have to write Superuser.apk with a capital s.
Once again, it is all thanks to itsluy from modaco and I'm not responsible for any of the damages this process may cause.
I would be happy to hear comments (hopefully good ones)
Itay
Sounds good mate, but you do know you can just use One click unroot application instead?
still this may come in handy for others!
itaykoren said:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
Haha, what? You can probably leave off the 'mount' lines... /system on SGS is already rw.
Yes, Mambo04, I know that you can use the one click root/unroot, but this method is very useful for those who already have root access.
In addition, the comments regarding that unroot process are a mixed bag.
For me, it's much more comfortable to do it this way as I don't need to download any files as opposed to the one click root/unroot process (besides Terminal Emulator that most people already have) and also don't need to connect it to a computer (as opposed to the second root/unroot method).
Eventually, I think writing several lines of dictated code is much easier and takes less time to do, so I personally think it's a very good method.
What do you guys think?
RyanZA ,
thanks for your response.
Actually I did try without the 'mount' lines and it didn't work.
At least for me on stock jf3.
Perhaps on other firmwares it's different...
itaykoren said:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Itay
Click to expand...
Click to collapse
SGS actually does not use yaffs2.... So Impretty sure this fix isnt "proper"
I guess you're right.
Then again, I no longer have root access, so "if it ain't broken, don't fix it..."
Worked for me also.
I'm glad to hear...
If anyone else uses this, please feel free to comment so that we know of any problems with it, as so far I have not found any, and I think it's the one of the easiest ways to safely unroot
THANKS! you saved me a Butt-Ton of headache. I work for bell, and i kind of rooted/lagfixed a store unit prior to activating it, the customer who got it would have been ecstatic. but the warranty is an issue. Is it possible to do the lagfix and then remove superuser permission so the phone is totally fixed and still warrantyable?
I don't know for sure if it's possible so I don't want to make any statements...
I guess it also depends on what this provider defines as a violation of the warranty.
There's been rumors that Vodafone UK, for example, does not consider rooting a Galaxy S as a violation of the warranty terms. But again, this has not been confirmed, and I guess most providers do consider it as a violation.
Also, hopefully the lag issue will be fixed in future official updates, so if warranty is a big issue, it mind be better to wait, or apply the lagfix and remove it before taking it to be repaired (if the state of the device allows it...)
Hi, thanks for posting this unroot method, just a couple of questions;
1. If I run this, then do a factory reset will the phone remain unrooted? or will it revert back to rooted as I applied root using update.zip.
2. Is it safe to delete the update.zip from my internal sd after applying this?
Thanks.
hi skink666,
1. After you run this successfully, you are unrooted, so if you do a factory reset, you will remain unrooted (you can easily verify this by checking your apps and making sure the "Superuser Permissions" app is not there).
2. The update.zip file that you use in order to root your device can be deleted once you have successfully gained root access. So, you can even delete it before applying this unroot method, not to mention afterwards.
You might want to keep a copy of it on your computer in case you want to root again.
Thanks for the info, will give it a try
Is this method working on froyo xxjpy with voodoo kernel?
I haven't tried, but you're more than welcome...
I’ve compiled a quick guide to instruct how to make a copy of the /efs folder. I’ve found in many threads suggestions about backing up this folder but the methods itself are very general. Most of the times they suggest to “root and copy the folder” with Root Explorer or similar, but usually it’s not that easy or it just doesn't work for everyone (my case).
This guide ASUMES you have read this Excellent Guide by Darkstrikerfirst:
H E R E <-- Make sure to read the ADB Guide.
I recommend doing this with a Mobile just taken out of the box or with any Official ROM of its Service Provider. If you have already Flashed your phone with another ROM but its working fine, then you can use that /efs also.
Why the /efs folder?
This is a very sensitive system folder that contains Phone-specific information such as the IMEI (encrypted in the nv_data.bin), wireless devices MAC addresses, product code (also in the nv_data.bin), and much more. Often users trying to change product codes or trying to unlock the mobile will end up corrupting data in this location.
Why back it up?
Well, let’s resume it saying that backing-up this little folder will keep you away from Samsung service centers.
***WARNING: I take no responsibility to any damage caused by the methods cited and/or written here. Their sole purpose is to back-up data and not to alter in any way the integrity of the original files of the mobile***
Please don’t ask how to recover your IMEI if you have previously messed your SGS without backing up this folder. I’m not familiar with such methods plus it is UNRELATED to this thread.
What you will need:
Rooted SGS to get permissions as a SU (Super User) and perform the backup
I would suggest learning a little about the terminal commands used (in case you are not familiar with them), as it’s better to know what you are doing rather than typing strings like a little chimp without knowing what they are; if you are a little lazy, then you have a good chance bricking your mobile.<- Busybox Commands(or Google them)
Terminal Emulator by Jack Palevich (available from the market) <-Terminal Emulator or use ADB which is included in the SDK Development Tools
IMPORTANT: If getting "error: device not found" under ADB (happened to me under CM7 2.3.4), you need to update your ADB drivers. Go HERE and follow the instructions to download the USB Driver for Windows, Revision 4 (Nexus S Support). Then update the drivers under your Windows Device Manager.
--------------------------------------
Backup commands
--------------------------------------
Depending on the type of root, you might have to use “busybox” at the beginning of the sting or just the string:
The standard prompt of terminal (adb) is a $ sign. Once you enter “SU” it will become a # Sign.
***NOTE: Make sure to keep an eye on the screen of your SGS during this process, because it will request SU permissions; else, you will get an error (just if it’s the first time). In Terminal Emulator you will need to reset the app after granting permissions cause it usually freezes***
*Remember: to use ADB you need to enable USB DEBUGGING under Applications/Development in your SGS. Once you are finished with the files, you need to turn it off so you can get the files.
Code:
su
tar zcvf /sdcard/efs-backup.tar.gz /efs or
busybox tar zcvf /sdcard/efs-backup.tar.gz /efs
After this, you will end up with the file efs-backup.tar.gz in your INTERNAL SDCARD, which is a “tarball” or a ZIP of the /efs folder. That file is your backup. You can expand it with Winrar.
In another forum I also saw a recommendation to back up the st13 under /dev/block which can support greatly to recoveryour IMEI in case of a screw-up:
Code:
su
cat /dev/block/stl3 > /sdcard/efs_dev-block-stl3.img or
busybox cat /dev/block/stl3 > /sdcard/efs_dev-block-stl3.img
Same thing, the target is the INTERNAL SDCARD, so go ahead and copy the file.
----------------------------
nv_data.bin - Restore
----------------------------
In case you screwed your IMEI by playing with the nv_data.bin and you are experiencing issues like:
Fake IMEI (usually 004999010640000)
Unable to download apps from the market
Unable to unlock your SIM card using your PIN
Weird apps are downloading automatically from the market
Blinking SIM card icon on the top tray… ETC
You may want to upload your fresh copy of this file back to the phone. Use this commands:
(thanks to Methyldioxide method to recover the product code http://forum.xda-developers.com/showthread.php?t=780509 )
Copy the file from your backup (efs-backup.tar.gz) and paste it in the INTERNAL SDCARD:
Code:
cp /sdcard/nv_data.bin /efs/nv_data.bin
rm -rf /efs/nv_data.bin.md5 OR
busybox rm -rf /efs/nv_data.bin.md5
Reboot your SGS
The md5 hash/signature is removed (rm) as the system will generate a new one.
**Most likely your SIM code won’t work after this and you won’t be able to log into the phone**
Pop off your SIM card, boot your SGS and execute the following commands to change ownership of the file under ADB or Terminal as well:
Code:
su
busybox chown 1001:1001 /efs/nv_data.bin or
chown 1001:1001 /efs/nv_data.bin
Hope this can help anyone with doubts. Cheers!
An alternative to the backup part is to use Root Explorer and zip the whole /efs folder onto your external sd card. (or wherever you want)
How about a method to restore the IMEI if you never had a good back up to begin with ?
Candanga said:
Please don’t ask how to recover your IMEI if you have previously messed your SGS without backing up this folder. I’m not familiar with such methods plus it is UNRELATED to this thread.
Click to expand...
Click to collapse
EarlZ said:
How about a method to restore the IMEI if you never had a good back up to begin with ?
Click to expand...
Click to collapse
How did you manage to miss that?
EarlZ said:
How about a method to restore the IMEI if you never had a good back up to begin with ?
Click to expand...
Click to collapse
had the feeling you would be here LMAO..
funny thing
the other day i messed up nv_data.bak trying to get my old product code back
the phone would not recognise the sim card
i deleted the whole /efs folder and the phone made a new one
i got my imei but no product code
sim card started working everything looked ok appart from sgs tools reporting nothing as phone !?!
i did restore /efs from a backup i had and then my product code came back
weird though
I was on jpo when all this happened
pele78 said:
had the feeling you would be here LMAO..
Click to expand...
Click to collapse
I guess you find it entertaining if people messed up their IMEI, well we all have our kinkiness.
EarlZ said:
I guess you find it entertaining if people messed up their IMEI, well we all have our kinkiness.
Click to expand...
Click to collapse
@EarlZ - I myself was a victim of this, but I managed to make a duplicate of my nv_data.bin as per instructions of the guide that I was following to unlock my SGS.
The only "tip" that I can give you (geez.. Im going against my own disclaimer lol ) is to try to flash it back to JM1 or the earliest release of your mobile. I think I remember to get my IMEI back doing this, but then lost it flashing to a newer ROM. AGAIN, my "research" didn't go past this as I managed to get my IMEI back, reason why I got inspired to throw this little guide.
Hope this can get you started on your IMEI recovery journey.
Cheers mate.
The restore should also be done with tar - in this way you won't lose the permissions on the files.
ingineru said:
The restore should also be done with tar - in this way you won't lose the permissions on the files.
Click to expand...
Click to collapse
Just for future reference (in case I need it ) can you give us the full command line?
Thanks
Thanks for the HowTo.
I ended up deleting my nv_data files in order to restore the backup files to get back the orig product code. As far as I can tell, it worked perfectly.
Code:
busybox rm -rf /efs/nv_data.bin
busybox rm -rf /efs/nv_data.bin.md5
In case you really boink your EFS
I wanted to add a small piece to this thread that not really consolidated anywhere I can fine. I toasted my /EFS yesterday - to the point of no cellular unless I was at JF6. I couldn't use tar because I'd get "out of room" errors and "numerical value out of range". I mean I SERIOUSLY borked the /EFS. But then I've been flashing this phone from the day it was available from AT&T.
I used ODIN to restore my /EFS. I have a permanent generic IMEI.
There are several good threads on backup of the /EFS, but not on restoring. If you follow the OP post to backup, here's a good discussion on how to restore.
http://forum.xda-developers.com/showthread.php?t=882039
What wasn't clear in Da_G's thread is the you don't have to use DD to use ODIN to restore. There's no discussion on using the .img file to restore. That's scattered across a couple of threads and lots of reading. I'm not a linux guy, so I had to figure this out. . . .
Deep in rotohammer's following thread, there is a discussion about using a cat .img file to do create an ODIN .rfs file that allows you to restore from ODIN.
http://forum.xda-developers.com/showthread.php?t=850359
So here's what I did to restore my /EFS to functional. You MUST have a backup of your functional /EFS using either dd or cat and ADB installed.
On your PC do the following:
c:\Android\tools> adb shell
$ su (you're now on your phones Android command line; watch your home screen on the phone in case Superuser comes up asking for permission)
#
Now we're going to take the efs_folder_backup_stl3.img that you did with the cat file and make it usable by ODIN. Change directory locations to your cat .img location. Mine is on /sdcard/external_sd/.
#cd /sdcard/external_sd/
#busybox cat efs_folder_backup_stl3.img > /sdcard/efs.rfs (this is the key step!!)
# cd /sdcard
# tar -cf efs.tar efs.rfs
# exit
$ exit
Now your back at your PC. Do the following step to get the .tar file off your phone.
c:\Android\tools> adb pull /sdcard/efs.tar
Almost done. Move the efs.tar file to the same direction as ODIN and the follow the last directions in Da_G's thread. I'll post them below for just for clarity.
"Now, get into download mode, open odin, stick efs.tar in PDA slot, and press start. Bam! EFS fixed"
This worked for me, several times. Once you have the /EFS directory in ODIN flashable tar format - you really have to work hard to brick your phone.
Hope this helps!
If I flash back to stock using ODIN, would that also put things back to right ?
@bsc7080xsc
It should. You might have to do a factory reset if the device shows as locked, but otherwise it's worked for me many times.
Hi
backedup my efs folder through this thread in combination with roto.
cellgeek in your post you say : " busybox cat efs_folder_backup_stl3.img > /sdcard/efs.rfs (this is the key step!!)"
But i never made an .img file/folder.
both the dd and cat created an rfs file which i turned to tar.
am i missing a step?
thank you for your little extra guide.
that's a very useful Candanga
several times saved my ass
thanks !
Thank you VERY much OP, that worked for me
Sorry to revive if this is old;
Why won't rm -rf /efs/nv_data.bin.md5 work in terminal? It gives me an error along the lines of this is a read-only file etc?
geesamsungs said:
Sorry to revive if this is old;
Why won't rm -rf /efs/nv_data.bin.md5 work in terminal? It gives me an error along the lines of this is a read-only file etc?
Click to expand...
Click to collapse
Try "busybox rm -rf /efs/nv_data.bin.md5"
Thanks that was very useful but I have a problem here.
When I copy my nv_data.bin file to efs directory I can only change the ownership but not the group!
I tried both of this:
su
busybox chown 1001:1001 /efs/nv_data.bin or
chown 1001:1001 /efs/nv_data.bin
Click to expand...
Click to collapse
and
su
busybox chown radio:radio /efs/nv_data.bin or
chown radio:radio /efs/nv_data.bin
Click to expand...
Click to collapse
need help with some shell coding
somebody pls help me why this code is not working in recovery
(1)
aim- to rename m8,s boot sound from mp3 to mp3.bak
sed -i 's/HTC_Sense5_Boot.mp3/HTC_Sense5_Boot.mp3.bak/g' /system/customize/resource;
or
mv HTC_Sense5_Boot.mp3 HTC_Sense5_Boot.mp3.bak /system/customize/resource;
file is located in /system/customize/resource in htc m8
(2)
aim-add a new line media _rw to get sd card write access
sed -e '/WRITE_EXTERNAL_STORAGE" >$/N;s/\n\(\([ \t]*\)<group gid="sdcard_rw".*$\)/\n\2<group gid="media_rw" \/>\n\1/' -i /system/etc/permissions/platform.xml
file is located in /system/etc/permissions/platform.xml in htc m8
(3)
and this also not working
aim-rename a string in build prop
sed -i 's/ro.product.device=htc_m8/ro.product.device=htc_One/g' /system/build.prop;
sed -i 's/ro.build.product=htc_m8/ro.build.product=htc_One/g' /system/build.prop;
file is located in /system/build.prop in htc m8
(4)
is there any editor to find coding mistakes in .sh programs which we run in update zip
(5)
how to rename a system file call ime.apk to ime.apk.bak by a shell and by edify want to know both ways
file is located in /system/app/ime/ime.apk in htc m8
device-htc one m8 international
os-lollipop
skin-sense 6
kernel and rom-stock dev edition 4.16.1540.8
bootloader-unlocked
security status-S-off
recovery i use-twrp 2.8.7.0.
i already post it in question answer thread but no luck:crying:
to be honest, i havent looked at your script code, but if you're changing things in the /system partition you'll need to mount the partition first, twrp usually doesnt mount system by default,
and also be careful about the 2.8.7 series, even if mounting, it may only mount is as read only (if it's a stock system partition)
nkk71 said:
to be honest, i havent looked at your script code, but if you're changing things in the /system partition you'll need to mount the partition first, twrp usually doesnt mount system by default,
and also be careful about the 2.8.7 series, even if mounting, it may only mount is as read only (if it's a stock system partition)
Click to expand...
Click to collapse
thank you for reply
i somehow managed to make them work accept media rw code
shikhar.bagde said:
thank you for reply
i somehow managed to make them work accept media rw code
Click to expand...
Click to collapse
easiest way, is to test it in an "adb shell"
but briefly looking at the various things, your point (3) about device/product isnt the best idea imho.... someone using "automated apps", such as flashify or whatever, may end up with a brick there
nkk71 said:
easiest way, is to test it in an "adb shell"
but briefly looking at the various things, your point (3) about device/product isnt the best idea imho.... someone using "automated apps", such as flashify or whatever, may end up with a brick there
Click to expand...
Click to collapse
because those apps will think its a htc one not htc one m8 with diffrent partition table oh my god never thought about that
thanks you save me
shikhar.bagde said:
because those apps will think its a htc one not htc one m8 with diffrent partition table oh my god never thought about that
thanks you save me
Click to expand...
Click to collapse
sure no problem,
depending on the app and how it reads the information, it may even get the partition correct, but would likely still mess up... for example, I tested an app quite a while ago (can't remember which), I changed the build.prop to look like an M8 on my M7, it got the M7 recovery partition correct, but downloaded the M8 recovery ... oops
Many guides recommend to backup the EFS partition before installing any ROMs "just in case".
Unfortunately, I cannot find any up-to-date manual on how to do so the proper way in case of the Fold 3.
Guides I do find either suggest to copy some images from a specific /dev/block with dd, which seems to be e outdated as non-existant on the Fold 3 or are incomplete by recommending to only copy the content of the folder /efs with a root explorer or mention EFS Professional which at least for me fails with some obscure array/dimension/whatnow error message just when attemping to even only get the partitions.
In the Dr. Ketan - thread, the developer suggested to use TWRP but here, is also unclear whether being suitable now or not, also in terms of half the stuff being encrypted nowadays. Uargh.
So how do all of you back this up if it is common sense that it is oh so important?
If you are rooted, the dd method can be done quite simple either on a terminal emulator or with adb shell.
If using terminal:
su
then
dd if=/dev/block/by-name/efs of=/sdcard/efs_backup.img
If using adb shell:
adb shell
then
su
then
dd if=/dev/block/by-name/efs of=/sdcard/efs_backup.img
Or you can just back it up with TWRP, it should give you the option to do it.
Thanks a lot. I used dd in Termux in the root context and the resulting file size is 20 MB. Hope it is what I need as that EFS backup thing somehow has something of "hopefully, one never needs it".
By the way, the attempt to use TWRP for that fails as it only recognizes the internal storage which is shown as 0MB, probably due to the encryption.