Question: After TWRP install and /data format can't access encrypted SD card data anymore, is this normal? - Samsung Galaxy J3 (2017) Questions & Answers

Thanks for this great site, I followed the instructions in this thread to install TWRP on a Samsung Galaxy J3 (2017) running Android 7 with encryption enabled on the Phone: https://forum.xda-developers.com/t/...axy-j3-2017-sm-j330f-j330fn-j330g-ds.3709056/
Since encryption was enabled on the Phone (including the SD card) TWRP could not mount the /data partition which was fine (I could load a zip from USB OTG instead). But the Phone complained on normal boot about "Integrity check failure" and that it would reboot to recover/restore, but the same message appeared on reboot. To get out of this endless loop I booted into TWRP and formatted the /data partition (without encryption) since all important data is stored on the encrypted SD card. Now the Samsung Galaxy J3 was able to boot normally without any integrity warnings but with all data/settings gone (as expected). The problem now is I can't access the encrypted data on the SD card anymore, I have the option to decrypt it but it stays on the verification stage and never ends (it has been now more than 48h stuck trying to decrypt the data which is more than enough time). I can't encrypt the /data partition either, it reboots unencrypted as nothing has been done. Is this normal? Is there a way to recover the data on the SD card? I no longer want to do any experiments and increase the damage and any help would be appreciated!
Steps done so far:
1 - Put Samsung Galaxy J2 (2017) with enabled encryption (on both Phone and SD card) in Download mode
2 - Flash TWRP with ODIN and auto reboot disabled
3 - Reboot directly into recovery mode / TWRP - /data can't be mounted, expected since the Phone is encrypted
4 - Reboot normally, Phone is still encrypted but error "Integrity check failed" appears all tells the Phone is going to reboot to recover/restore
5 - Since the Phone keeps showing this integrity error all the time and is not able to boot normally I boot to recovery / TWRP again and format /data which can now be mounted since it has no encryption
6 - Phone boots again normally with settings/data gone (expected) but decrypting SD Card doesn't work (stuck in "decrypting SD card" for more then 48h) and Phone encryption does no longer work either (reboots unencrypted nothing is done)
I also tried installing no-verity-no-encrypt_ashyx.zip on TWRP but it didn't help. At this point I wish I could restore the old state even if it means no TWRP / rooting, the data on the SD card and having working encryption is more important. Sadly since I couldn't mount /data with TWRP at the beginning when it was still encrypted I couldn't make a backup
Thanks for any help, information or feedback. Maybe everything is working as expected and I should have kept my fingers away from TWRP!
PS: "Encryption" refers to the OS/Android encryption in Settings > Security

Related

[Q] Corrupted internal storage

ill keep this simple. tried to advanced wipe data and cache with TWRP which returned an E:/ unable to mount for both data and cache. internal storage is now saying its 0MB after i "fastboot erase" on as many of the partitions it would return success with (ie, what was mounted) flashall is asking me for a specific device.
How do i reset the internal partitions so they become mountable again? i believe in erasing the ones i had, it has deleted them altogether and i need to flash original firmware to get it to auto restructure (im guessing)
EDIT: so i downloaded this (link not allowed) i just dont know how to implement it through adb or fastboot
somewhere i read that the latest moto PQ versions for CWM and TWRP both have some selinux problem when wiping data, causing a force unmount (parroting. i DONT know what im talking about)
the first time i installed with CM11 with twrp (after CMW only allowing me to install 10.2) it worked great, except google play and whisperpush(whatever that is) crashing consistently. i should have used 'fix permissions' instead of going for a wipe+re-install
please help, what commands do i need to use through fastboot to restore the partitions, or where can i get the fxz file to use with RSD?
this is a brand new out of the box Sim-modded and pre-rooted PQ
SOLVED (i think)
god im so ****ing stupid.
due to corrupting the file structure and not being able to mount the cache or data partitions, when i installed CM11 snapshot it picked my external SD as the data storage /android/data/
FIX: unmounting and removing the external SD i rebooted to system, booted back to recovery. -> factory reset.... auto reboot, cant mount messages, then a second time it said SELinux supported message. ->factory reset again and finally no red messages, wipe to system (got an error, but probably cause system = external SD). i then inserted the external SD, installed the ROM and everything looks normal and working right
TWRP will restore file structure with 'factory reset' BUT ONLY IF you remove your external sd
i hope this thread saves time and headaches for someone.

To CM13 users. DO NOT USE ENCRYPTION. details and fix if you've already done inside

just fyi. cm13 has no option to decrypt once you've encrypted it, twrp cannot mount encrypted drives (atleast most of the time i've heard a few say it can that's why i tried it but 2.8.7.0 doesn't even ask for a password or try to decrypt in my case)
so pretty much once you encrypt your stuck with the rom you have unless you have this magical twrp that asks for decrypt password.
also to make things worse, twrp can't format and cm13 changes the sdcard path so although it sees the external sd it can't flash files from it (atleast on g3)
so the only way to fix is to boot into android, backup your internal storage to sdcard or computer
reboot into twrp run a manual format on /data/ from terminal command, then reboot, copy your twrp backup to internal sd, go back to recovery and flash backup, then copy internal sdcard files back to internal drive (from sd or computer backup)
the command to format is the following
mke2fs -T ext4 /dev/block/mmcblkXpXX (NOTE: REPLACE THE XpXX with the proper values for your device) you can find these values by asking in your device forums, or downloading a partition info app that will tell you and i'm sorry i can't remember the one i used, but this is the best way to be sure because even diff device variants sometimes have diff partition tables based on phone provider.
*edit* just for personal peace of mind i remind everyone that every device is diff and i cannot guarantee positive results but this 100% worked for me everything is back to normal.
I did this a few months back and ended up flashing factory images via adb and starting all over again which sucked
Very useful information. :good:
TWRP v3.0.0 can use the adopted storage device (encrypted SD card) now.
Seems it's been fixed because I am successfully using cm13 with twrp 3.0, albeit with visible performance loss.
I just want to say thanks a lot for this. I can once again mount my /data partition.

not booting after encryption attempt - stuck on cyanogen logo -- phone now restored

I have a phone that was rooted with the original rom (CyanogenOS but not cyanogenmod I think?) and had TWRP 2.8.5.1 installed. I initiated the encryption process and let it run. I returned to it after a couple of hours and found it displaying the cyanogen logo. I waited another 30 minutes before deciding it was stuck. I tried restarting the phone but it would get stuck on the cyanogen logo.
I then booted to recovery and was prompted for the decryption code, but the correct code was rejected. After researching here I concluded that the TWRP version was part of the problem so I flashed version 3.2.1-0
I was then able to boot to TWRP and decrypt the data partition and browse files. Unfortunately it still gets stuck at the cyanogen logo.
I also tried wiping the cache, and wiping and replacing the persist.img.
I'm not very experienced or skilled with these issues. I'm looking for a way to restore the phone to how it was before my encryption attempt; for now I'm abandoning the idea of encrypting the phone.
If it isn't in bad taste or obnoxious to ask this here, I'm willing to pay for help.
edit-0:
I was thinking of using TWRP to backup the decrypted data partition, wiping the encrypted version, then restoring the decrypted version.
It seems like this should restore the pre-encryption state, but am I missing something? Any downside to trying this?
edit-1: a follow-up
I was able to restore the phone by the method proposed above in edit-0
I made a backup with TWRP using a method similar to what's discussed in these threads:
https://forum.xda-developers.com/general/general/twrp-backup-including-internal-storage-t3660479
https://forum.xda-developers.com/android/general/tutorial-create-internal-storage-backup-t3389172
I followed roughly these steps:
1) temporarily rename the "media" folder to "mediabak" from the TWRP file manager
2) confirm size of the "data" partition has increased to expected value after renaming
3) plug in USB drive and mount
4) backup data partition to USB drive
5) make a backup copy of the USB drive to PC
5) wipe the data partition
6) restore the data partition using the backup on the usb drive
7) reboot to TWRP recovery (not a necessary step as far as I can tell)
8) note that at this point apparently TWRP automatically re-creates the "media" directory
9) delete the TWRP-generated "media" directory and rename the "mediabak" to "media"
10) reboot to TWRP recovery and browse restored files to see if things look right
11) reboot phone
Rebooting phone took longer than normal, as I think one would expect.
After lingering for a while the "cyanogen" logo animation disappeared and the message about android updating apps appeared
Phone seems to be working normally.
In retrospect my only exposure to actual data loss the database of Signal app messages. It seems like everything else I could have extracted from file based backups and also directly from the phone after I upgraded to TWRP 3.2.1-0

Recover soft brick w/o data loss - After failed dirty flash?

Hi All,
I'd urgently need confirmation and/or tipp from seasoned "brick recovery artists" ;-)
Key questions:
(a) In the scenario presented below, can I recovery from soft brick without loosing data (incl. encrypted external sdcard)?
(b) If no - is there a way to recover directly from a TWRP backup (to pre-encryption status)?
Thanks a million!
-----the issue------
To dirty flash to my S9+ rooted and encrypted device, I tried to perform a dirty flash. See CustomROM thread here.
How the issue unfolded:
1. downloaded the latest v7.4
2. moved v7.4 install file to external sd
3. booted into twrp and performed system partition backup (system image, system, recovery, boot)
4. initiated via twrp a dirty flash
4.1 received error messager after 1 second: damaged zip file
5. rebooted into sysem - WORKED
5.1 realized my SDcard was not mounted and the system tried to "encrypting sdcard 10%/11%/..."
5.2 shut down system immediately
6. repeated step 5 with same results
7. booted into twrp and tried to restore from backup (system image, system, recovery, boot)
7.1 received error message "extracttarfork() process ended with error=255"
8. rebooted into system and rebooted into twrp
9. performed full restore only "system image"
10. booted into system - same as before, in step 5; immediately shut down
11. tried to boot into twrp without success; bootloader 1 error message: "could not do normal boot. INVALID KERNEL LENGTH"
I am a bit screwed here, i think?
the funny thing is that
(a) a OS boot still required me to enter my encryption pin
(b) the OS itself had no sdcard access/mounting issues apparently, same for TWRP partially. HOWEVER, the TWRP system backup was stored on my external SD card - How was TWRP even able to perform a restore from it, if it could not read /data and the sdcard in the first place?
solved. Please close

Question Orange Fox Decrypting Data

Today I unlocked my bootloader and installed orange fox recovery, I tried to install TWRP but it wasn't being permanent, it was just disappearing after once I boot the device to system. Whatever, after I installed Orange Fox, it was permanent but I faced another problem, I couldn't mount my data, my internal storage couldn't be selected so I wasn't able to flash anything, usb otg option was also showing nothing but the device was connected to a PC and my data was encrypted which requires a password or pin to decrypt. Though I didn't have any screen lock, but I tried out many pins and passwords to decrypt, but it all went in vein. I tried formatting data and enabling a screen lock and tried that screen lock too but it didn't work out.
Now what can I do to Decrypt and mount my data so that my internal storage shows up with the data I have?
NB: My battery backup also dropped hugely for some unknown reasons, how do I fix that too?
namir.muztahid said:
Today I unlocked my bootloader and installed orange fox recovery, I tried to install TWRP but it wasn't being permanent, it was just disappearing after once I boot the device to system. Whatever, after I installed Orange Fox, it was permanent but I faced another problem, I couldn't mount my data, my internal storage couldn't be selected so I wasn't able to flash anything, usb otg option was also showing nothing but the device was connected to a PC and my data was encrypted which requires a password or pin to decrypt. Though I didn't have any screen lock, but I tried out many pins and passwords to decrypt, but it all went in vein. I tried formatting data and enabling a screen lock and tried that screen lock too but it didn't work out.
Now what can I do to Decrypt and mount my data so that my internal storage shows up with the data I have?
NB: My battery backup also dropped hugely for some unknown reasons, how do I fix that too?
Click to expand...
Click to collapse
Custom recoveries like TWRP and OrangeFox cannot decrypt Android 12 ROMs, which means if you are on MIUI 13 you have Android 12, you cannot decrypt internal storage yet.
USB OTG means to connect to an external hard drive or flash drive, not connect to PC.
2 ways to deal with: 1) put ROM in microSD card and put the microSD card into the phone, TWRP and OrangeFox should be able to read microSD cards. 2) use ADB sideload in TWRP/OrangeFox to flash ROMs/Zips files. You need PC to do this. Look up on Google how to flash with ADB sideload.
Hi Guys! I Found a new Method how to Decrypt the Storage.
1. Go to Wipe and wipe the Internal Storage (First make a Backup to Your PC)
2. Go to Backup and Backup Something, like Cache
3. Go to Menu>Mount, uncheck the Data and Check it.
4. Format the Data with Typing yes and Reboot
4. You're done and Enjoy!
TRWP beta can decrypt internal storage of A12.1, I am using it and it works fine.
OrangeFox beta builds are able to decrypt a12 data no probs. Even unoffical twrp beta can.

Categories

Resources