[SOLVED] [I9195I] `adb nvbackup` corrupts up phone and causes bootloops - Galaxy S 4 Mini Q&A, Help & Troubleshooting

So I have been recently playing around with my S4 Mini Value Edition/Plus (I9195I) trying to port CyanogenMod to it. Then when it was really late I read about the `adb reboot nvbackup` (DO NOT EVER RUN THIS COMMAND ON THE S4 MINI VE), and now the phone is basically stuck in a bootloop. I think the problem is identical with http://forum.xda-developers.com/showthread.php?t=2657519 which points out that Samsung has simply messed up something there and now the FSG and BACKUP partitions are corrupt. According to the thread it is possible to recover if you get clean versions of the FSG and BACKUP partitions so I'm hoping someone with the S4 Mini Value Edition (i9195i) can help me by getting the clean versions from his device. It's not much to do and won't do anything to your device but will help me to continue (and actually have a working device again).
Can someone run these commands (either in a rooted shell (e.g. adb shell -> su -> change in the directory of your internal/external sdcard (not sure about the path), use TWRP way if in doubt), or from TWRP directly (Advanced -> Terminal Command -> then select e.g. your /external_sd or normal /sdcard) -> Select (bottom of the screen)), type the following 2 commands and send me the resulting files (e.g. by attaching it here to a post, or uploading it on AndroidFileHost or Dropbox, ... whatever):
Code:
dd if=/dev/block/mmcblk0p9 of=fsg.img
dd if=/dev/block/mmcblk0p19 of=backup.img
This will place the partition contents of FSG and BACKUP in the current dir (file names fsg.img and backup.img) and you can upload them from your PC e.g. by inserting your external SD card in your PC or simply booting into Android and connecting your phone to the PC. Unlike the names suggest they don't seem to contain a backup but actually files that are necessary for booting which is now corrupted after I run this stupid command... Thanks in advance, I hope someone can help me with getting my phone back working.
PS: I'm pretty sure there is no separate forum for the VE/Plus variant, so I guess this is correct here.

Solved with the help of @kariboo92 (thanks!), if someone ever makes the same mistake as me for this device, just PM me and I can help to fix it.

Related

System Partition Missing

My Galaxy Nexus system partition appears to be missing Is there anyway to recreate it?
Thanks
What makes you think it's missing? What you were doing to your phone when this happened? Got Nandroid backup? More details, please..
When I attempt to mount it CWM states that it is unable to mount and when you run the log it states that the volume does not exist.
I was attempting to install Bugless Beast from Rom Manager download and it looked to me that it was successful and I rebooted and I was stuck at the Google lock screen. I have a android backup but when I attempt to restore it CWM states that it is unable to mount and erase /system which is what leads me to believe its missing.
Have you tried to flash one of factory images? Which version of GN you have? GSM/CDMA?
Yeah I have tried all the images. I have a CDMA model.
Sorry, i'll give up here. Perhaps someone else can help you.
PS. Just a thought. What if you could find .PIT file and and flash factory images from ODIN with "Re-Partition" option ticked?
Just be warned, on SGSII forums i've seen few people crying about bricked phones after doing so.
Boot int CWM, connect the phone to your PC, then open a command prompt and run the following adb commands and post the results here.
Code:
adb shell ls -l /dev/block/mmcblk0*
adb shell dd if=/dev/block/mmcblk0p10 count=5

[GUIDE] Internal Memory Data Recovery - Yes We Can!

This method does not seem to work on newer phones that apply TRIM or some other type of partition clearing implementation. If anyone has recovered their data on a device newer than Android 4.3 please pm me and let me know.
The Preamble
Did you delete all your SDCard data?
Are you pissed because no one told you before you unlocked your bootloader what would happen?
Did you lose valuable pictures of cats doing wondrously funny things? :laugh:
Well now there's a convenient new way for you to get that data back Buckaroo!
The Problem
Internal Memory doesn't mount as a drive like external memory does. External memory would allow you to use data recovery tools that scan for deleted files and return them to a usable state. These tools work because most operating systems don't go through and set all of those 1's and 0's to just 0's when you delete a file. Usually the operating system will just delete the reference pointer in the index that says that a file exists with such-and-such name and it's located at this position on the hard disk / memory location. There are destructive delete tools out there that will overwrite the spot of a deleted file multiple times to discourage recovery in just this manner. The issue is that data recovery tools need an actual mounted drive in order to dig deep and unearth those funny pictures of cats you so tragically deleted by accident. These newest batches of phones don't have external SDcards which are super easy to mount as drives. Internal memory mounts as MTP/PTP which is not treated as a mounted drive and cannot be scanned by these data recovery tools. But, cry no more cream-puff! :crying:
The Process
My phone is the Samsung Galaxy Nexus (toro) though I imagine this should work for ANY phone with Internal Memory. We will be using a Windows 7 machine to:
back up the entire internal memory partition to your computer as a single, massive .RAW file,
convert the .RAW file output to a VHD,
mount the VHD as a disk in Disk Manager,
scan the attached VHD volume for files that have been deleted and recover them,
?
profit! :good:
The Requirements
A rooted Android phone, (try to root with a non-destructive method as this appears to protect those who must root from wiping the device data a second time),
BusyBox installed on your device,
Cygwin installed to [c:\cygwin] with pv and util-linux from the repo. Make sure to open Cygwin once to make sure that the /bin folder is created. Also, I made a folder at [c:\cygwin\nexus] to put the exported .RAW file,
Netcat (download the ZIP file and extract nc.exe to [c:\cygwin\bin]),
ADB (make sure adb.exe is in your path),
USB Debugging enabled on your device,
VHD tool from the mighty M$. Put the VhdTool.exe file in [c:\cygwin\nexus],
Piriform Recuva or your favorite data recovery tool, (it appears Recuva only finds the more common file types like images, videos, etc. Those were the file types in which I was interested. If you are after more exotic file types perhaps you might share the software you used.)
A calm sense of peace and serenity that you will get your files back... :fingers-crossed:
The Work
*****Based on the number of people having trouble with this step it is now my recommendation that you choose to recover your entire memory block instead of just the data partition. In my phone's case that is mmcblk0. Please discover if yours is different.***** Identify which block/partition you want to recover. For our purpose here we are seeking to recover the userdata partition: /dev/block/mmcblk0p12
Turn on your phone
Connect the phone in ADB mode
Unlock the screen.
Open a Cygwin terminal and enter (This assumes your BusyBox installation is at [/system/bin/busybox]. It may be at [/system/xbin/busybox]):
Code:
adb forward tcp:5555 tcp:5555
adb shell
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
Open another Cygwin terminal and enter:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p12.raw
Run around the house a few times. For 32GB internal memory this is going to take 3+ hours. That's a lot of running. When it's done...
We need to convert the .RAW file to a virtual hard drive. VhdTool.exe basically just puts a VHD footer on the end of the .RAW file. Open a Windows command prompt, go to [c:\cygwin\nexus], and type:
Code:
VhdTool.exe /convert mmcblk0p12.raw
Now we need to mount the VHD in Windows. Select the Start button-->right-click Computer-->select Manage.
Select Storage-->Disk Management.
In the menu select Action-->Attach VHD.
For Location enter [c:\cygwin\nexus\mmcblk0p12.raw] and select the OK button.
Right-click on the name (e.g. "Disk 1") to the left of the Unallocated space and select Initialize Disk.
Select the GPT (GUID Partition Table) radio button and select the OK button.
Right-click on the Unallocated space and select New Simple Volume...
In the Wizard select Next>, leave the default for the volume size, select Next>, select a drive letter (e.g. K), select Next>, MAKE SURE to select the 'Do not format this volume' radio button, select Next>, select Finish.
A box will pop up asking you to format the drive. You DO NOT want to format the drive at this time.
Right-click on the RAW space and select Format... MAKE SURE to change the File system to FAT32. Set the Allocation unit size dropdown to 'Default.' MAKE SURE that the Perform a quick format checkbox is CHECKED. You do not want to overwrite the entire new drive with all zeroes (0's) and destroy your data. Quick Format means that it will only attempt to destroy the index for the drive by establishing a new index. Without this box checked the Windows operating system will write zeroes (0's) across the entire volume, potentially destroying your data. Select the OK button.
A box will pop up saying that Formatting this volume will erase all data on it. That would be doubly true if you actually didn't check the 'Perform a quick format' checkbox. Double check that you actually did check the box and select the OK button. (Don't worry. This essentially leaves the volume in the exact same state that your phone's internal memory is living in right now: there is data on the drive...you just can't see it. It's coming back, I promise!)
Open the Piriform Recuva application. In the wizard select the 'Next >' button. Select the 'Other' radio button and select Next >. Select the 'In a specific location' radio button and enter: k:\ (assuming K is the drive letter you chose...) Select the Next > button. Select the Enable Deep Scan checkbox. This is the magical setting that finds files that have been deleted...but not really deleted. Select the Start button.
The application may take about an hour to do the 'Deep Scan.' It's time for more laps around the house! Once the application has returned its results you can choose which files to recover using the checkboxes. Select the 'Recover...' button and choose the location to which you wish to output your files.
?
Profit! :victory:
The Appendix
The following links helped me to create this modern marvel - mad props to scandiun! :
[GUIDE] How to make a nandroid backup directly to your computer without using sdcard
[Info] List of Samsung Galaxy Nexus GT-I9250 devices and partitions
How to Create and Attach a Virtual Hard Disk in Windows 7
Good luck!
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Great Work
scandiun said:
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Click to expand...
Click to collapse
Good and informative tutorial indeed. Thanks though.
Good point...
scandiun said:
I forgot to mention, but run commands inside android as superuser or may fail (just after adb shell):
Code:
adb forward tcp:5555 tcp:5555
adb shell
[B]su[/B]
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0p12
And greetings for the guide, I didn't know of VHD Tool, congratulations!.
Click to expand...
Click to collapse
Thank you again scandiun
You may be right about the superuser command: su
For my part I did not have to use it but I'm sure it wouldn't hurt to run as su. Some systems may actually need it though.
Here's hoping...
oliverpowell said:
Good and informative tutorial indeed. Thanks though.
Click to expand...
Click to collapse
Thank you oliverpowell
I just hope the people who need this actually find it before they give up and start overwriting their lost data. Even having to get root access may cause a certain amount of data loss for some. Thankfully I was already rooted and already had busybox....
YOU..
YES YOU....!!!!!
WHERE HAVE YOU BEEN ALL MY LIFE?
s*it mate, i wish this thread comes earlier...
i lost my precious files on sdcard about 3 months ago when unlocking bootloader.
um..
anyway do you have any idea how to make files from computer back to internal memory,
but without changing the date modified timestamp?
i'm using adb push for that, but that's painfuly slow..
while mtp transfer messed up the date modified.
thanks, bookmarked.
just in case i do something stupid next time..
Not many options...
marhensa said:
um..
anyway do you have any idea how to make files from computer back to internal memory,
but without changing the date modified timestamp?
i'm using adb push for that, but that's painfuly slow..
while mtp transfer messed up the date modified.
Click to expand...
Click to collapse
I'm afraid painfully slow is probably the only option, just like my step that takes three hours. Start it and go build a birdhouse or window box for flowers....it's going to take a while.
I'm sorry you lost files. It's very sad to hear some of the stories of people losing pictures of their children's birth, or the last pictures of their husband going to Afghanistan... and not returning.
I'm hoping that this approach or one like it can be made popular. It needs to get out there.
I've also linked this thread and scandiun's thread in the second post of this sticky thread.
Nice!
efrant said:
I've also linked this thread and scandiun's thread in the second post of this sticky thread.
Click to expand...
Click to collapse
It looks good! Thank you.
Thanks for this tutorial. :good: It worked as indicated. I just wish I knew earlier as I had been trying for the past few days to use recovery tools and trying to make the internal drive USB Mass Storage capable when all this time there was this tutorial. Unfortunately, it only returned a dozen photos. Thanks again for this tutorial... this should be spread across xda forums for any others running into these issues.
xda_toronto said:
Thanks again for this tutorial... this should be spread across xda forums for any others running into these issues.
Click to expand...
Click to collapse
Agreed - lol
Firstly, I only recently created this guide. I'm sorry you lost files
Secondly, I attempted to link to older threads that mention the same issue so that they would be more likely to show up in a future Google search but I was scolded for waking up old threads, which makes sense. I just thought this was a rather seriously important issue that deserves a lot of eyes. Loss of personal photos is a little more significant than troubleshooting a bad ROM flash, IMO. But the Mod correctly canceled those other posts. It is a little douchey to try to increase a post count by linking all over to a single (my first, really) post. However, I couldn't give less of a pbbbttt about post counts. If you don't mind me asking, how did you find this thread?
Lastly, if you add it to your sig then this will show up on all of your posts...just sayin'...
I'm glad it at least helped you get 12 pics back...
Proplem
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
Click to expand...
Click to collapse
i have the same problem
A couple things from you screenshots...
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ??
Click to expand...
Click to collapse
Did you try without using su command? Also where is busybox installed? /system/bin or /system/xbin?
CADude said:
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Click to expand...
Click to collapse
If you use the erase command in fastboot, it should work (i.e., "fastboot erase userdata"), otherwise, flashing the stock userdata image will do the trick (i.e., "fastboot flash userdata userdata.img") <-- this writes a blank image in the userdata partition.
...well, that's a good question!
CADude said:
I have a question. Let's say we don't want somebody to ever use this guide to recover our stuff after we sell them a phone. What's the most secure and thorough way to destroy all data on the Gnex, making it impossible to recover, short of destroying the phone?
Click to expand...
Click to collapse
I would imagine you could do this guide, use a Guttman algorithm wipe utility on the attached VHD and then figure out a way to push the entire VHD back to the phone. Unfortunately, that may not actually overlay the physical phone memory in the same way. Perhaps you could wipe the VHD again and push it again, and then again...?
I want to say that someone asked the question on scandiun's post too. Go see if they figured out how to push back to the phone.
Good luck
Wartickler said:
Did you try without using su command? Also where is busybox installed? /system/bin or /system/xbin?
Click to expand...
Click to collapse
busy box installed properly in the right directory
su command used
Med1a said:
Sir .. I'm facing problem .. it won't receive any data from 5555 port .. I tried to make it copy the RAW file but it stopped without getting any data .. is that normal ?? see the picture attached
Click to expand...
Click to collapse
hetunandu said:
busy box installed properly in the right directory
su command used
Click to expand...
Click to collapse
When running su check on phone that permissions are granted. Furthermore using absolute paths is for when you are running it from clockworkmod recovery. If the phone is powered on you can use
Code:
adb forward tcp:5555 tcp:5555
adb shell
su
nc -l -p 5555 -e dd if=/dev/block/mmcblk0p12
Open another Cygwin terminal and enter:
Code:
adb forward tcp:5555 tcp:5555
cd /nexus
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p12.raw
If you are still having problems you can try the command within the phone only and see if dd works:
Code:
adb shell
su
dd if=/dev/block/mmcblk0p10 of=/dev/null
Also, make sure you run all the commands in the two terminals each time and in the proper order, if you are not sure cancel with Control+C and close them and restart again.
For those who want to try backing up the partition via wifi, you can send it via ftp. Read this post:
http://forum.xda-developers.com/showthread.php?p=27793062#post27793062
Don't use su...?
hetunandu said:
busy box installed properly in the right directory
su command used
Click to expand...
Click to collapse
Please try no su exactly as in the first post.
Did you follow the steps exactly? I can only say they worked for me ):
What phone do you have?

[Q] Can I make a .img of the /userdata partition?

I'm currently working on setting up a number of 2013 N7 LTEs (in the several hundred range, with possibly more to follow) with a specific set of apps. I'd really like to reduce the actual human interaction involved to a minimum (USB debugging activation at the start if possible) so I've been looking at fastboot flashing. Is it at all possible to clone the /userdata partition on a Nexus 7 to a .img file?
I've tried using dd and cat from the adb shell, and those all fail as they tend to copy the masses of empty space into the clone. I've also tried generating zips of the applications & their data using ZIPme, but that means having to manually enter the recovery (which, if there is no alternative, I am willing to do). ZIPme seems to have an issue with KitKat though, so I do wonder if anyone knows of any alternatives?
Older versions of CWM used to be img based.
The imgs it generated were essentially flashable via fastboot as they're the same filesystem as the original partition that was nandroided.
It's a lot of work (if you're not already set up to compile recoveries), but you could try reenabling the no longer used img nandroid code in CWM
-----------------------------------
Will the users have any kind of store access? (play/amazon/whatever)
If you hand out the same /data images and also go though first setup for the users, they could all end up with the same android ID.
Settings.Secure | Android Developers: #ANDROID_ID
The docs state that it's generated per user, so if you force them to all do initial setup themselves this isnt an issue.
If you dont care that they all have the same ID then you can ignore it.
Interesting. Do you know when/at what version they moved from away from the flashable img files? I'm going to go digging but if you can give me a hint it would be very much appreciated
The end user is going to be sent straight into a kiosk app to prevent them from hacking about with the device, so luckily I won't need to worry about the Play issue!
It was around the jump from CWM 5.0 -> 6.0, they added .dup and removed .img.
I cant tell you if it's worth your time to actually build your own rec with it reenabled, just pointing out the fact CWM used to do it in the past.
Adb has a backup and restore option, try looking into that maybe
http://forum.xda-developers.com/galaxy-nexus/general/guide-phone-backup-unlock-root-t1420351
Hi
I'm too interested in backup up the nexus partitions in fastboot flashable .img(s) to clone multiple Nexus for museum application(around 40 tablets)
I successfully grab system.img, boot.img, recovery.img from a "master" pre-configured rooted Nexus with:
Code:
adb shell dd if=... > c:\backup\....img
But dumping the userdata partition give me a 13gb file (with unfortunately the unused space) that doesn't seem to work when flashing...
The cloned tablet don't keep user setting/apps :\
Here how I do it:
MASTER:
- Fastboot oem unlock
- Setup tablet(root, install CWM, install apps, change setting, setup WIFI, change home app)
- Reboot in recovery for adb:
Code:
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/system > c:\backup\system.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery > c:\backup\recovery.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/userdata > c:\backup\userdata.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/boot > c:\backup\boot.img
CLONED:
Code:
fastboot oem unlock
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot format cache
fastboot oem lock
But like I said, it doesn't work, still get the initial setup( language selection/setup tablet) and lost wifi setting and apps...
Found this old article that used the now removed ability of CWM to backup in .img
http://aigarius.com/blog/2012/09/23/cloning-or-pre-configuring-a-batch-of-android-phones/
Any thoughts, suggestions will be greatly appreciated, thanks.

[Cm-Los][NeedTester][Guide]Ril fix

TRXteam need help with testers.
If testers test this guide,and tell work this,TRXteam members working new roms build and port.
If you test,will work guide,you sent screen shots with working ril.
Ril Fix Guide
1. Make sure phone is working on your stock ROM (you can make/receive phone calls and that IMEI is correct).
2. Use "MTK Droid Tools" and make NVRAM backup (you'll get one .BIN and one .TAR file).
3. Use "SP Flash Tool" and make backup of your PROTECT_F and PROTECT_S partitions (using "Readback" tab). This is just in the case of the worst case scenario.
4. Flash custom ROM, let it boot, then go back to recovery and install Gapps and Kinguser.
5. When the phone boots again go to ADB shell.
6. Type "cd /protect_f" and then when you're inside that directory type "rm -R *".
7. Type "cd /protect_s" and then when you're inside that directory type "rm -R *".
8. Copy "nvram" directory from your NVRAM back to the "/data" directory on your phone overwritting all existing files (do NOT first remove "nvram" from your phone, just overwrite existing files).
9. Wait few seconds and your SIM card should be detected altogether with your baseband.
10. Restart your phone to confirm SIM card is working.
Good Days!
for now we are far far away to use "MTK Droid Tools" and "SP Flash Tool" Both didnt work on MT6795 (64) Bit soc now
I can try it in Friday-Saturday. But we have one problem. MTK Droid Tool don't working with 64 SoC. But I have custom recovery and I can backup ROM.
I ran the procedure from the terminal but it did not work.
I'm not sure what's happened here so far.
@TRXteam can you update the status with this? If I have a clear idea what's happening I'm possibly in for testing.

Question EFS Backup for F926B

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.

Categories

Resources