Related
Here's the scenario: say you try out encryption on a ROM, either because your employer makes you or because you want the extra security. What happens when you can root your phone, like we can (easily) with the S3, and you want to flash a different ROM? The problem you will find yourself in very quickly is that you cannot do a successful wipe. You can't format an encrypted /data in CWM or any other recovery. If you cannot format /data, you can't flash a ROM - it fails, because /data is encrypted, and it cannot proceed. It turns out none of the recoveries can format an encrypted /data. You also cannot reverse encryption once you've done it. You're stuck, all because you flipped the switch on encryption.
I found myself in this problem as others have in many other forums (like this one for the GNex) (and another one, more detailed).
I also tried, admittedly somewhat out of desperation, the soft-brick instructions here. That didn't work because Nand Erase All fails. You can flash on top, and luckily you can use your same password to decrypt your /data (which I did) but you're still not going to have a clean ROM. Dirty flashes = lots of problems down the road.
I finally found a simple way to do this and wanted to save anyone else the trouble of digging. You can do it using CWM and adb and a few commands. Credit goes Shawn Webb's blog and utkanos on FreeNode's irc at #cyanogenmod.
Here is how to do this on our Verizon S3:
In CWM, wipe cache
adb shell
mke2fs -t ext4 /dev/block/mmcblk0p15
mount /data
mount /dev/block/mmcblk1p1 /data/media
If adb doesn't work in CWM, reboot recovery. You might need to create /data/media after mounting /data in order to do the last step, which I opted not to do. I hope this saves someone else a few hours of frustration, and I also hope that someday one of our recoveries can handle formatting encrypted data. Until then... I'm just not using encryption, period. There already is a lot of documentation against it, and this is one more reason in my book.
Thanks for this. I fell into the same scenario yesterday but after reading a lot of helpful posts from people like yourself I have managed to solve the issue. Basically I found two ways of doing it, one is as you have suggested and the other is by just replacing the custom recovery with the stock recovery. The SGS3 toolkit available on XDA made the 2nd option just slightly simpler for me and by spending less than 10 mins (excluding time for backups and downloads) the issue was resolved.
Just to share this option to save others from the headache of looking for a solution:
1) Get the toolkit
2) Install drivers as recommended and follow instructions to choose the build, or closest build, for your S3
3) Restore stock recovery with toolkit via ODIN (follow instructions)
4) After rebooting, go into Android and reset to factory settings, this would bring you to the stock recovery and wipe
5) Restore custom recovery with toolkit via ODIN (follow instructions)
6) Restore your system (luckily for me I had a nandroid backup before I encrypted)
Note: I did "lose" my internal sdcard files (pictures/documents). But I backed that up on my external sdcard before starting the process. My sdcard was not encrypted.
kitleon said:
Thanks for this. I fell into the same scenario yesterday but after reading a lot of helpful posts from people like yourself I have managed to solve the issue. Basically I found two ways of doing it, one is as you have suggested and the other is by just replacing the custom recovery with the stock recovery. The SGS3 toolkit available on XDA made the 2nd option just slightly simpler for me and by spending less than 10 mins (excluding time for backups and downloads) the issue was resolved.
Just to share this option to save others from the headache of looking for a solution:
1) Get the toolkit
2) Install drivers as recommended and follow instructions to choose the build, or closest build, for your S3
3) Restore stock recovery with toolkit via ODIN (follow instructions)
4) After rebooting, go into Android and reset to factory settings, this would bring you to the stock recovery and wipe
5) Restore custom recovery with toolkit via ODIN (follow instructions)
6) Restore your system (luckily for me I had a nandroid backup before I encrypted)
Note: I did "lose" my internal sdcard files (pictures/documents). But I backed that up on my external sdcard before starting the process. My sdcard was not encrypted.
Click to expand...
Click to collapse
You just saved my month. Drop me a message if I can get you a beer via paypal for this.
Cheers!
THANKS!
olm3ca said:
Here's the scenario: say you try out encryption on a ROM, either because your employer makes you or because you want the extra security. What happens when you can root your phone, like we can (easily) with the S3, and you want to flash a different ROM? The problem you will find yourself in very quickly is that you cannot do a successful wipe. You can't format an encrypted /data in CWM or any other recovery. If you cannot format /data, you can't flash a ROM - it fails, because /data is encrypted, and it cannot proceed. It turns out none of the recoveries can format an encrypted /data. You also cannot reverse encryption once you've done it. You're stuck, all because you flipped the switch on encryption.
I found myself in this problem as others have in many other forums (like this one for the GNex) (and another one, more detailed).
I also tried, admittedly somewhat out of desperation, the soft-brick instructions here. That didn't work because Nand Erase All fails. You can flash on top, and luckily you can use your same password to decrypt your /data (which I did) but you're still not going to have a clean ROM. Dirty flashes = lots of problems down the road.
I finally found a simple way to do this and wanted to save anyone else the trouble of digging. You can do it using CWM and adb and a few commands. Credit goes Shawn Webb's blog and utkanos on FreeNode's irc at #cyanogenmod.
Here is how to do this on our Verizon S3:
In CWM, wipe cache
adb shell
mke2fs -t ext4 /dev/block/mmcblk0p15
mount /data
mount /dev/block/mmcblk1p1 /data/media
If adb doesn't work in CWM, reboot recovery. You might need to create /data/media after mounting /data in order to do the last step, which I opted not to do. I hope this saves someone else a few hours of frustration, and I also hope that someday one of our recoveries can handle formatting encrypted data. Until then... I'm just not using encryption, period. There already is a lot of documentation against it, and this is one more reason in my book.
Click to expand...
Click to collapse
Just wanted to say thanks very much for this. I'd tried the method of reloading the stock ROM as described by a previous poster, but this way worked.
I did run into a small issue I was wondering if you could shed some light on. When I entered "mount /data", I got the following:
Code:
~ # mount /data
mount: mounting /dev/block/mmcblk0p37 on /data failed: Invalid argument
I bullied ahead and entered the last line "mount /dev/block/mmcblk1p1 /data/media" and got this:
Code:
~ # mount /dev/block/mmcblk1p1 /data/media
mount: mounting /dev/block/mmcblk1p1 on /data/media failed: No such file or directory
However after doing this, I was able to perform a complete wipe of /data using CWM and load a new ROM without issue.
I'd curious to know what might be causing these Invald argument responses.
My Device: HTC One (GSM)
Thanks again! :laugh:
olm3ca said:
Here is how to do this on our Verizon S3:
In CWM, wipe cache
adb shell
mke2fs -t ext4 /dev/block/mmcblk0p15
mount /data
mount /dev/block/mmcblk1p1 /data/media
If adb doesn't work in CWM, reboot recovery. You might need to create /data/media after mounting /data in order to do the last step, which I opted not to do. I hope this saves someone else a few hours of frustration, and I also hope that someday one of our recoveries can handle formatting encrypted data. Until then... I'm just not using encryption, period. There already is a lot of documentation against it, and this is one more reason in my book.
Click to expand...
Click to collapse
I'm trying to follow your instructions but fail at finding out my mount points.
Sorry for the noob question, but who do I find out what the mount points of internal and external SD card are on my device (Samsung Galaxy S4 Mini International 4G)? I found this post
stackoverflow. /questions/6824463/how-to-get-all-the-mount-point-information-for-android-device
which seems to include the answer but I don't know what tool / software they use. I'm no programmer.
My phone is encrypted and doesn't turn on, it doesn't accept my password saying it's wrong, though I know it's correct. OS is Cyanogenmod 10.1 stable. Booting into CWM v6.0.3.7 is possible though.
I appreciate everyone's help.
Stephan
Hi guys. To spare you the details and cut to the chase after rebooting the phone in ICS i got a message with "Unsuccessful decryption" and i needed to restore factory to continue. And i got into the CWM5 recovery and tried to wipe data/reset
All partitions were formated but /data:
E:format_volume make_extf4fs failed on /dev/block/stl13
Mounting works expect /data
So i can`t format /data and dalvik cache.
I tried to restore to stock GB with odin and all worked fine until the phone reboots and goes into stock recovery and tries to format data but gives error:
-- Wiping data...
Formatting /data...
E:format_volume: rfs format failed on /dev/stl13
and reboot to bootloader and stuck in bootloop.
I know this looks pretty much like /data partition corruption..
I asked if anyone can help me with this issue :/ I`ve read other forums that this can be fixed but i am afraid to use other phone`s tools not to end up bricking it dead.
I have added recovery report View attachment recovery.txt
I have been googling alot this past time and tried all sorts of binaries and zip trying to repartition slt13 but no luck.
For what i have learn i have one more chance of resurecting the partition with RIFF JTAG Box on low level...
Can anyone answer this question:
If all partitions are working fine exect stl13 (/data) is there any chance the NAND chip is dead/corrupted?!
I don`t alot of physical hardware of my device so is there a separate NAND chip for /data or it is a single chip for all partitions? (I.E: /system/ ; /data/ etc. )
Facing the same problem!!
k3eNaNz said:
I have been googling alot this past time and tried all sorts of binaries and zip trying to repartition slt13 but no luck.
For what i have learn i have one more chance of resurecting the partition with RIFF JTAG Box on low level...
Can anyone answer this question:
If all partitions are working fine exect stl13 (/data) is there any chance the NAND chip is dead/corrupted?!
I don`t alot of physical hardware of my device so is there a separate NAND chip for /data or it is a single chip for all partitions? (I.E: /system/ ; /data/ etc. )
Click to expand...
Click to collapse
HAVE YOU FOUND OUT A WAY YET
i ran this command.
mke2fs -T ext4 /dev/block/mmcblk0p44
right now the screen says Writing superblocks and filesystem account information : 0/201(a bunch of rectangles here) (a bunch more rectangles)done
does the done at the end mean it's done? the reason i'm confused is the developer that recommended this command to format an encrypted drive said it would take hours... but it stopped there and appears to be doing nothing now? is it done or should i wait longer?
the reason i'm confused is formats are usually fast because they just rewrite the partition table i thought? or is this a full format where it writes 0's to the entire drive?
plz answer if anyone knows how to tell when this format is done. i can post entire log of format if needed.
KronicSkillz said:
i ran this command.
mke2fs -T ext4 /dev/block/mmcblk0p44
right now the screen says Writing superblocks and filesystem account information : 0/201(a bunch of rectangles here) (a bunch more rectangles)done
does the done at the end mean it's done? the reason i'm confused is the developer that recommended this command to format an encrypted drive said it would take hours... but it stopped there and appears to be doing nothing now? is it done or should i wait longer?
the reason i'm confused is formats are usually fast because they just rewrite the partition table i thought? or is this a full format where it writes 0's to the entire drive?
plz answer if anyone knows how to tell when this format is done. i can post entire log of format if needed.
Click to expand...
Click to collapse
nevermind i got brave and ran the regular format on /data/ and its all good. by the way this is how you can format an encrypted drive in twrp (since you will get a mounting error from usual wipe method). MAKE SURE you use the proper partition address though, the one that i have here is for LG G3 d852 only.
download a parition information app to check the address of your data partition before you try this command.
this is similar to doing a hard reset on a stock device, when you reboot it will look similar to a fresh install with some acceptions. note: every device is different i cannot guarantee anything
Howdy folks! New to android/honor 8 and I've been fiddling with it some. So far I've rooted, installed TWRP, SU and Xposed successfully. I've been trying to make a nandroid before completely ****ing up my device, but each time I try I get errors before completion...mainly at the end of the backup I get an error 255 or an error opening the backup directory (internal).
Anyone successfully back up their honor 8 with TWRP?
Appreciate any advice!
I have a copy of my stock rooted ROM with Xposed. What error are you getting? I'm backing mine up to the External SDcard.
Ascertion said:
I have a copy of my stock rooted ROM with Xposed. What error are you getting? I'm backing mine up to the External SDcard.
Click to expand...
Click to collapse
Most recently I'm getting this -
Backing up System...
createTarFork() process ended with ERROR: 255
Been trying to backup 3 partitions - data, system & boot using compression.
Here's some of the recovery.log file too -
Backing up System...
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000'
I:Using compression...
Error opening: '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' (No such file or directory)
I:Error creating tar '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' for thread 0
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
fauxfive55 said:
Most recently I'm getting this -
Backing up System...
createTarFork() process ended with ERROR: 255
Been trying to backup 3 partitions - data, system & boot using compression.
Here's some of the recovery.log file too -
Backing up System...
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000'
I:Using compression...
Error opening: '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' (No such file or directory)
I:Error creating tar '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' for thread 0
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
Click to expand...
Click to collapse
Try backing up to external SD.
Sent from my Galaxy Tab 3 using XDA Labs
I have the same issue. I can't do a backup with TWRP. System, data and boot. It always ends with an error.
I have tried every storage, internal, SD, and OTG drive. Reflashed TWRP. Nothing seems to do any difference. Drives me crazy. Any solution?
just flash stock recovery then flash again TWRP . format SD throw recovery only then try backup should work . happened with me before ! .
Romiui said:
just flash stock recovery then flash again TWRP . format SD throw recovery only then try backup should work . happened with me before ! .
Click to expand...
Click to collapse
Unfortunately that didn't work. Tried flashing stock recovery and back, same thing. Then I flashed latest firmware (total reset), unlocked bl, flashed official TWRP and latest SuperSU. No success. ?
The issue is (or seem to be) data partition fail to mount, or does unmount during backup.
Can't be just me and OP struggling with this.
its really rare issue . i got that problem but honestly it get fixed after that solution !
Backup all other partitions except for the one that fails for now then as that is all you need to fix a bootloop etc and use Ti backup to get the apps etc
Hello,
I'm experiencing the same error when trying to backup to internal memory. I haven't yet tried to flash stock recovery back and after flash TWRP again to check if it solves the problem though.
RM
fauxfive55 said:
Most recently I'm getting this -
Backing up System...
createTarFork() process ended with ERROR: 255
Been trying to backup 3 partitions - data, system & boot using compression.
Here's some of the recovery.log file too -
Backing up System...
Breaking backup file into multiple archives...
I:Creating backup...
I:Creating tar file '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000'
I:Using compression...
Error opening: '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' (No such file or directory)
I:Error creating tar '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.ext4.win000' for thread 0
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/RNV0216A31000896/2016-12-10--18-31-32/system.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
Click to expand...
Click to collapse
I think this has been suggested already but I'm not certain:
Since the only error you're showing us (and maybe getting) is on /system partition Target (backup target), then how about trying unchecking that and doing the backup and seeing if you can get the same error (or not) on the other two (/data and /boot). ? Another thing maybe worth a shot is a completely benign partition like /cache and it's small for a quick test, maybe just give that a try. It'd be good to know that anything at all can be backed up in your version of TWRP.
Just want to see if it's something special about /system [target]. Also have you told us here which version from which thread you got TWRP from? Just curious. For Honor8 there seems to be so many TWRP authors that aren't too sure of their versions of TWRP (yet). Good luck.
hachamacha said:
I think this has been suggested already but I'm not certain:
Since the only error you're showing us (and maybe getting) is on /system partition Target (backup target), then how about trying unchecking that and doing the backup and seeing if you can get the same error (or not) on the other two (/data and /boot). ? Another thing maybe worth a shot is a completely benign partition like /cache and it's small for a quick test, maybe just give that a try. It'd be good to know that anything at all can be backed up in your version of TWRP.
Just want to see if it's something special about /system [target]. Also have you told us here which version from which thread you got TWRP from? Just curious. For Honor8 there seems to be so many TWRP authors that aren't too sure of their versions of TWRP (yet). Good luck.
Click to expand...
Click to collapse
This is interesting, because I have the same problem as well. I've tried backing up to internal as well as SD. I've also tried doing a full reset, flashing back to TWRP and same issue. No matter what partition I try, it always fails with the same error 255. I followed this thread exactly: http://forum.xda-developers.com/honor-8/how-to/guide-unlock-bootloader-tested-root-t3443946.
Doesn't seem as rare of an issue as initially thought. Any ideas?
joesee said:
This is interesting, because I have the same problem as well. I've tried backing up to internal as well as SD. I've also tried doing a full reset, flashing back to TWRP and same issue. No matter what partition I try, it always fails with the same error 255. I followed this thread exactly: http://forum.xda-developers.com/honor-8/how-to/guide-unlock-bootloader-tested-root-t3443946.
Doesn't seem as rare of an issue as initially thought. Any ideas?
Click to expand...
Click to collapse
It looks like only 2 of the replies in this thread show any hint of success, and even they didn't specifically say they'd done a backup and recovery. I'd kind of like to see a log from a successful backup & recovery before spending much time on this version of TWRP. If it just doesn't work and from every TWRP thread I've read, lots of people are having problems on this phone, so it might not work. I still don't know which version of recovery you all are using and am wondering if it's the official one from twrp.me site? Also, I suppose you'd have to be on android 6 for that to work.
Anyway, I just got mine today (H8), and am seeing if I can live with the size (I really like the 4.6" form factor better), but I really like how things function so far. If I get to the point where I've got Nougat installed without rooting it and still haven't decided to get a refund, then I'll go ahead and do all this stuff and see if I can help. I worked on a bunch of variants of Philz recovery long ago (and it could be completely irrelevant) so I need to look at the TWRP code and try another take on it. For me, one of the best things about rooting is the custom backup and recovery where it actually does those two things perfectly. I guess with the different CPU that there's still a lot of flailing in development land.
One of the few things I really recall being possibly relevant from Philz was how often people who were writing for various devices screwed up the only path to the root of the target by picking one that was either a) a soft link with bad permissions or b) not exactly the right spot. Just because TWRP says "external SD" (or whatever it says) doesn't mean much it's not pointing to something you can write to. I was using a Synology app named DS files today to get some stuff on the H8 and it wouldn't let me put them on the sdcard because it thought I hadn't given permissions to the DS File app. Does that make any sense? I just navigated around until I found a better path to the sdcard that had permissions because there was no way to give sdcard permissions to that app.
Has anyone pointed this out to @LastStandingDroid ?
those were all the same problems I had.
clsA said:
Has anyone pointed this out to @LastStandingDroid ?
those were all the same problems I had.
Click to expand...
Click to collapse
I found LSD seem to be aware about this in his nougat 3.0.2.0 recovery.
He wrote something about data partition unmounting being fixed.
Not sure if this is a known Marshmallow issue though.
Hello!
I've followed the suggestion of flashing stock recovery and after that TWRP but it did not made any difference, same error while backing up DATA.
But, after that I tried disabling compression and it worked OK. I've made a second try and it worked again. After this second successful run, I've tried a third time, but this time with compression enabled again, result.. Error...
Not a very scientific test, but it suggests the error has something to do with the compression.
RM
omartins said:
Hello,
I'm experiencing the same error when trying to backup to internal memory. I haven't yet tried to flash stock recovery back and after flash TWRP again to check if it solves the problem though.
RM
Click to expand...
Click to collapse
Currently there is no data partition backup support
Sent from my KIW-L22 using Tapatalk
I've not tried to restore the backup I've made supposedly successfully with compression disabled, but, I didn't get any error during the backup operation...
RM
Thanks
Thanks Boss love u
Hi there!
Today I've used TWRP Data backup to restore app settings, using TiBu. I can confirm the backup was useful, hence well successfully made.
RM
Hello All,
Recently i applied local update on my one plus 8t and it wiped all my data everything is lost. Backup to drive and oneplus cloud was also NOT turned ON.
Any way to recover files ? I already tried Wondershare and few other applications but none of them worked.
One of my friend suggested RECUVA but its not showing my phone as a drive.
Please help.
May be an authorized service center has the means to recover the wiped data, means the forensic software needed. In any case, phone's Android must be rooted.
Don't trust the 3rd-party-softwares you've to pay for: are all more or less only crap.
Thanks for replying but can i mount my android as a drive (removable storage). just like flash drive.
it's pointless. FDE crypto-footer is garbage even if just a single byte is overwritten. FBE encryption keys aren't stored in userspace at all. your device uses both FBE + FDE. userdata partition is F2FS file system, no recovery tools will work. your data is unrecoverable per design
How to recover a deleted file from /data partition?
I factory reset my rooted Android M phone but now I realize that there was a file in the /data directory which I need. Is it possible to create an image (.img or something similar) of the /data
android.stackexchange.com
aIecxs said:
it's pointless. FDE crypto-footer is garbage even if just a single byte is overwritten. FBE encryption keys aren't stored in userspace at all. your device uses both FBE + FDE. userdata partition is F2FS file system, no recovery tools will work. your data is unrecoverable per design
How to recover a deleted file from /data partition?
I factory reset my rooted Android M phone but now I realize that there was a file in the /data directory which I need. Is it possible to create an image (.img or something similar) of the /data
android.stackexchange.com
Click to expand...
Click to collapse
so data on my samsung j4+ which was factory resetted (because i had to unlock the boot loader) cannot be recovered?
I was talking about OnePlus 8T. That's different from yours