Is my OP 7Pro permanently broken? - OnePlus 7 Pro Questions & Answers

I have an OP 7Pro (GM1917) that was working fine for a long time with OOS 10.3.8.
I hadn't done an upgrade for a long time, and so recently, I did an upgrade to OOS 11.0.5.1.GM21AA. After doing that, my device is unusable, and I fear that there might be something broken or damaged that causes firmware or storage to no longer function properly. All of the explanatory details follow, and please read all of that. What I'm wondering is whether the device is now permanently hosed, or perhaps if there is some way for me to fix it. Here are all of the details:
After the upgrade, my device went into a permanent boot loop when trying to boot to System.
I then did fastboot boot twrp-3.6.0_11-0-guacamole.img, and it indeed put me into TWRP. However, the /data partition is inaccessible. Whenever I try to format /data, I consistently get these messages:
Code:
Failed to mount /data (Invalid argument)
Unable to recreate /data/media folder.
Unable to mount storage
Unable to mount /data/media/TWRP/.twrps
Unable to wipe data
I go back to the bootloader and connect to my PC, and I then run these commands:
Code:
fastboot erase userdata
fastboot format:ext4 userdata
These commands successfully run with no error messages. I then go back into TWRP, but /data is still inaccessible, and I get the same error messages that I listed above when trying to format /data .
I then tried to decrypt /data, but when I do so, it asks for a password, and I have no idea what password to give. I never used any password on the device in the past. I am not allowed to decrypt /data without a password.
So, I decided to use the MsmDownloadTool to reflash my device back to OOS 10.3.8. This works fine with a different GM1917 device that I have (but which I never tried flashing to OOS 11). However, with this particular device, after going into EDL mode, I am told that I am "Connected", but a couple seconds later it gives me the "Sahara Connection Failed" message. I have double-, triple-, and quadruple-checked the device drivers, and it indeed is showing that the "Qualcomm qds 9008" driver is properly installed and active. Furthermore, as I mentioned, I have no problem using MsmDownloadTool on that PC with another GM1917 device.
I went further: I extracted payload.bin from the OOS 11.0.5.1.GM21AA installation bundle, and I extracted all of the *.img files. I flashed boot.img via fastboot and retried everything that I mentioned above, but nothing has changed.
I then went and flashed all of the *.img files. However, still nothing has changed.
When reflashing the set of all *.img files, in some cases, I was told that the file is critical and cannot be reflashed. I then ran these two commands ...
Code:
fastboot flashing unlock
fastboot flashing unlock_critical
... but in both cases, I was told that the device is already unlocked. Trying to reflash all of the *.img files again gave me the same results: i.e., some got flashed, and others were not flashed due to being "Critical".
Also, some of the items I flashed were said to be "sparse" and their flashes were flagged with warnings, but as far as I can tell, they seem to have been flashed anyway.
Do these problems with /data and EDL and everything else mean that my device is somehow permanently damaged? Or are there perhaps one or more additional things that I can try in order to restore it to some sort of working state?
Thank you in advance for any thoughts or ideas.

This has been fixed.
I had forgotten that in the past, I was trying the OrangeFox dual-boot recovery on this device, and it had repartitioned /data.
I fixed this by booting into OrangeFox recovery via fastboot, and then using its adb sideload facility to flash that recovery. OrangeFox's adb sideload mechanism offers options to the user for repartitioning and rebuilding /data. I utilized those options and set /data back to "Stock", and after that, /data was accessible again.
At this point, I flashed OOS 10.3.8, and then flashed the appropriate TWRP and Magisk, now, my device is back up and running in that OOS version.
The EDL problem continues, but given that my device is now usable again, I am not overly concerned about this MsmDownloadTool issue at the moment. In my spare time, I'll continue to look into that.
All's well that ends well!

I think I also have the same issue but the good thing with mine is my device is still working..but every time I access storage via twrp it give me a 0mb or in accessible data no matter if I enter my password to decrypt data. Until now I just leave it as is for I haven't found any solution

I have the same issue but I can't boot at all. I'm only limited to twrp and fastboot. I was previously running 11.0.3 with Magisk and a Magisk module called xXx_nolimit, downloaded the OTA update and went to reboot to recovery before being prompted for a pattern passcode (I hadn't set any fingerprint or password) so I rebooted into twrp and clicked fix bootloader. Now as I reboot it just boots back into twrp.
I'm also getting these same messages:
Failed to mount /data (Invalid argument)
Unable to recreate /data/media folder.
Unable to mount storage
Unable to mount /data/media/TWRP/.twrps
I'm currently running apbf to bruteforce the pattern passcode that I never set in hopes to decrypt my phone. Not even sure it will work though as I don't have FBE user 0 mounted? I have my dad's phone which basically has the exact setup as mine but I didn't update it yet. Anyway to use partition or parts data from his phone to fix mine? I really don't want to wipe my /data or /userdata as it's been a while since I backed anything up.
Edit:
All I have in my /data folder is:
/data/india
/data/recovery
/data/reserve

The edl issue happended to me too and I just needed to use another msmdownloadtool version.

Related

[SOLVED] Decryption Unsuccessful and a currently bricked M8

I previously ran LolliGPE but was long overdue for an update. I downloaded the latest version and copied the image to my phone and flashed the ROM. I decided to go try a dirty install first to see if I could keep everything I had, since I had already been running a previous version and after reviewing the changelog did not see anything recommending to wipe clean. After installing successfully, Android asked me to enter my password to decrypt my data (I don't recall ever encrypting my data?), and so I did. It then told me that my password was right, but the data was corrupt, and presented me a button to reset my phone. The button redirected me to recovery and automatically attempted to wipe /data and then re-mount it, but the wipe failed. I rebooted again with the same issue, same failed attempt to wipe. I went to install the zip again, and this time do a full wipe, but it was unable to mount my phone's storage nor my SD card. I am not able to mount either at all now.
What's the best course of action? I'd like to retain as much as I can and avoid wiping all of the internal storage clean. Is there a simpler fix to this or am I doomed?
HBOOT: 3.19.0.0000
RADIO: 1.09.20.0926
OS: 3.28.605.4
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
To fix the partitions and get Android back up and running, you need to install the latest firmware, format your data in TWRP, factory reset, and then flash a ROM again. Here's what I did to do that, without an SD card. If you have an SD card, simply copy your ROM zip to the SD card and skip the final steps:
Make sure you have the latest version of TWRP and ADB, and download the latest copy of the firmware (check the development forum here).
Boot the phone (doesn't matter to what) and run adb reboot bootloader. When your phone reboots, double-check by running fastboot reboot-bootloader.
Put your phone in RUU mode with fastboot oem rebootRUU. The phone will restart and the HTC logo will come up.
Wait a couple seconds, then run fastboot flash zip firmware.zip, where firmware.zip is the firmware you want to flash.
The first time you do this, it will fail saying something like "FAILED (remote: 90 hboot pre-update! please flush image again immediately)". Ignore this, run the last command again: fastboot flash zip firmware.zip
The progress bar will appear and begin filling. Wait until fastboot is finished flashig it (the progress bar may not fill completely), wait an extra 5 seconds or so, and then do fastboot reboot.
The phone will reboot. Android will still be messed up, but you can verify the partitions are in working order by checking adb shell cat /proc/emmc.
Once you know the partitions are working, get back into TWRP/recovery: adb reboot recovery
Format /data and wipe /cache, /data, dalvik/art cache, etc (factory reset). You will lose the contents of your internal storage and everything else.
If you don't have the ROM zip on an sd card, make sure the zip is in the same directory as adb and run adb push rom.zip /sdcard/rom.zip, where rom.zip is the ROM. You can also copy it to the external sd by swapping /sdcard/rom.zip with /external_storage/rom.zip.
Once copied, reboot into recovery and flash the zip. Back to normal!
Update:
It's a firmware problem. Apparently there was a new firmware update that the ROM uses that I don't have. mmcblk0p42 was changed to "vzw_logger" (which I don't have), making mmcblk0p49 userdata instead of previously mmcblk0p48. The data partition it expects to be /data is /cache. Got this information by comparing 'cat /proc/emmc' with information of the latest version I found here.
Is there a way to fix this that allows me to preserve the contents of my internal storage (/sdcard)? Can I just flash an older version of the ROM to backup my data?
Klayderpus said:
Update:
It's a firmware problem. Apparently there was a new firmware update that the ROM uses that I don't have. mmcblk0p42 was changed to "vzw_logger" (which I don't have), making mmcblk0p49 userdata instead of previously mmcblk0p48. The data partition it expects to be /data is /cache. Got this information by comparing 'cat /proc/emmc' with information of the latest version I found here.
Is there a way to fix this that allows me to preserve the contents of my internal storage (/sdcard)? Can I just flash an older version of the ROM to backup my data?
Click to expand...
Click to collapse
I posted a warning about this change in the general section early on. For you to have the partition changes means you are on the newer firmware which doesn't match what you posted above for os. You very likely at this point have nothing left to salvage. Are you on the latest twrp?
dottat said:
I posted a warning about this change in the general section early on. For you to have the partition changes means you are on the newer firmware which doesn't match what you posted above for os. You very likely at this point have nothing left to salvage. Are you on the latest twrp?
Click to expand...
Click to collapse
I am on the latest TWRP, yes. Since this post, I've actually been making good progress in getting the data partition back, or so I think. I've been using dd to copy /dev/block/mntblk0p48 to an image file, but got stuck when I reached the FAT32 limit, so I re-formatted my SD card, except now it's read-only.
Klayderpus said:
I am on the latest TWRP, yes. Since this post, I've actually been making good progress in getting the data partition back, or so I think. I've been using dd to copy /dev/block/mntblk0p48 to an image file, but got stuck when I reached the FAT32 limit, so I re-formatted my SD card, except now it's read-only.
Click to expand...
Click to collapse
If you Dd the entire data partition it's gonna be almost 25 gigs. If you can't mount data in twrp and find anything usable when browsing via adb in twrp there's probably not anything usable in there.
dottat said:
If you Dd the entire data partition it's gonna be almost 25 gigs. If you can't mount data in twrp and find anything usable when browsing via adb in twrp there's probably not anything usable in there.
Click to expand...
Click to collapse
I did a DD before while in ADB and it only got to about 1.3 gigs, but after running the image through e2fsck I actually found some images and downloads. I think there's usable stuff in there and I'd like to at least try to get it. There's family pictures and stuff on there that have some value to me. My SD card is 32 gigs so I could probably do it if anything for the hell of it.
Do you happen to know how I can get the SD card mounted? mount -o rw,remount /dev/block/mmcblk1p1 [some dir] is what I've been trying, but I've been getting either Read only filesystem or Invalid argument.
I might be a little crazy
Klayderpus said:
I did a DD before while in ADB and it only got to about 1.3 gigs, but after running the image through e2fsck I actually found some images and downloads. I think there's usable stuff in there and I'd like to at least try to get it. There's family pictures and stuff on there that have some value to me. My SD card is 32 gigs so I could probably do it if anything for the hell of it.
Do you happen to know how I can get the SD card mounted? mount -o rw,remount /dev/block/mmcblk1p1 [some dir] is what I've been trying, but I've been getting either Read only filesystem or Invalid argument.
I might be a little crazy
Click to expand...
Click to collapse
Its already mounted.. Just boot into TWRP while connected to your PC. Open cmd prompt in your adb directory.
adb shell
cd sdcard
ls
See if your internal SD card contents are listed.
dottat said:
Its already mounted.. Just boot into TWRP while connected to your PC. Open cmd prompt in your adb directory.
adb shell
cd sdcard
ls
See if your internal SD card contents are listed.
Click to expand...
Click to collapse
TWRP lists the internal SD card as being size 0 under Mount -> Select Storage and /sdcard is empty. I re-formatted my external SD card to make a full size image but that's what wasn't mounting.
Klayderpus said:
TWRP lists the internal SD card as being size 0 under Mount -> Select Storage and /sdcard is empty. I re-formatted my external SD card to make a full size image but that's what wasn't mounting.
Click to expand...
Click to collapse
Did you try the repair option for /data listed under wipe in TWRP?
dottat said:
Did you try the repair option for /data listed under wipe in TWRP?
Click to expand...
Click to collapse
Doesn't work. There's a couple of messages about not being able to mount /data and then:
Code:
Repairing Data using e2fsck...
E:Unable to repair '/data'.
E:Error repairing file system.
Klayderpus said:
Doesn't work. There's a couple of messages about not being able to mount /data and then:
Code:
Repairing Data using e2fsck...
E:Unable to repair '/data'.
E:Error repairing file system.
Click to expand...
Click to collapse
try this
adb shell
mount -t ext4 /dev/block/mmcblk0p49 /userdata
df
show me the output of df...
and if to be sure of which firmware you are on.. reboot recovery... and do the following....
adb shell
mount -t ext4 /dev/block/mmcblk0p48 /userdata
df
and show me that DF
I got all of my data back successfully. I'm updating the OP with the steps I did to get it back.
What's the next step? Change firmware? I have a local copy of what I needed from the phone, so anything's game now.
edit: /dev/block/mmcblk0p48 for me is userdata, 49 does not exist. Both mounts fail.
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 933044 24 933020 0% /dev
tmpfs 933044 20 933024 0% /tmp
/dev/block/mmcblk0p47 1030828 16464 1014364 2% /cache
/dev/block/mmcblk1p1 30647232 12 29090436 0% /external_sd
/dev/block/mmcblk1p1 30647232 12 29090436 0% /and-sec
Klayderpus said:
I got all of my data back successfully. I'm updating the OP with the steps I did to get it back.
What's the next step? Change firmware? I have a local copy of what I needed from the phone, so anything's game now.
edit: /dev/block/mmcblk0p48 for me is userdata, 49 does not exist. Both mounts fail.
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 933044 24 933020 0% /dev
tmpfs 933044 20 933024 0% /tmp
/dev/block/mmcblk0p47 1030828 16464 1014364 2% /cache
/dev/block/mmcblk1p1 30647232 12 29090436 0% /external_sd
/dev/block/mmcblk1p1 30647232 12 29090436 0% /and-sec
Click to expand...
Click to collapse
I would say update firmware. Since you confirmed blk48 as user data I know you don't have lollipop firmware.
I posted a firmware zip that contains the newest twrp which is compatible with lollipop in tigerstowns firmware thread. You can use that to update.
Then wipe and reinstall whatever Rom you want to use.
I fixed it this morning by updating firmware and will update the OP with the rest of the steps for the Googlers. Thanks again.
Klayderpus said:
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
[/LIST]
Click to expand...
Click to collapse
I have a laptop running Ubuntu: where do I run the "ls -al /dev/block..." command? As in what folder do I need to be in? The phone only appears in an mtp capacity...
EDIT: I figured that out but now I am stuck at "adb pull /dev/block/<ID> ./data". My ID was mmcblk0p28 but the command returns "Bash: mmcblk0p28: no such file or directory exists"
EDIT 2: Got that command to work but the file is too large to write (My disk is FAT32 ). So I then tried the mount command but again got "no such file or directory exists".
Same Issue "Decryption Unsuccessful"
I was trying to apply the OTA update for 5.1 on my M8 converted to GPE 5.01, but had to update to the stock recovery, and found myself in the same situation with the "Decryption Unsuccessful" message.
Following Klayderpus' steps to recover, but I'm running into a few issues:
1) Windows not Ubuntu so some (many) of the commands do not apply.
2) The device is not responding to adb, although it was prior to the "upgrade". Fastboot is working.
3) TWRP was not on the device, in fact I never could get to the recovery after trying to install the stock recovery when I converted to GPE 5.01 many months ago
I have a fresh nandroid backup, so I am just trying to get the device running. Being without the phone is causing me great pain....
I upgraded the firmware to 4.16 and did the factory reset from the stock 4.16 recovery. The phone boots back to the "Decryption Unsuccessful" message.
I am not sure, but I think the next step for me to try is to install the GPE ROM from graffixnyc from the microSD card (need to find/buy that little SD adaptor)
Any help would be greatly appreciated!!
========================
Update;
Recovery does not see the SD card , so I won't be able to install from there.
I'll try flashing TWRP recover to see if that will show the contents of the external card
========================
Update 2:
TWRP does see the external card, but the install failed as it is unable to mount /data and /storage.
I'm out of ideas....HELP!!
========================
Update 3
I noticed the "factory reset" in HBOOT and thought I'd try that instead of the "Wipe" in TWRP, but only made things worse.
Now the phone comes up to the "Decryption Unsuccessful" where I can then take the reset to get it into TWRP recover
TWRP comes up directly into a screen where it's "Running OpenRecovery Script" and then reboots.
I'm going to quit now, as I am only making matters worse.....
========================
Update 4
I got TWRP to quit whatever it was doing.
Now, In TWRP > Wipe > Advanced Wipe, I cannot wipe or repair the Data partition. I see a message "Could not mount /data unable to find crypto footer". Trying to wipe the Davlik Cache fails, "Unable to mount /data, " Unable to mount storage".
========================
version-bootloader: 3.19.0.0000
version-baseband: 1.25.214500021.06G
version-main: 4.16.401.10
modelid: 0P6B12000
cidnum: 11111111
========================
I've bricked the phone and it looks permanent.
I found another thread where everyone was solving this issue running this command "mke2fs -T ext4 /dev/block/mmcblk0p8" in TWRP. I failed to notice that it was not an M8 device thread. The phone won't boot at all, and windows sees it as a usb drive.
Haste makes waste
Do you still have fastboot?
Check out the RUU collection here and grab what apllies to your device:
http://forum.xda-developers.com/ver...zw-m8-master-ruu-firmware-collection-t2946473
Make sure you use the HTC fastboot.exe from post 3
highplains914drifter said:
I was trying to apply the OTA update for 5.1 on my M8 converted to GPE 5.01, but had to update to the stock recovery, and found myself in the same situation with the "Decryption Unsuccessful" message.
Following Klayderpus' steps to recover, but I'm running into a few issues:
1) Windows not Ubuntu so some (many) of the commands do not apply.
2) The device is not responding to adb, although it was prior to the "upgrade". Fastboot is working.
3) TWRP was not on the device, in fact I never could get to the recovery after trying to install the stock recovery when I converted to GPE 5.01 many months ago
I have a fresh nandroid backup, so I am just trying to get the device running. Being without the phone is causing me great pain....
I upgraded the firmware to 4.16 and did the factory reset from the stock 4.16 recovery. The phone boots back to the "Decryption Unsuccessful" message.
I am not sure, but I think the next step for me to try is to install the GPE ROM from graffixnyc from the microSD card (need to find/buy that little SD adaptor)
Any help would be greatly appreciated!!
========================
Update;
Recovery does not see the SD card , so I won't be able to install from there.
I'll try flashing TWRP recover to see if that will show the contents of the external card
========================
Update 2:
TWRP does see the external card, but the install failed as it is unable to mount /data and /storage.
I'm out of ideas....HELP!!
========================
Update 3
I noticed the "factory reset" in HBOOT and thought I'd try that instead of the "Wipe" in TWRP, but only made things worse.
Now the phone comes up to the "Decryption Unsuccessful" where I can then take the reset to get it into TWRP recover
TWRP comes up directly into a screen where it's "Running OpenRecovery Script" and then reboots.
I'm going to quit now, as I am only making matters worse.....
========================
Update 4
I got TWRP to quit whatever it was doing.
Now, In TWRP > Wipe > Advanced Wipe, I cannot wipe or repair the Data partition. I see a message "Could not mount /data unable to find crypto footer". Trying to wipe the Davlik Cache fails, "Unable to mount /data, " Unable to mount storage".
========================
version-bootloader: 3.19.0.0000
version-baseband: 1.25.214500021.06G
version-main: 4.16.401.10
modelid: 0P6B12000
cidnum: 11111111
========================
I've bricked the phone and it looks permanent.
I found another thread where everyone was solving this issue running this command "mke2fs -T ext4 /dev/block/mmcblk0p8" in TWRP. I failed to notice that it was not an M8 device thread. The phone won't boot at all, and windows sees it as a usb drive.
Haste makes waste
Click to expand...
Click to collapse
If you have fastboot do the following commands
Fastboot oem task 28
Fastboot oem task 29
Then try to flash your rom or ruu.
dottat said:
If you have fastboot do the following commands
Fastboot oem task 28
Fastboot oem task 29
Then try to flash your rom or ruu.
Click to expand...
Click to collapse
No Fastboot, nothing. Device was charged, but now acts as if the battery is dead. the Power button does nothing even after a long press.
Bad day...
Klayderpus said:
I previously ran LolliGPE but was long overdue for an update. I downloaded the latest version and copied the image to my phone and flashed the ROM. I decided to go try a dirty install first to see if I could keep everything I had, since I had already been running a previous version and after reviewing the changelog did not see anything recommending to wipe clean. After installing successfully, Android asked me to enter my password to decrypt my data (I don't recall ever encrypting my data?), and so I did. It then told me that my password was right, but the data was corrupt, and presented me a button to reset my phone. The button redirected me to recovery and automatically attempted to wipe /data and then re-mount it, but the wipe failed. I rebooted again with the same issue, same failed attempt to wipe. I went to install the zip again, and this time do a full wipe, but it was unable to mount my phone's storage nor my SD card. I am not able to mount either at all now.
What's the best course of action? I'd like to retain as much as I can and avoid wiping all of the internal storage clean. Is there a simpler fix to this or am I doomed?
HBOOT: 3.19.0.0000
RADIO: 1.09.20.0926
OS: 3.28.605.4
EDIT: For anyone else having a problem like this that at least wants to get their data back, here's what you should do (I assume you know how to work with Linux!):
Make sure you have the latest version of TWRP and ADB.
Boot the phone into recovery mode and connect the phone to your computer via USB
Run "ls -al /dev/block/platform/msm_sdcc.1/by-name" and check the output. Make a note of the partition marked "userdata" - for me, it was /dev/block/mmcblk0p48.
Either: simply use adb pull to copy this file to your computer (this will require about 26 gigs of space), or attempt to mount the file. To use adb pull, execute "adb pull /dev/block/<ID> ./data" (ID being what you marked down). Your data partition will be copied to /data. To mount, use "mount -t ext4 /dev/block/<ID> /userdata". Whatever's left of your data will be on your phone's new /userdata folder.
Use ADB to pull what files you want from /userdata. If you pulled the partition, skip this step.
If you copied the files you wanted over, you're done. If you pulled the entire partition, you're going to want to try and mount it. On Windows, there are various tools to mount Linux partitions, a quick Google will find some good ones. However, if the data is corrupt, it will not work. I recommend attempting to repair the partition on linux, with the command "e2fsck -f -y /path/to/data", replacing the path to your data file as necessary. Once done, run "mount -t ext4 /path/to/data /mnt/data", replacing the paths as necessary.
Once mounted, you can access your data wherever it was mounted. If e2fsck appeared to fix many errors, chances are most of your data will be in the lost+found folder, and you'll need to sort through this yourself. If you're lucky, then your data will be intact and readily usable. Internal SD card data is located at ./media/0.
To fix the partitions and get Android back up and running, you need to install the latest firmware, format your data in TWRP, factory reset, and then flash a ROM again. Here's what I did to do that, without an SD card. If you have an SD card, simply copy your ROM zip to the SD card and skip the final steps:
Make sure you have the latest version of TWRP and ADB, and download the latest copy of the firmware (check the development forum here).
Boot the phone (doesn't matter to what) and run adb reboot bootloader. When your phone reboots, double-check by running fastboot reboot-bootloader.
Put your phone in RUU mode with fastboot oem rebootRUU. The phone will restart and the HTC logo will come up.
Wait a couple seconds, then run fastboot flash zip firmware.zip, where firmware.zip is the firmware you want to flash.
The first time you do this, it will fail saying something like "FAILED (remote: 90 hboot pre-update! please flush image again immediately)". Ignore this, run the last command again: fastboot flash zip firmware.zip
The progress bar will appear and begin filling. Wait until fastboot is finished flashig it (the progress bar may not fill completely), wait an extra 5 seconds or so, and then do fastboot reboot.
The phone will reboot. Android will still be messed up, but you can verify the partitions are in working order by checking adb shell cat /proc/emmc.
Once you know the partitions are working, get back into TWRP/recovery: adb reboot recovery
Format /data and wipe /cache, /data, dalvik/art cache, etc (factory reset). You will lose the contents of your internal storage and everything else.
If you don't have the ROM zip on an sd card, make sure the zip is in the same directory as adb and run adb push rom.zip /sdcard/rom.zip, where rom.zip is the ROM. You can also copy it to the external sd by swapping /sdcard/rom.zip with /external_storage/rom.zip.
Once copied, reboot into recovery and flash the zip. Back to normal!
Click to expand...
Click to collapse
Hey
I have a HTC one m7 verizon & same problem storage decryption failed. See my case here in below post. And please tell me if anything possible. Please......
http://forum.xda-developers.com/verizon-htc-one/help/storage-encryped-htc-one-m7-vzw-s-t3279869

Crashing issue

Girlfriends Nexus 5 was started crashing whenever /data is accessed, from what I can perceive. I tried going into TWRP and wiping for a clean install of Pure Nexus, but it says unable to access /data folders and unable to mount /system and /persist. TWRP will say wipe success at top, but the phone will restart into android just fine. If I try to access Apps under settings it crashes, as well as other actions that seem to access /data. I can view /data files in TWRP file manager, though.
Currently attempting the restore nexus tool, but I'm open to any suggestions as to fix it.
Try flashing a stock rom manually in fastboot. Flash userdata.img last. After flashing userdata, immediately boot into stock recovery, perform a full wipe, and reboot.
The computer doesn't acknowledge the phone is connected in Fastboot mode, I'm wondering if it's because of Win10, going to try it on the Win7 desktop and see what happens.
Was able to fix it on the Win7 computer, problem solved!

0 mb in TWRP internal storage

I searched for an answer and noticed it's a common issue. I am trying to flash a kernel on to my already flashed rom. I was wondering if there is a more current fix. More importantly, how can this be avoided in the future. Thank you guys!
Its caused by a bug/error with either the filesystem or encryption.
Did you wipe data after flashing the new ROM? Data from stock usually doesn't work with custom ROMs.
Do you have a PIN/password on Android?
Are you using the latest build of TWRP?
Press the menu button at the bottom of the screen in TWRP and post what the error message is in the red text.
It's caused by no root access
djhulk2 said:
It's caused by no root access
Click to expand...
Click to collapse
Something is probably wrong with the data partition. TWRP should always have root access.
Try in TWRP:
Wipe > Format Data > Slide to format
This will erase the data partition, so backup everything to a PC in Android first if needed. It should allow TWRP to mount /data again.
KemikalElite said:
Something is probably wrong with the data partition. TWRP should always have root access.
Try in TWRP:
Wipe > Format Data > Slide to format
This will erase the data partition, so backup everything to a PC in Android first if needed. It should allow TWRP to mount /data again.
Click to expand...
Click to collapse
I've debated on doing this. I'm not worried about losing pictures texts etc as they're backed up.
I read that it essentially leaves the device with no OS. If that's wrong please let me know!
I have found that if I choose Slot A and reboot system it reboots me in to TWRP. If I choose Slot B it runs the OS like normal (except I still have issues using Facebook and it's services).
The ROM works and I can perform all the custom mods on it. I just want to flash a kernel and the problem persists. 0 mb in storage.
It's trial and error at this point. Fail fast fail forward. I have another phone I can use but I love the OnePlus. Any help will be appreciated!
https://andi34.github.io/faq/faq_twrp.html
I'm not willing to risk it until I know how to get the custom ROM on to the storage to flash it.
Yes formating by typing in yes will wipe it all,everything including pictures, with no rom on it at all. If u choose to do that, don't close twrp. Instead you should be able mount after wards, once mounted transfer the magisk zip, twrp, and your custom rom(has to be 1.5gb not 200mb through magisk). Flash magesik, install ram disk twrp, install rom. That was a method I've done before but if u want to keep everything there is other way
fastboot boot twrp.img, that command boots twrp if u have it or don't, installing to ram disk makes it permant...this boot command is just a one time thing each time. It's what I do when new firmware update, I loose root but I regain it each time
Never heard of formating data removing the OS, that would be if you wipe the system and normal wipe is like a factory data reset and therefore will not wipe your phone of the OS
djhulk2 said:
Yes formating by typing in yes will wipe it all,everything including pictures, with no rom on it at all. If u choose to do that, don't close twrp. Instead you should be able mount after wards, once mounted transfer the magisk zip, twrp, and your custom rom(has to be 1.5gb not 200mb through magisk). Flash magesik, install ram disk twrp, install rom. That was a method I've done before but if u want to keep everything there is other way
fastboot boot twrp.img, that command boots twrp if u have it or don't, installing to ram disk makes it permant...this boot command is just a one time thing each time. It's what I do when new firmware update, I loose root but I regain it each time
Click to expand...
Click to collapse
I attempted to format. It said
"failed to mount /data (device or resource busy)
"unable to mount storage"
Try this in recovery, sometimes its known to work.
Wipe > Advanced Wipe > Check Data and press Repair or Change File System > Change File System > Change it to EXT2.
Repeat the same process selecting Ext4
Wipe > Advanced Wipe > Check Data and press Repair or Change File System > Change File System > Change it to back to EXT4.
Try formatting data after this.
drey4211 said:
I attempted to format. It said
"failed to mount /data (device or resource busy)
"unable to mount storage"
Click to expand...
Click to collapse
Since you dont care about the data on the phone I would just do 1 of 2 things. 1st I would reflash twrp on to you phone if that doesn't work then I would just grab the fastboot ROM and just flash your phone back to full stock reroot and install twrp from scratch. I would not try to start repairing partitions. I wouldn't want to worry about screwing up the EFS partition
Well in an update, I formatted the
Storage and now I'm stuck in bootloader screen. It's unlocked but I'm having a hard time flashing a ROM through adb.
I use the twrp version 3.3.1-2
Best would be to just use fast command to boot it
But it should be under wipe/format data/then type in yes
That was what I was trying to have you avoid. If your can boot to fastboot download the fastboot ROM I told you to and run the flash-all.bat file. If your on 9.5.8 make sure you use the fastboot ROM of the same version. Do not flash azip of a different version firmware like 9.5.7.
It happens to me any time I'm in twrp and flash a rom then reflash twrp. It doesn't matter if I flash Magisk or not the issue always happens. What I do is use a USB C flash drive and plug it in when I want to flash/backup a rom. This way I can always access it. After flashing any rom then booting I'm always able to access my internal storage again. It seems like a bug in twrp.
The strange part is when this bug happens your files are encrypted in a 0 folder but you can still copy from your PC to your internal storage while in twrp.
I essentially soft bricked my device. Called OnePlus and they got me up and running. That's awesome that they have that service!
Are you removing all security? Pattern, pin and fingerprints? Are you decrypted? Never had an issue with flashing a ROM causing these issues which is why I'm asking. Something you've done at some point is causing this
I'm not sure what that was. Ironically enough I am now stuck in TWRP boot loop. Hopefully I can figure this out otherwise I have to call oneplus again.
I will admit I may not know everything but it's trial and error. I don't have anyone to really teach me this so I try to read the forums and learn. You guys have been great!
ajsmsg78 said:
It happens to me any time I'm in twrp and flash a rom then reflash twrp. It doesn't matter if I flash Magisk or not the issue always happens. What I do is use a USB C flash drive and plug it in when I want to flash/backup a rom. This way I can always access it. After flashing any rom then booting I'm always able to access my internal storage again. It seems like a bug in twrp.
The strange part is when this bug happens your files are encrypted in a 0 folder but you can still copy from your PC to your internal storage while in twrp.
Click to expand...
Click to collapse
I've the same issue.. did you find a fix? So annoying

How to decrypt /sdcard from ADB?

Long story short, I screwed up, and now I have an encrypted storage (with my files that I want back) but TWRP and the OS thinks it is not.
It goes like this:
The Magisk v22.0 update screwed up my phone, which stuck in a bootloop.
After countless tries with Magisk (updating, uninstalling. installing, removing mods, adding mods) in TWRP, I read somewhere to dirty flash the ROM.
Due to an HDD failure in my PC, I did not have any storage to back up my internal storage from the phone.
Because I wanted to update the ROM anyways (from MIUI 11 to 12) I decided to flash the newer one. That was the first mistake.
This made the bootloop worse, and now it stuck in fastboot mode, no recovery. After many sleepless nights I found out that not every USB-C cable is equal, and I couldn't reach my phone via fastboot because of the cable itself. Tried it with the original cable, it sure showed up as a fastboot device.
So now I was able to flash an original fastboot ROM which still gave me bootloop, so I went wiping (not formatting, so the /sdcard fs doesn't gets erased) Data and Cache in TWRP.
Then reflashed the fastboot ROM, and somehow it worked. When It booted up, I had to type in my screen lock pin again, and after setup all my files were available.
Now that the phone worked again, I wanted to finish what I started, to update to latest EU (recovery) ROM. This was the second mistake. It did not work (because it required formatting data, which I did not wanted to, and just wiped it), and came bootloop again.
So I went back to the fastboot ROM again, which fixed the phone again.
But this time, it thought the internal storage was not encrypted, so it encrypted it again.
Now I can't access the internal storage. Even the camera app says that first I need an SD Card to take photos.
Its clearly still encrypted because when I browse it in TWRP, the structure and files are there, but the names are like "74t7Z1,dnvgIIexr1QAfhD".
The problem being neither the OS, nor TWRP knows the storage is encrypted double, so it doesn't even tries to decrypt it, and there are no options to do it.
Tried to set encryption in the running OS, but it gave me the same results: even tho TWRP asks for decryption key, and says it successfully decrypted, the storage is still a mess like its in encrypted state.
Is there any way to manually force some flag, so I can access my files again? I have the encryption key, I just need some way to decrypt the storage. I think of something like an ADB command to flag the partition as encrypted, so TWRP and OS would try to decrypt it.
Thanks in advance!
insetta said:
Long story short, I screwed up, and now I have an encrypted storage (with my files that I want back) but TWRP and the OS thinks it is not.
It goes like this:
The Magisk v22.0 update screwed up my phone, which stuck in a bootloop.
After countless tries with Magisk (updating, uninstalling. installing, removing mods, adding mods) in TWRP, I read somewhere to dirty flash the ROM.
Due to an HDD failure in my PC, I did not have any storage to back up my internal storage from the phone.
Because I wanted to update the ROM anyways (from MIUI 11 to 12) I decided to flash the newer one. That was the first mistake. This made the bootloop worse, and now it stuck in fastboot mode, no recovery. After many sleepless nights I found out that not every USB-C cable is equal, and I couldn't reach my phone via fastboot because of the cable itself.
Due to an HDD failure in my PC, I did not have any storage to back up my internal storage from the phone.
So now I was able to flash an original fastboot ROM which still gave me bootloop, but after wiping (not formatting, so the /sdcard fs doesn't gets erased) Data and Cache in TWRP.
Then reflashed the fastboot ROM, and somehow it worked. When It booted up, I had to type in my screenlock pin again, and after setup all my files were available.
Now that the phone worked again, I wanted to finish what I started, to update to latest EU (recovery) ROM. This was the second mistake. It did not work (because it required formatting data, which I did not wanted to, and just wiped it), and came bootloop again.
So I went back to the fastboot ROM again, which fixed the phone again.
But this time, it thinks the internal storage is not encrypted.
Now I can't access the internal storage. Even the camera app says that first I need an SD Card to take photos.
Its clearly still encrypted because when I browse it in TWRP, the structure and files are there, but the names are like "74t7Z1,dnvgIIexr1QAfhD".
The problem being neither the OS, nor TWRP knows the storage is encrypted, so it doesn't even tries to decrypt it, and there are no options to do it.
Tried to set encryption in the running OS, but it gave me the same results: even tho TWRP asks for decryption key, and says it successfully decrypted, the storage is still a mess like its in encrypted state.
Is there any way to manually force some flag, so I can access my files again? I have the encryption key, I just need some way to decrypt the storage. I think of something like an ADB command to flag the partition as encrypted, so TWRP and OS would try to decrypt it.
Thanks in advance!
Click to expand...
Click to collapse
Is twrp permanently installed
Austinredstoner said:
Is twrp permanently installed
Click to expand...
Click to collapse
No, its not.
Also, seems like the option to decrypt is not there because its being encrypted double. One with my original pin, and now with "default_password" since the encryption is forced in this ROM.
Trying to create any backup in TWRP now gives the "required key not available" error.
insetta said:
No, its not.
Also, seems like the option to decrypt is not there because its being encrypted double. One with my original pin, and now with "default_password" since the encryption is forced in this ROM.
Trying to create any backup in TWRP now gives the "required key not available" error.
Click to expand...
Click to collapse
Decryption only works when twrp permanently installed
Austinredstoner said:
Decryption only works when twrp permanently installed
Click to expand...
Click to collapse
Okay, I flashed TWRP.
Now I found that from shell, TWRP has a "decrypt" function, which I called, but no success
tucana:/ # twrp
TWRP openrecoveryscript command line tool, TWRP version 3.5.2_9-0
Allows command line usage of TWRP via openrecoveryscript commands.
Some common commands include:
install /path/to/update.zip
backup <SDCRBAEM> [backupname]
restore <SDCRBAEM> [backupname]
wipe <partition name>
format data
sideload
set <variable> [value]
decrypt <password> [USER ID]
remountrw
fixperms
mount <path>
unmount <path>
print <value>
mkdir <directory>
reboot [recovery|poweroff|bootloader|download|edl]
tucana:/ # twrp decrypt **********
Attempting to decrypt data partition or user data via command line.
Failed to decrypt data.
insetta said:
Okay, I flashed TWRP.
Now I found that from shell, TWRP has a "decrypt" function, which I called, but no success
tucana:/ # twrp
TWRP openrecoveryscript command line tool, TWRP version 3.5.2_9-0
Allows command line usage of TWRP via openrecoveryscript commands.
Some common commands include:
install /path/to/update.zip
backup <SDCRBAEM> [backupname]
restore <SDCRBAEM> [backupname]
wipe <partition name>
format data
sideload
set <variable> [value]
decrypt <password> [USER ID]
remountrw
fixperms
mount <path>
unmount <path>
print <value>
mkdir <directory>
reboot [recovery|poweroff|bootloader|download|edl]
tucana:/ # twrp decrypt **********
Attempting to decrypt data partition or user data via command line.
Failed to decrypt data.
Click to expand...
Click to collapse
Can u partition sd card if not can u install recovery ramdisk
Austinredstoner said:
Can u partition sd card if not can u install recovery ramdisk
Click to expand...
Click to collapse
What would be the purpose of partitioning the fs? Not to mention it would like cause data loss
insetta said:
What would be the purpose of partitioning the fs? Not to mention it would like cause data loss
Click to expand...
Click to collapse
That maybe true I can't think of anything else the only thing I can still think of is dm verify or vbmeta
Austinredstoner said:
That maybe true I can't think of anything else the only thing I can still think of is dm verify or vbmeta
Click to expand...
Click to collapse
"dm verify or vbmeta"
Sound familiar, please elaborate
insetta said:
"dm verify or vbmeta"
Sound familiar, please elaborate
Click to expand...
Click to collapse
How to enable and disable dm verity on android user build
How to enable and disable dm verity on android user build. adb root, adb disable-verity, adb enable-verity. remount failed: permission denied
5gnotes.com
Austinredstoner said:
How to enable and disable dm verity on android user build
How to enable and disable dm verity on android user build. adb root, adb disable-verity, adb enable-verity. remount failed: permission denied
5gnotes.com
Click to expand...
Click to collapse
Encryption / decryption of /sdcard partition relies on PIN/password set and stored in file /data/system/locksetting.db.
Neither AVB 1.0 ( AKA DM-Verity ) nor AVB 2.0 (read: Android Verified Boot - available only on project Treble devices) have anything to do with encryption / decryption of Android partitions: their purpose is the verification of the Android OS through the bootloader when phone gets started.
insetta said:
tucana:/ # twrp decrypt **********
Attempting to decrypt data partition or user data via command line.
Failed to decrypt data.
Click to expand...
Click to collapse
Look into Android's file /cache/recovery/log to get the reason why TWRP's decrypt fails.
Why not pull content of /sdcard to PC ( e.g. TAR-archived ) and then do a factory reset to get rid of the encryption?
jwoegerbauer said:
Look into Android's file /cache/recovery/log to get the reason why TWRP's decrypt fails.
Why not pull content of /sdcard to PC ( e.g. TAR-archived ) and then do a factory reset to get rid of the encryption?
Click to expand...
Click to collapse
Because pulling encrypted /storage is pointless. First I need to be able to decrypt them.
Because pulling encrypted /storage is pointless. First I need to be able to decrypt them.
Looked into the TWRP log, and seems like it uses the native android Keymaster HAL 4 to decrypt the storage, but it ran into some issues:
This is on TWRP boot:
Bash:
I:Setting up '/data' as data/media emulated storage.
I:mount -o bind '/data/media' '/sdcard' process ended with RC=0
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:File Based Encryption is present
e4crypt_initialize_global_de
Determining wrapped-key support for /data
fbe.data.wrappedkey = true
Wrapped key supported on /data
calling retrieveAndInstallKey
Key exists, using: /data/unencrypted/key
Using Keymaster HAL: 4 from QTI for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: [email protected]::IKeymasterDevice/default
begin failed, code -62
Upgrading key in memory only: /data/unencrypted/key
upgrade_key failed, code -38
e4crypt_initialize_global_de returned fail
e4crypt_initialize_global_de
Determining wrapped-key support for /data
fbe.data.wrappedkey = true
Wrapped key supported on /data
calling retrieveAndInstallKey
Key exists, using: /data/unencrypted/key
Using Keymaster HAL: 4 from QTI for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: [email protected]::IKeymasterDevice/default
begin failed, code -62
Upgrading key in memory only: /data/unencrypted/key
upgrade_key failed, code -38
e4crypt_initialize_global_de returned fail
And this is after I wanted to decrypt it:
Bash:
I:Command 'decrypt *************' received
I:Set page: 'singleaction_page'
I:operation_start: 'TWRP CLI Command'
Attempting to decrypt data partition or user data via command line.
E:Unexpected value for crypto key location
E:Error getting crypt footer and key
E:Could not get footer
Failed to decrypt data.
I:Done reading ORS command from command line
I:operation_end - status=0
I also would like to decrypt my phone. I have access to adb shell, fastboot and twrp. Is there any news on how to do it?

help on twrp "fastboot flash"

Hi all,
i have pure AOSP A.13 installed, and after installation i accidentally flashed twrp 3.7 by fastboot flash.
Now, system boot from slot A works, but seems i corrupted somehting:
- at twrp, /sdcard is always empty, have to re-adb push images
- installing i.e. magisk, get such errors
failed to mount "system_ext" (Block device required)
Unable to mount /data/media/TWRP/.twrps
etc.
Super partition seems anyway ok, since AOSP boots fine.
Also, quite strange, Nord is A/B, but i still have recovery partition.
Is there any chance to recover ?
Thanks

Categories

Resources