Help I unlocked the bootloader and can't decrypt data. - General Questions and Answers

So I unlocked the bootloader, flashed TWRP, and everything went fine. But when I tried to get into TWRP it asks for a password even though I haven't set one.
If I go to cancel > wipe and try to format data it just gives me a lot of red text ("operation not permitted") saying it doesn't have the permissions for a data wipe.
So since the system is still working I went and did a soft data reset since I already flashed TWRP and it doesn't work.
I confirmed it and the device started restarting, but when it booted it booted into TWRP. From TWRP I went back to the system and my data was still there.
I will now download the stock rom and try to flash the stock recovery. Is the problem in TWRP or in my device?
My phone is Motorola moto g8 (XT2045-2)

As soon as the bootloader gets unlocked, a Factory Reset is executed internally, which means that the encryption key gets also deleted, hence you no longer can decrypt encrypted data.

xXx yYy said:
As soon as the bootloader gets unlocked, a Factory Reset is executed internally, which means that the encryption key gets also deleted, hence you no longer can decrypt encrypted data.
Click to expand...
Click to collapse
yes, I know but for some reason it is still asking for a password.

Try default password -> default_password

xXx yYy said:
Try default password -> default_password
Click to expand...
Click to collapse
tried that aswell.. I tried erasing the userdata and cache using fastboot, then set a password in the system and it doesn't work in twrp. even twrp can't format data.

xXx yYy said:
Try default password -> default_password
Click to expand...
Click to collapse
I found out what was wrong, still can't get it to work though.. So the userdata partition was a format TWRP can't decrypt (I think). So I reformatted the userdata partition to ext4 but I get stuck in a bootloop unless I again erase the partition. Any help to how do I format it so it actually boots?

Why don't you ask in the support thread on xda-developers if TWRP is built with encryption support at all?
according to recovery.fstab it uses FBE + metadata encryption, so you probably have to format userdata + metadata once
from fastboot
Code:
fastboot format:f2fs userdata
fastboot format:ext4 metadata
or
from adb shell or terminal
Code:
make_f2fs -f /dev/block/bootdevice/by-name/userdata
mke2fs -t ext4 /dev/block/bootdevice/by-name/metadata

how do I delete double posts?

aIecxs said:
Why don't you ask in the support thread on xda-developers if TWRP is built with encryption support at all?
according to recovery.fstab it uses FBE + metadata encryption, so you probably have to format userdata + metadata once
from fastboot
Code:
fastboot format:f2fs userdata
fastboot format:ext4 metadata
or
from adb shell or terminal
Code:
make_f2fs -f /dev/block/bootdevice/by-name/userdata
mke2fs -t ext4 /dev/block/bootdevice/by-name/metadata
Click to expand...
Click to collapse
Code:
Warning: userdata type is raw, but f2fs was requested for formating.
Formatting is not supported for filesystem with type 'f2fs'.
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
rav:/ $ make_f2fs -f /dev/block/bootdevice/by-name/userdata
/system/bin/sh: make_f2fs: inaccessible or not found
the metadata one worked fine

try mkfs.f2fs instead

aIecxs said:
try mkfs.f2fs instead
Click to expand...
Click to collapse
/system/bin/sh: mkfs.f2fs: inaccessible or not found
where am I supposed to use the adb shell command? in the recovery or while in the system?
can't I just wipe data from the stock recovery and then format metadata?

note with adb shell I meant in TWRP recovery (requires partition unmounted)

uwucake2020 said:
/system/bin/sh: mkfs.f2fs: inaccessible or not found
can't I just wipe data from the stock recovery?
Click to expand...
Click to collapse
aIecxs said:
note with adb shell I meant in TWRP recovery (requires partition unmounted)
Click to expand...
Click to collapse
oh ok wait a minute
I can't umount it..
Code:
127|sofiar:/ # make_f2fs -f /dev/block/bootdevice/by-name/userdata
F2FS-tools: mkfs.f2fs Ver: 1.12.0 (2018-11-12)
Info: Disable heap-based policy
Info: Debug level = 0
Info: Trim is enabled
Error: In use by the system!
1|sofiar:/ # umount /data
umount: /data: Device or resource busy
@aIecxs what can I do here? maybe erase the partition using fastboot or do a factory reset/wipe data using the stock recovery?
edit: I had data transfer on oops
sorry for the ping tho, idk if you can see when I edit a message

/data is not the only mount point. there is also /sdcard (refer to df -a)
this is how it looks on Poco M3. in my case you can see userdata is sda11. sda11 is mounted triple, so we have to umount sda11 until it is completely unmounted
Code:
[root] /: find /dev/block -name userdata
/dev/block/platform/soc/4804000.ufshc/by-name/userdata
[root] /: ls -l /dev/block/platform/soc/4804000.ufshc/by-name/userdata
lrwxrwxrwx 1 0 0 16 1971-05-21 00:59 /dev/block/platform/soc/4804000.ufshc/by-name/userdata -> /dev/block/sda11
[root] /: df -a
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 1788376 68504 1719872 4% /
tmpfs 1902824 572 1902252 1% /dev
tmpfs 1902824 0 1902824 0% /mnt
tmpfs 1902824 0 1902824 0% /apex
tmpfs 1902824 52 1902772 1% /tmp
/dev/block/sde53 364504 3876 360628 2% /cache
/dev/block/sda11 49394556 20677260 28717296 42% /data
/dev/block/sda11 49394556 20677260 28717296 42% /sdcard
/dev/block/sda11 49394556 20677260 28717296 42% /storage
/dev/block/mmcblk0p1 31150720 26539136 4611584 86% /sdcard1
/dev/block/dm-0 2923136 2821180 101956 97% /system_root
/dev/block/sde52 196528 118256 78272 61% /firmware
/dev/block/sde55 999320 583268 416052 59% /cust
/dev/block/sda6 11760 72 11688 1% /metadata
/dev/block/sda7 27632 2156 25476 8% /persist
/dev/block/dm-2 1479100 1374644 104456 93% /product
/dev/block/dm-1 1414572 1309996 104576 93% /vendor
[root] /:

aIecxs said:
note with adb shell I meant in TWRP recovery (requires partition unmounted)
Click to expand...
Click to collapse
got into a bootloop. "android system may be corrupt"

just format in TWRP recovery + stay in TWRP recovery and pull recovery.log, that's all you can do for now. this is for maintainer to look at

aIecxs said:
just format in TWRP recovery + stay in TWRP recovery and pull recovery.log, that's all you can do for now. this is for maintainer to look at
Click to expand...
Click to collapse
i don't think the problem is in TWRP, every time I format a partition to ext4 it bootloops :/

according to recovery.fstab /data is f2fs and /metadata is ext4. so formatting should work from fastboot and from twrp. you must not boot into android, reboot straight into recovery back again, then get recovery.log. boot loop is different issue, probably dm-verity

aIecxs said:
just format in TWRP recovery + stay in TWRP recovery and pull recovery.log, that's all you can do for now. this is for maintainer to look at
Click to expand...
Click to collapse
I just checked and the problem is in formatting the data partition, idk why tho

without recovery.log it's all just guesswork.. kindly re-read how to format

Related

Clean Your File Systems!

Ok, lately we have had a rash of errors and undesired performance. In my opinion, this is unacceptable... So I am trying to fix it. Now, I can't fix every issue, but boy can I sure help most of them...lol
So let's get started. We will call this:
The File System Cleaner
Linux has a few tools for us to see if we have a "Dirty" or "Clean" filesystem.
They are tune2fs, e2fsck, and fsck_msdos.
Now, you can't use all of them for every file system or partition (we will refer to them all as partitions from here on out). Each one works on certain filesystems. For example, e2fsck works on ext type partitions where fsck_msdos works on vfat type partitions, and tune2fs only works on large partitions.
While tune2fs is a tool that gives detailed information about a partition, it can still give us an idea on where we stand on those larger partitions as well as change certain options/features on that partition such as journaling, mount point, mount as rw or ro, etc. But the biggest thing we are going to focus on is 1 line:
Code:
Filesystem state
If you run tune2fs and the filesystem state is anything other than clean, you have some sort of gremlin floating about it and it needs to be fixed. Now what about those partitions in which we get these errors:
t
Code:
tune2fs 1.41.11 (14-Mar-2010)
tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/block/mmcblk0p4
Couldn't find valid filesystem superblock.
1|[email protected]:/ # tune2fs -l /dev/block/mmcblk0p28
tune2fs 1.41.11 (14-Mar-2010)
tune2fs: Bad magic number in super-block while trying to open /dev/block/mmcblk0p28
Couldn't find valid filesystem superblock
It doesn't mean that they are corrupt. It means they are either not in a format that tune2fs can read or they are not a large partition.
So for those partitions that are not compatible with tune2fs, we can use fsck.
The fsck works much like scan disk and defrag in windows. It scans the partition for several different things like bad blocks, missing/corrupt information, etc. Although you can run tune2fs on any large partition whether it is mounted or not, you DO NOT want to fsck ANY partition that is mounted or it WILL result in TOTAL data LOSS! You have been warn!
Keep in mind all this information is at your own risk, but know that I have been using this for quite some time and it hasn't failed me yet. But then again, I follow my instructions to a TEE, as you should as well...
So, here's how we use all this.
First make sure you have adb installed on your computer
To be safe, boot into recovery, plug your phone into your computer and start adb shell
Now type:
Code:
mount /system
cp /system/bin/tune2fs /tmp
cp /system/bin/e2fsck /tmp
cp /system/bin/fsck_msdos /tmp
chmod -R 777 /tmp
cd tmp
Now that our tools are set, we can now begin cleaning house.
First and most important, make sure you umount ALL partitions.
I personally unmount them manually via mounts and storage in CWM.
In terminal (with adb running) type:
Code:
./tune2fs -l <partition>
./e2fsck <partition>
./fsck_msdos <partition>
**NOTE**If you have an error "/sbin/sh: <command>: not found" when executing one of these commands simply mount /system and copy to tmp, and chmod 777 again.**
For more information on the commands, run <command> -h. here you will see additional options for that command.
Now, I didn't break down which partitions work with tune2fs, but /system, /data, and /cache can be scanned with tune2fs.
However, I did break as to what partitions need which fsck command to be cleaned.
Code:
e2fsck
|mount point| |Filesystem type|
/dev/block/mmcblk0p21 /efs
/dev/block/mmcblk0p24 /system
/dev/block/mmcblk0p25 /data
/dev/block/mmcblk0p26 /cache
/dev/block/mmcblk0p27 /tombstones
/dev/block/mmcblk1p2 unknown
Code:
fsck_msdos
|mount point| |Filesystem type|
/dev/block/mmcblk0p4 fsinfo
/dev/block/mmcblk0p13 /system/etc/firmware/misc
/dev/block/mmcblk0p17 /system/etc/firmware/misc_mdm
/dev/block/mmcblk0p28 emmc
/dev/block/mmcblk1p1 /sdcard
Example:
Code:
/tmp # e2fsck /dev/block/mmcblk0p24
e2fsck 1.41.12 (17-May-2010)
/dev/block/mmcblk0p24: clean, 4220/38320 files, 93625/153088 blocks
This should resolve many of your laggy performance and random reboot issues. As well as the issue of freezes after a reboot.
If you are a flash addict, tuning your partitions between flashes my be a GREAT idea...
If you do not have those binaries in your ROM, let me know and I will upload them here...
Now, there is a little more destructive way to clean a partition, and that is to reformat it. Most of us format /system /cache and dalvik in CWM before flashing, but sometimes that isn't enough. All CWM does is erase the files/folders contained in one of those partitions.
Here's how we do a complete reformat:
Reboot to recovery, plug phone in and start adb shell
Type:
Code:
mount /system
cp /system/bin/make_ext4fs /tmp
chmod 777 /tmp/make_ext4fs
mount <system, data or cache partition>
./make_ext4fs <partition>
This only works with ext4 partitions, so use it ONLY on these:
Code:
/dev/block/mmcblk0p24 /system
/dev/block/mmcblk0p25 /data
/dev/block/mmcblk0p26 /cache
I know there are other ext partitions, like tombstone and efs, but DO NOT use this command on them. You may BRICK or damage your device. I will say this again, ONLY DO THIS on data, cache, system!
**NOTE** If you format system partition, you WILL have to flash your ROM and Gapps again...
I have not had windows on this pc for over 2 years now and I think ADB is MS only right? I do flash a lot but I normally run ultimate kernel cleaning script and plus run the wipes a couple times myself and sumtimes format cache partitons before I install a new rom.... I like to make sure I do most I can to clean before I flash...and I always run the LZ kernel Cause its AWESOME!! but I guess my question is how can I look to see if my partitons need to be cleaned.. on AOKP with LZ kernel at moment and it is smooth fast and no bugs or reboots. is there a way to vew the partitions with ubuntu 12.04? or dose ubuntu even need ADB... linux seems very good at haveing the right drivers and software already available without installing to many extras.
not even sure your a linux desktop user but thought I would go ahead and ask.
Many thanks for everything
woodyjlw said:
I have not had windows on this pc for over 2 years now and I think ADB is MS only right? I do flash a lot but I normally run ultimate kernel cleaning script and plus run the wipes a couple times myself and sumtimes format cache partitons before I install a new rom.... I like to make sure I do most I can to clean before I flash...and I always run the LZ kernel Cause its AWESOME!! but I guess my question is how can I look to see if my partitons need to be cleaned.. on AOKP with LZ kernel at moment and it is smooth fast and no bugs or reboots. is there a way to vew the partitions with ubuntu 12.04? or dose ubuntu even need ADB... linux seems very good at haveing the right drivers and software already available without installing to many extras.
not even sure your a linux desktop user but thought I would go ahead and ask.
Many thanks for everything
Click to expand...
Click to collapse
Yeah, I'm completely windows free too...YAY! lol
You still need to install the adb binary/command and put it in your path. The good news is, it's very simple in Linux, unlike wincrapdows...
And then just follow the tutorial to check your partitions...

TWRP cannot mount /data; nothing 'sticking' using fastboot

Hi all,
hoping on the off-chance someone's still monitoring the Nexus 5 forums here
So decided to dust off the old Nexus 5 (now with extra COVID-19 time on my hands!) to use as a backup device, but having serious issues getting it up and running. I had it rooted years ago, and had no issues installing custom roms.
Now I'm having the following situation:
I cannot flash the factory image using fastboot, nor anything is 'sticking' to the phone when I try to re-flash individual component for the factory image. I've also tried to flash TWRP, but again, it doesn't stick and the only way i can boot into TWRP is by using
Code:
fastboot boot recovery.img
.
However in recovery, the data partition is not mounting and all the tutorials/guides I read about fixing it aren't working (e.g. repairing the partition-- get a 'unable to repair data' error; changing from EX4 to EX2 and back-- get 'failed to mount '/data' error).
Ran the following command in the terminal window in TWRP
Code:
cat /etc/fstab
and got the following output:
Code:
/dev/block/mmcblk0p25 /system ext4 rw 0 0
/dev/block/dm-0 /data ext4 rw 0 0
/dev/block/mmcblk0p27 /cache ext4 rw 0 0
/dev/block/mmcblk016 /persist ext 4 rw 0 0
/dev/block/mmcblk0p1 /firmware vfat rw 0 0
/usb-otg vfat rw 0 0
tried using the make_ext4fs command, but again- nothing happens.
Using TWRP 3.3.1-0 by the way
Any ideas? is the phone completely bricked? it's stuck in a bootloop where the google colours come up but freeze within half a second, repeat and continue.
Any advice would be very much appreciated!

Guide to Treble/GSI on the Palm Phone

From this thread: https://forum.xda-developers.com/pr...velopment/aosp-10-0-quack-phh-treble-t3992559, the TrebleCheck app indicates we need an arm64 "a-only" ROM. The Palm Phone is running vendor version 8.1.
Step 1: Download Sugar. This thread: https://forum.xda-developers.com/android/general/release-root-palm-phone-t4021201, has everything you need to know about Sugar. I ran the upgrade once to download the full stock ROM (make a backup as described). Warning, this erases all of your data.
Step 2: Follow this guide: https://forum.xda-developers.com/android/general/guide-porting-twrp-source-t3843473, to build a TWRP for the Palm Phone without source. I used the latest TWRP for the Asus Nexus 7 2013 LTE as my base. From your Palm upgrade backup, the recovery image is the one that starts with 'R', about 36MB. Rename your new TWRP image to match the stock recovery and replace it similar to the rooting guide for replacing the boot image.
Update: snoopy20 has shared his TWRP image here: https://forum.xda-developers.com/showpost.php?p=82654073&postcount=26
Step 3: Extract the system image you downloaded and rename and replace the stock system image. It's the largest file in your Sugar device folder.
Step 4: Re-run the upgrade in Sugar with your replaced images in place.
Step 5: You're probably stuck in a boot loop. Press and hold the power button until you get into recovery, which is now TWRP. First, I formatted data. Then push or otherwise copy this zip to the device: https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389 and install it from TWRP. The stock configuration should be fine, i.e. don't worry about re-naming the zip. Note, do NOT use adb sideload, since that seems to wreck the zip installer's ability to use its own file name to configure itself.
Update: The Universal dm-verity zip may not always work, in particular on AOSP Android 10 images. In this case, you can use another Android device and Magisk Manager to patch the Palm boot image. Push the boot image from your Palm backup (described in Step 1) to the other Android device. It's the mbn file that starts with 'B'. I chose to rename it to boot.img for easier use. Than use Magisk Manager to patch it. Push the modified boot image back to the Palm (in TWRP) and use TWRP to Install->Image it.
Step 6: Reboot! Wipe data and cache for good measure, and you should be set!
All credit goes to the folks from the links above for creating the Treble system image, TWRP guide, and dm-verity script. Thanks to snoopy20 for his TWRP image.
Things that work so far:
* Almost everything
Doesn't work
* Soft key requires an app, such as Key Mapper, to use
* Screen auto brightness is missing
Can you post the TWRP you created?
snoopy20 said:
Can you post the TWRP you created?
Click to expand...
Click to collapse
Is it kosher to publicly post a TWRP created like this (i.e. not from source)?
Additionally, I'm not entirely confident I didn't screw something up, so I'm a little wary to risk everyone's device. Specifically, I do not know what would happen if you get caught in a boot loop and don't have a functioning recovery to boot into in order to restore...
Yeah you just write "Unofficial" or something in the title. Right now I'm happy to brick the Palm, I'm 99% of the way to dropping it but it would be fantastic if I can get a stock Android on it.
By the way do the restrictions, i.e wifi tethering, get applied by the Vendor package?
snoopy20 said:
Yeah you just write "Unofficial" or something in the title. Right now I'm happy to brick the Palm, I'm 99% of the way to dropping it but it would be fantastic if I can get a stock Android on it.
By the way do the restrictions, i.e wifi tethering, get applied by the Vendor package?
Click to expand...
Click to collapse
Hard for me to test since I don't have a supported SIM, but the tethering menu is available in Settings. You'll have to try it and let us know.
If you post the TWRP I'll do so. My biggest concern is if I **** up building it. I sent you a PM.
snoopy20 said:
If you post the TWRP I'll do so. My biggest concern is if I **** up building it. I sent you a PM.
Click to expand...
Click to collapse
Just waiting for android file host to approve
I've attempted to repack but found:
1. Two fstab files are fstab.qcom and fstab.grouper, don't know if I should delete them but instructions seem to indicate I should.
2. Stock ramdisk folder doesn't have a fstab.* file to copy over.
I ended up with this twrp.fstab. Note the encryption part from /data is gone? Unsure if this is ok.
# mount point fstype device
#twrp.fstab
/system ext4 /dev/block/bootdevice/by-name/system
/cache ext4 /dev/block/bootdevice/by-name/cache
/data ext4 /dev/block/bootdevice/by-name/userdata
/misc emmc /dev/block/bootdevice/by-name/misc
/boot emmc /dev/block/bootdevice/by-name/boot
/recovery emmc /dev/block/bootdevice/by-name/recovery
/external_sd vfat /dev/block/mmcblk1p1 flags=removable;storage;display="SDCARD"
/usb-otg auto /dev/block/sda1 flags=removable;storage;display="USB-OTG"
Just a big heads up, when trying to connect to the network today (Visible) I noticed that my IMEI was 0000.... I have never successfully connected the Palm phone and while the behavior now is consistent with my issues before, I can't say whether or not flashing the GSI as outlined here erased my IMEI.
Proceed with caution.
I'm not proceeding at all unless you post your twrp or verify the issues I've had creating it.
I read the IMEI is held on another partition, type 'efs'. I can't see Sugar killing it. More likely your fstab options aren't mounting it.
---------- Post added at 06:57 PM ---------- Previous post was at 06:33 PM ----------
Here is a list of all the mountpoints on a working phone. At a guess the IMEI is held in /firmware. Do you have this mounted?
rootfs on / type rootfs (ro,seclabel,size=1358776k,nr_inodes=339694)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=1439668k,nr_inodes=359917,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime,gid=3009,hidepid=2)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
/dev/block/mmcblk0p27 on /system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/dev/block/mmcblk0p28 on /vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)
none on /acct type cgroup (rw,relatime,cpuacct)
debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
tmpfs on /mnt type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755,gid=1000)
none on /config type configfs (rw,relatime)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
pstore on /sys/fs/pstore type pstore (rw,seclabel,relatime)
/dev/block/mmcblk0p52 on /fotadata type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
/dev/block/mmcblk0p29 on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
/dev/block/mmcblk0p12 on /dsp type ext4 (ro,seclabel,nosuid,nodev,relatime,data=ordered)
/dev/block/mmcblk0p1 on /firmware type vfat (ro,context=ubject_r:firmware_file:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=437,iocharset=iso8859-1,shortname=lower,errors=remount-ro)
/dev/block/mmcblk0p30 on /persist type ext4 (rw,seclabel,nosuid,nodev,noatime,data=ordered)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755,gid=1000)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,seclabel,relatime)
tmpfs on /sbin type tmpfs (rw,seclabel,relatime,size=1439668k,nr_inodes=359917,mode=755)
/sbin/.magisk/block/persist on /sbin/.magisk/mirror/persist type ext4 (rw,seclabel,relatime,data=ordered)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/dm-0 on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
/sbin/.magisk/block/system on /sbin/.magisk/mirror/system type ext4 (ro,seclabel,relatime,discard,data=ordered)
/sbin/.magisk/block/vendor on /sbin/.magisk/mirror/vendor type ext4 (ro,seclabel,relatime,discard,data=ordered)
/sbin/.magisk/block/data on /sbin/.magisk/mirror/data type ext4 (rw,seclabel,relatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
/data/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/data/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/data/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid)
/data/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid)
The original firmware recovery has the /firmware mounted as the sdcard so depending on how you mounted for twrp could you have wiped it?
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check
/dev/block/bootdevice/by-name/fotadata /fotadata ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check
/dev/block/bootdevice/by-name/vendor /vendor ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc wait,check
/dev/block/mmcblk0p1 /sdcard vfat nosuid,nodev wait
/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/fsg /fsg emmc defaults defaults
Added my TWRP to the OP
OK I've compared and I can't see anything major. The only thing you do have is a few more mount points which I've not had in mine (listed). Where are they from? I think mounting the sdcard (modem firmware) is a bad idea so I'm going to skip that.
/sbl1 emmc /dev/block/bootdevice/by-name/sbl1
#/sbl2 emmc /dev/block/bootdevice/by-name/sbl2
#/sbl3 emmc /dev/block/bootdevice/by-name/sbl3
/tz emmc /dev/block/bootdevice/by-name/tz
/rpm emmc /dev/block/bootdevice/by-name/rpm
/aboot emmc /dev/block/bootdevice/by-name/aboot
#/sbl2b emmc /dev/block/bootdevice/by-name/sbl2b
#/sbl3b emmc /dev/block/bootdevice/by-name/sbl3b
#/tzb emmc /dev/block/bootdevice/by-name/tzb
#/rpmb emmc /dev/block/bootdevice/by-name/rpmb
#/abootb emmc /dev/block/bootdevice/by-name/abootb
#/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;display=USB-OTG
/external_sd vfat /dev/block/mmcblk0p1
/usb-otg auto /dev/block/sda1
So, I have twrp installed, and a fast bootloop almost instantly on start. I haven't been able to solve it thus far. I can get into twrp which is something though.
snoopy20 said:
OK I've compared and I can't see anything major. The only thing you do have is a few more mount points which I've not had in mine (listed). Where are they from? I think mounting the sdcard (modem firmware) is a bad idea so I'm going to skip that.
/sbl1 emmc /dev/block/bootdevice/by-name/sbl1
#/sbl2 emmc /dev/block/bootdevice/by-name/sbl2
#/sbl3 emmc /dev/block/bootdevice/by-name/sbl3
/tz emmc /dev/block/bootdevice/by-name/tz
/rpm emmc /dev/block/bootdevice/by-name/rpm
/aboot emmc /dev/block/bootdevice/by-name/aboot
#/sbl2b emmc /dev/block/bootdevice/by-name/sbl2b
#/sbl3b emmc /dev/block/bootdevice/by-name/sbl3b
#/tzb emmc /dev/block/bootdevice/by-name/tzb
#/rpmb emmc /dev/block/bootdevice/by-name/rpmb
#/abootb emmc /dev/block/bootdevice/by-name/abootb
#/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=removable;storage;display=USB-OTG
/external_sd vfat /dev/block/mmcblk0p1
/usb-otg auto /dev/block/sda1
Click to expand...
Click to collapse
I think the guide for porting TWRP mentioned to add it, so I did.
snoopy20 said:
So, I have twrp installed, and a fast bootloop almost instantly on start. I haven't been able to solve it thus far. I can get into twrp which is something though.
Click to expand...
Click to collapse
Sounds similar to me. Did you flash the new system as well? If so, this is when you use TWRP to flash the zip to disable dm-verity.
I did, then the dm-verity but with no success. Assuming /system was corrupt or wrong I've deleted it. I'm now trying to work out how to flash the system.img without fastboot (which I don't have).
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
---------- Post added at 09:44 PM ---------- Previous post was at 09:26 PM ----------
I did, then the dm-verity but with no success. Assuming /system was corrupt or wrong I've deleted it. I'm now trying to work out how to flash the system.img without fastboot (which I don't have).
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
Actually you said you tried 10 unsuccessfully, so how did you then flash the v8 image?
snoopy20 said:
So far dd is ending up with a corrupt partition and twrp insists on a zip for system flash. Trying to figure out how to convert it.
Click to expand...
Click to collapse
TWRP doesn't say "Install Image" at the bottom when you go to Install?
Actually you said you tried 10 unsuccessfully, so how did you then flash the v8 image?
Click to expand...
Click to collapse
I'm assuming the 2nd link down in OP (github).
This is exciting!
Anytime I got stuck, from TWRP I used
Code:
adb reboot edl
then I used Sugar to reflash everything all over again.
Phew, I didn't know about that one. I'll try again.
You can't flash an img from TWRP, there's no boot partition to enter fastboot mode.
I'd originally downloaded the nogapps without su and added Magisk.zip after, this caused an instant bootloop. The one with build in gapps+su works. It's possible to disable all gapps and related services except GoogleOne (I installed OpenLauncher into /system/app then removed GoogleOne by force). After this "Google" can be removed and all notifications about Google Services end.
I recommend you take down the twrp and remove the line which mounts the firmware partition as sdcard in case this is what wiped your IMEI. I build my own without this line and IMEI survived.
Tested
Wifi hotspot is working!
Bluetooth, camera, all USB,
Stability
Not working
Thee dots button (don't think it's a big deal as you get the three icons for back etc by default).
Auto screen brightness

The /data partition ( Android 10 [Q] )

Does anyone know if the /data parition has any information about the ROM?
I'm asking this since I want to downgrade without completely wiping userdata.
(For a custom recovery)
It probably does @TheMagnificent_Y. That's probably why you can't unmount it while actively being booted into the same ROM. It will say resource is busy.
Where is /data partition located in Android 10 and Android 11 anyway? How can I mount it manually from the command line from recovery? /data is /dev/block/dm-5 in Android 11 but is that the same thing as /dev/block/by-name/userdata ? Why is there /dev/block/dm-0 to dm-4 in some unofficial custom recoveries but there is no dm-5 AKA /data ?
When running the command below on my device it only shows userdata partition but no data partition or is that the same thing ?! Thanks.
Bash:
ls -l /dev/block/by-name

Init_user0_failed After trying to update to 11.0.5.1

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.
All I have in my /data folder is:
/data/india /data/recovery /data/reserve
Update:
I tried adb sideloading the previous 11.0.3.1 and as I reboot I get `Init_user0_failed` with a dmesg and android.log file saved in /op2.
My /system/etc/fstab:
/system_root ext4 ro 0 0
/dev/block/sda17 /metadata ext4 rw 0 0
/dev/block/sda19 /data ext4 rw 0 0
/firmware vfat ro 0 0
/dev/block/sda7 /op2 ext4 rw 0 0
/usbstorage vfat rw 0 0
/vendor ext4 ro 0 0
ls -al /dev/block/platform/soc/1d84000.ufshc/by-name/: http://dpaste.com/CFNTDVTRK
dmesg.log: http://dpaste.com/DPRQLYCEE
android.log: (added as attachement)
I've been told I can use EDL but want to keep that as last resort as I don't have a backup of any of my files.
Edit: I also tried the reboot to recovery, clear cache then reboot back to recovery and reboot system as mentioned on a couple of other threads but that didn't work either.
Don't know if this will help, but I recently ended up soft-bricked with that same error after upgrading to a newer version of TWRP. I believe it had something to do with the way TWRP interacts with the /data partition, although I'm not sure how exactly.
Anyway, I was able to get the phone booting into OOS so I could at least back up my /sdcard partition before blowing it away and starting over. The way I did that was to flash crDroid's newest recovery boot img:
https://forum.xda-developers.com/t/rom-android-12l-op7pro-crdroid-v8-6-26-06-2022.4184671/
https://sourceforge.net/projects/crdroid/files/guacamole/8.x/recovery/
For me, the phone would once again boot into OOS, but fingerprint authentication didn't work, and the phone consistently froze about 5 minutes after putting in my PIN at boot. I was able to extend this time by freezing the Magisk app in Titanium and turning off all radios (Airplane mode on, Bluetooth off, etc.) After like 30 reboots, I was able to get everything copied off the /sdcard partition. Hope this helps someone...

Categories

Resources