WARNING! You are doing this method on your own risk and you agree to fact that you may loose your data anyhow!
Why I cannot just make backup/restore in recovery?
Because recovery makes image of whole partition, not just backup of files, and when you restore this backup it’s formatting your partition to filesystem, which has been used when backup was made.
What do I need to migrate without loosing data?
- ADB installed on your PC
- any operating system (Windows/Mac/Linux – doesn’t matter)
- sdcard with enough memory to backup whole your /data partition – internal storage is part of /data partition, will also get purged, so we cannot use it (but don’t worry, it will be a part of our backup ( ͡° ͜ʖ ͡°))
- some basic knownledge of using ADB
How to perform a migration?
- Reboot to recovery.
- Go to Mount menu and make sure that /data and /MicroSD are selected.
- Open Command Line (Windows) or Terminal (Linux/OS X) on your PC.
- Type adb shell and press ENTER.
- Type cd /external_sd.
- Type tar -cvf data.tar /data/*
- Wait until operation will finish. If you see any error, it means you don’t have enough free space on your SDcard.
- Perform steps from How to use f2fs? tutorial.
- Reboot, but not to system – just back to recovery. If you will boot your phone now, you will need to perform another /data wipe.
- Now again type adb shell on PC, because after reboot our phone has been disconnected, and press ENTER.
- Go to Mount menu and make sure that /data and /MicroSD are selected.
- Now type: cd /external_sd && tar -xvf data.tar -C /data/ && cd /data && mv data backupf2fs && rm -r media && cd backupf2fs && mv * ../ && cd .. && rm -r backupf2fs.
- If previous step didn’t produce any error, reboot your phone and check if it’s boot succesfully. If yes, you can safely remove data.tar file from your SD card.
- Done. You have migrated to f2fs without loosing your data!
Author: NovaFusion
22 Responses
Recent Posts
Recent Comments
Archives
- August 2021
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- November 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- January 2013
- December 2012
- November 2012
- September 2012
- August 2012
- July 2012
- June 2012
Cool!
I can’t restore the data
Error: tar: seek failure: Value too large for defined data type
+1
Maybe your tar file is corrupt? What filesystem does you SD card use? If it grew to more than 4GB FAT couldn’t handle it.
I had the same problem, it seems to be bug with “tar” large file support >2GB
To avoid that error, data.tar file must be <2GB.
If already deleted your /data partition then its needed to "repair" the data.tar
For that i needed to split it to two files.
There is multiple ways to do this but i used PC as intermediary so first transfer data.tar to PC:
adb pull /external_sd/data.tar C:\data.tar
Then made two copies of data.tar and deleted half data from one and exactly another half from other tar so both were less than 2GB. (used 7zip in windows)
Put data back to phone:
adb push C:\data1.tar /external_sd/data1.tar
adb push C:\data2.tar /external_sd/data2.tar
wipe /data partition again
And do step 12. which is now slightly modified:
cd /external_sd && tar -xvf data1.tar -C /data/ && tar -xvf data2.tar -C /data/ && cd /data && mv data backupf2fs && rm -r media && cd backupf2fs && mv * ../ && cd .. && rm -r backupf2fs
reboot recovery
install latest soft again
wipe dalvik
To avoid this problem the data.tar should be already generated less than <2GB or splitted.
Man,my words are not enough,i mean i was despirate with ext4,you saved my life!!!!thank you 🙂
7-zip would probably break permissions. you should update busybox instead
+1
+1, I managed to fix this error but my post does not appear here, tried two times.
The problem is the tar file is bigger than 2gb
Well you have to “adb pull” the data.tar to the PC, edit it using 7zip and remove stuff already successfully extracted (in my case the /data/app dir). Then rename it to data2.tar and “adb push” it back. Now just run the extract command again, but on this new file (after done extracting the first one).
I install the ADB on PC, sansung drivers, i mont the external SD and data but, the pc can’t connect on cell and the pront show msng: “error. device not found”
Thanks 🙂
Can you please add another guide for the ones who doesn’t really know how to use adb ?
P.S you are doing an amazing job, keep going
adb is like [ssh]. A remote log-in. You log in to a [CLI shell] of your phone. Usually [ash], but you can enter [bash] to use that too. So by learning the basics of working on a Linux shell with a file system, [man pages] and the [GNU utilities], you know how to do everything. It’s also extremely useful if you want to do actual work with a computer (instead of playing with colorful clickables and consuming information), without being a programmer. (See: [shell scripting]). As in: Automating your work away, then just put your feet up and watch it do its work, only asking you when really necessary. Like a computer should. 🙂
(Look up all the terms in square brackets. Then read the sentence again. This allows you to judge properly what you need and what you don’t. 🙂
Well, i completed the whole procedure succesfully, but my phone won’t boot after data is back on f2fs partition. It’s claiming ‘Encryption unsuccessful’, but i don’t even have encryption enabled. I also wiped cache before booting into system. I did not boot system in between steps. Every step completed without any error.
Worked perfectly
Why is important to remove “media” folder?
Is this supposed to work with Carbon at all, yet? (Just for data partition?)
commands dosen’t work for me .
cd /external_sd
i use cd /extSdCard and it work but
tar -cvf data.tar /data/* dosen’t work it says
tar: /data/*: No such file or directory
tar: error exit delayed from previous errors
i try again and it work i don’t access adb in superuser.
now everything is ok
Thanks for this great tutorial. Everything worked fine.
One suggestion: Add a link to ADB tools for users not nowing anything about ADB or where to find it.
I used ADB from here: http://forum.xda-developers.com/showthread.php?t=2588979
Hey is it possible to save my stuff with Titanium Backup and restore them after the reformat???
Anyone done it?