Long story short, had to send the phone in for repair, so I did the obligatory backups and unroot/reflash of factory images.
I don't have TWRP, too much hassle together with magisk for taking OTAs, so I took my backups (/data, /data/media) with tar/split/gzip.
Did my due dilligence to make sure the backup was good - resulting tar file extracts perfectly fine on my linux desktop.
Got my phone back, rerooted, ready to restore now. However, on the device, it stops extracting about 20 files in with 'invalid tar format'.
Tried again with busybox tar, and this time I get 'invalid tar magic'. Normally this suggests the tar is corrupted, but that doesn't explain why it's fine on my desktop. Note that the desktop archive I extracted is identical, e.g. it is the same one copied from the SD card I'm trying to restore now. What gives, since it's the same tar that created it in the first place... I've tried multiple versions/copies (this was a split archive since it was over 4GB in size - so I even recombined it on my host PC and pushed it to internal storage over ADB.) gzip has no issues with the outer compression (e.g I can gunzip the tar.gz fine) so the file itself doesn't seem corrupted.
Any suggestions on how I can get my /data back? Unfortunately I cannot just copy the files extracted on my desktop as this would mangle the permissions... and manually trying to fix them for the umpteen-hundred various folders is not practical...
I guess I'm hoping someone in the know might be able to point me to a different version of tar, or another tool (already tried cpio -H tar, not supported on android) that would extract things successfully.
I managed to get things to work by using a later version of tar from https://forum.xda-developers.com/android/software/utils-data-recovery-tools-testdisk-t3709380
However, I've now hit a new issue. After extracting to /data/data, or /data/app, the files are there, but vanish after a reboot, so the restore is incomplete.
Related
I wanted to layout what I did to achieve a backup and was hoping that one of the understanding ones could give me feedback about the method and any guidance on a better way.
1. Device is untouched
2. Superonclick for Root Access
3. Copied and manually installed ROM Manager.APK
4. Copied and manually install Verizon Bootstrapper.APK
This installed ClockWork Mod 3 and a full backup of the system was made with the following files:
Boot.img
Cache.img
data.img
datadata.img
nandroid.md5
recovery.img
system.img
So … given that I have these files from a virgin tab with no data entered …. No google account etc.. this should be a base image set correct?
Now what is the best way to extract from the IMG files what everyone needs from the various posts?
P.S. I did try rotobackup, I tried the exe file and the scripts that people made …. Apparently that is one above my pay grade as I could not get them to work.
Tell me I am an idiot … tell me it is a waste of time ….. or teach me to fish ….. open to any feedback.
Thanks,
Tony ~ mnpolock
I don't believe your image is really a base image, since you have installed Clockworkmod. So even if you flash back to that image, and then do a factory reset (which would wipe out root) you'll still have CWM on there.
Good point ..... I was looking at it from the standpoint (but didn't say) that I would have everything stock and blank but the kernel ( I think that is correct CWM is a kernel mod).
Tony
best way to back up anything you wan is to use Titanium Backup app you can back anything you want by just picking it from apps or system files and then but the back up you made on your pc or safe place ..
My motherboard is toast, I bought a broken phone on ebay and switched out the motherboards but it isnt working. Phone works fine but wont recognize sim card or connect to network. Its just a camera/wifi device atm. So anyway..... I can still get the old motherboard to kinda work enough to play with it, the home buttons dont work or the power button and sometimes freezes up. Is there a way I can put the old motherboard in the phone and copy the system files to the external sd card or computer, then wipe the new motherboard and copy the files from the old mb to the new mb? I believe I have tried everything else but if anyone has any suggestions Im all ears
Thanks!
The easiest way would probably be to take the motherboard you're wanting to pull stuff from, hook it up (in the phone), and via USB in ADB do something like this:
adb pull / \backup
That would create a folder at the top level of your C: drive with all the contents of the phone on it. You could then move all of that to the new motherboard.
(That would probably be something like:
adb push \backup /
but I'm not 100% sure on that. You may have to do a more one-by-one procedure.)
when I try to push the backup I get this message....
failed to copy '\backup/acct/uid/0/task' to 'acct/uid/0/task' : Operation not permitted
Sooooo what did I do wrong??
Also I couldnt find where it saved the backup on my computer.
Ok, found the backup folder on my c: drive but what do I do with it now?
Bump cause I still havent figured this out Seems like I dont have the correct permissions in adb.
poprocksncoke said:
when I try to push the backup I get this message....
failed to copy '\backup/acct/uid/0/task' to 'acct/uid/0/task' : Operation not permitted
Sooooo what did I do wrong??
Also I couldnt find where it saved the backup on my computer.
Ok, found the backup folder on my c: drive but what do I do with it now?
Click to expand...
Click to collapse
If you typed in your backup like what you wrote above (\backup/acct/uid/0/task), it's likely that you're running into an error because you flipped your slashes midway through.
The backup folder needs to be in the platform-tools folder of the ADB installation, as that's where ADB pushes from.
Once you have that, reboot into recovery mode. This may not be 100% necessary, but I usually find that pushes work better from there as the file system is (usually) read-write.
Then, try this:
adb push \backup /
(You may have to switch the slash before the word backup so it reads /backup, I'm not 100% sure.)
If that doesn't work, drag an individual folder out of the backup folder to the main platform-tools folder and type:
adb push /acct \
You'll have to repeat that for each folder, but it should work.
If all that fails, you can try to make a CWM flashable zip file. I don't know exactly what the procedure is for doing this, but I would guess that the answer exists somewhere on this site.
jmtheiss said:
If you typed in your backup like what you wrote above (\backup/acct/uid/0/task), it's likely that you're running into an error because you flipped your slashes midway through.
The backup folder needs to be in the platform-tools folder of the ADB installation, as that's where ADB pushes from.
Once you have that, reboot into recovery mode. This may not be 100% necessary, but I usually find that pushes work better from there as the file system is (usually) read-write.
Then, try this:
adb push \backup /
(You may have to switch the slash before the word backup so it reads /backup, I'm not 100% sure.)
If that doesn't work, drag an individual folder out of the backup folder to the main platform-tools folder and type:
adb push /acct \
You'll have to repeat that for each folder, but it should work.
If all that fails, you can try to make a CWM flashable zip file. I don't know exactly what the procedure is for doing this, but I would guess that the answer exists somewhere on this site.
Click to expand...
Click to collapse
Actually what I typed was adb push \backup / then it gave me that error. It stored the backup folder on my c: drive, I will move it to the tools folder and see if that works. Going to go search on how to make a CWM flashable zip file now. Maybe i'll give that a shot too. Thanks for your help.
So If I am getting this correctly, I take the custom ROM I have flashed to my phone and then I can add my system files to to the system folder in the ROM I can then flash the ROM again and it will install all my files?
In theory, yes, that should work. All the CWM update file does is write the files inside of it to the folders that the updater-script file tells it to.
Again, this should work IN THEORY.
poprocksncoke said:
So If I am getting this correctly, I take the custom ROM I have flashed to my phone and then I can add my system files to to the system folder in the ROM I can then flash the ROM again and it will install all my files?
Click to expand...
Click to collapse
Ok, I tried this and put the .zip on my sdcard and ran it from recovery. Got an error that I didnt have enough space. Any suggestions?
Hey guys, I used TWRP to back up files, then by mistake I used format data instead advanced wipe!
So I lost everything on my mobile with the back up files! :crying:
Now I googled file extension for TWRP back up, it was .WIN
Even though all TWRP backup files carry the extension .win, they are either tar archives or filesystem images. System, data, cache and .android_secure are backed up as tar archives or gnu-zipped tar archives if compression is enabled. You can rename those .win files to .tar (.tar.gz if compressed) and extract them like a regular archive. Boot and recovery partitions are backed up as .img files using dd.
Click to expand...
Click to collapse
^ http://forum.xda-developers.com/showthread.php?t=1694617 ^
So is there any program that I can use to restore the back up files? If not, How can I restore at-least pictures, videos, messages, contacts.. etc?
If someone there can help me, please do! any little info can be useful!
Thank you.
Hello everyone,
I've been playing around with adding root to my stock ROM these past few days, and have found it very slow and tedious trying to remember all the commands to unpack and repack the images.
To make things simpler I've created a script that automates almost the whole process.
I've named it worker as it does all the work for you, and it is just simply a bash script. But it makes things a lot quicker and easier.
I have only been able to test with my S3 Mini, but should work with any ROM that has boot.img and system.img
Simply extract the .img files from the tar.md5 or .zip ROM file, and place them in the original folder.
Once you have those in the original folder just simply run the worker.txt file from the terminal, making sure you are in the worker folder directory.
When the script is run you will be given the options to unpack/repack system.img, mount system.img (This is after you extract it do not try and mount the original file it wont work), unpack/repack boot.img, unpack/repack ramdisk, create ROM (This will create an odin flashable tar.md5 from the repacked files) and finally clean up (This will clear all unpacked and repacked files only leaving the files in the original folder)
To select an option simply type y then enter to execute that command or just hit enter to skip.
When the system.img is mounted it will be mounted in the mount folder.
When repacking the system.img you will be prompted to enter the file size, if you have and S3 Mini I8190N simply type s3mini for the size (This may work for other S3 models but I have no way of testing so let me know). If you have a different device use the file size of the original UNMODIFIED system.img, enter the size in bytes or MB (If entering in MB use this format, xxx being a number. xxxM).
Please give me feedback for improvements or problems,
Thanks for reading.
P.S. Sorry if in wrong place please move if necessary
EDIT: If you can't run the script with the ./ command, chmod +x the file
Antonyb1995 said:
Hello everyone,
I've been playing around with adding root to my stock ROM these past few days, and have found it very slow and tedious trying to remember all the commands to unpack and repack the images.
To make things simpler I've created a script that automates almost the whole process.
I've named it worker as it does all the work for you, and it is just simply a bash script. But it makes things a lot quicker and easier.
I have only been able to test with my S3 Mini, but should work with any ROM that has boot.img and system.img
Simply extract the .img files from the tar.md5 or .zip ROM file, and place them in the original folder.
Once you have those in the original folder just simply run the worker.txt file from the terminal, making sure you are in the worker folder directory.
When the script is run you will be given the options to unpack/repack system.img, mount system.img (This is after you extract it do not try and mount the original file it wont work), unpack/repack boot.img, unpack/repack ramdisk, create ROM (This will create an odin flashable tar.md5 from the repacked files) and finally clean up (This will clear all unpacked and repacked files only leaving the files in the original folder)
To select an option simply type y then enter to execute that command or just hit enter to skip.
When the system.img is mounted it will be mounted in the mount folder.
When repacking the system.img you will be prompted to enter the file size, if you have and S3 Mini I8190N simply type s3mini for the size (This may work for other S3 models but I have no way of testing so let me know). If you have a different device use the file size of the original UNMODIFIED system.img, enter the size in bytes or MB (If entering in MB use this format, xxx being a number. xxxM).
Please give me feedback for improvements or problems,
Thanks for reading.
P.S. Sorry if in wrong place please move if necessary
Click to expand...
Click to collapse
work on gt-i8200n to?
linklusitano said:
work on gt-i8200n to?
Click to expand...
Click to collapse
No reason why not, I'm just not able to test others
Antonyb1995 said:
No reason why not, I'm just not able to test others
Click to expand...
Click to collapse
testing
linklusitano said:
testing
Click to expand...
Click to collapse
Great let me know if it works!
EDIT: Make sure you enter the right size for the system.img file, the pre entered size using s3mini may work fine as they are very similar devices.
Antonyb1995 said:
Great let me know if it works!
EDIT: Make sure you enter the right size for the system.img file, the pre entered size using s3mini may work fine as they are very similar devices.
Click to expand...
Click to collapse
how do i run worker.txt?
linklusitano said:
how do i run worker.txt?
Click to expand...
Click to collapse
Your using Linux right?
Open a terminal and change directory to the worker folder, once there type ./worker.txt and it should run. If it doesn't issue this command chmod +x worker.txt that should fix it.
Antonyb1995 said:
Your using Linux right?
Open a terminal and change directory to the worker folder, once there type ./worker.txt and it should run. If it doesn't issue this command chmod +x worker.txt that should fix it.
Click to expand...
Click to collapse
windows 8.1
linklusitano said:
windows 8.1
Click to expand...
Click to collapse
Ah okay, If you install Cygwin you can run bash scripts in Windows.
LINK: https://www.cygwin.com/
Hello community,
I'm currently trying to modify the stock rom for my GT-I8200n. I didn't find cwm for the S III mini VE, and the version of twrp I found was very buggy. So I need an odin-compatible flash file for my rom. I tried to modify the stock rom by downloading the .tar.md5 from sammobile, unpacked it with winrar and copied the system.img into an ubuntu-VM. After that I created a sys.img (or sys.raw, same problem) out of system.img using the simg2img-file I found somewhere here on xda, mounted sys.img (or sys.raw) and modified it. Then I unmounted it and used img2simg to create my system_new.img. Copied it to my windows system, into the unpacked stock rom folder, renamed it to system.img, overwriting the old system.img and packed everything into a .tar file using ZArc. Now while flashing my ROM, odin works on the system.img for some minutes and then shows a fail.
Does anyone know what I'm doing wrong?
P.S.: I tried simply using simg2img on my stock system.img and then - without mounting and modifying - used img2simg kn the sys.img file. Same problem with odin and I noticed that my new system.img is approximately 50 mb smaller than the stock img, although I didn't modify it.
I hope I described my problem well (I'm not an english native speaker, but did my best to make this text understandable )
Any ideas or hints that could maybe solve this problem are welcome.
Thank you,
Chris
I have the same problem
any solution ?