How to mount encrypted /data partition in recovery mode?

I’m lacking knowledge to understand but thank you for looking into the issue. In your discernment, is there any attempt that could be promising? I caught up talk mentioning fastboot and twrp, anything worth trying or would they all be hampered by the same problem?

Hi johentsch,
How far can you go when you reboot? In my case, it only crashes when I unlock the phone after startup (within 1-2 seconds I’ve got notifications saying some apps (such as BlissLauncher, microG) can’t open and it goes into rebooting).

Waiting before unlocking or removing the sim card does not improve things, but I am thinking, if nothing works, that killing some memory-hungry system functions with adb could be enough? For me what matters most is to save as much pictures/videos as possible.

From what I understand, your chances that twrp works depends on the status (locked/unlocked) of your device, which you can see by entering “Reboot to bootloader”.

Thank you @rogit.

My booting experience is similar to what you’re describing. My interpretation of this behaviour was that the system was probably failing to write logs and shut down because of this.

But in case you’ve had success with this, could please point me to what the memory-hungry system functions are?

Hmm, I don’t remember rooting the phone so, unless it’s part of the normal installation procedure, it’s probably locked? When I select “Reboot to bootloader” I get a black screen with a tiny “FASTBOOT mode…” written in the lower left, that’s all.

From what I understand adb should let me remove files, so I would need only a single filepath – how can it be so difficult to see the filepaths? Or am I mistaken and mounting the userdata is a necessary condition on /e/?

Small update on this. I’ve also played around a little bit more, trying to follow this stackexchange. Although fdisk -l could have come handy, it’s not actually available, nor when I mount /system (BTW, wouldn’t it come enormously handy if the recovery menu also had a Mount /data option?). However, it does provide du which helped me discover that I also have a /dev/block/platform/bootdevice/by-name/userdata path. However, mount -t ext4 -o rw /dev/block/platform/bootdevice/by-name/userdata /mnt/userdata yields Invalid argument as well.

I just realized this now but when selecting the mount option in the recovery menu it says:
“Unable to enable ext4 verity on /dev/block/by-name/metadata because /system/bin/tune2fs is missing”
From what I’ve read in the forums there might be no way around this

Hi you all,
I have the same problem : my fairphone 4 shuts down and reboots into recovery. I just can see a message box saying “espace de stockage bientôt saturé” (storage space is almost full). I have not even the chance to type my pin code. I just had the time to try rebooting into safe mode but I land on recovery again.

Bootloader is unlocked, I use adb on windows, but I can’t access to heavy files. I don’t have TWRP

Here is what I have.

>adb shell
FP4:/ # ls -lhS
total 1.4M
-rw-r--r--   1 root root     1.2M 1970-01-01 00:00 sepolicy
-rw-r--r--   1 root root      92K 1970-01-01 00:00 vendor_file_contexts
-rw-r--r--   1 root root      75K 1970-01-01 00:00 plat_property_contexts
-rw-r--r--   1 root root      40K 1970-01-01 00:00 plat_file_contexts
-rw-r--r--   1 root root      21K 1970-01-01 00:00 prop.default
-rw-r--r--   1 root root      20K 1970-01-01 00:00 vendor_property_contexts
-rw-r--r--   1 root root     6.2K 1970-01-01 00:00 system_ext_property_contexts
drwxr-xr-x  12 root root     3.6K 1970-01-02 00:56 dev
-rw-r--r--   1 root root     3.4K 1970-01-01 00:00 system_ext_file_contexts
-rwxr-x---   1 root root     1.9K 1970-01-01 00:00 init.recovery.qcom.rc
-rw-r--r--   1 root root     1.6K 1970-01-01 00:00 product_property_contexts
-rw-r--r--   1 root root      306 1970-01-01 00:00 product_file_contexts
drwxr-xr-x   2 root root      240 1970-01-01 00:00 odm
drwxrwxr-x  10 root system    200 1970-01-02 00:56 mnt
drwxr-xr-x   5 root root      100 1970-01-01 00:00 system
drwxrwxr-x   2 root shell      80 1970-01-02 00:56 tmp
drwxr-xr-x   2 root root       60 1970-01-02 00:56 linkerconfig
drwxr-xr-x   2 root root       60 1970-01-01 00:00 odm_dlkm
drwxr-xr-x   3 root root       60 1970-01-01 00:00 res
drwxr-xr-x   2 root root       60 1970-01-01 00:00 vendor_dlkm
lrwxrwxrwx   1 root root       50 1970-01-01 00:00 bugreports -> /data/user_de/0/com.android.shell/files/bugreports
drwxr-xr-x   2 root root       40 1970-01-01 00:00 acct
drwxr-xr-x   2 root root       40 1970-01-02 00:56 apex
drwxr-xr-x   2 root root       40 1970-01-02 00:56 cache
drwxr-xr-x   2 root root       40 1970-01-01 00:00 data
drwxr-xr-x   2 root root       40 1970-01-01 00:00 data_mirror
drwxr-xr-x   2 root root       40 1970-01-01 00:00 debug_ramdisk
drwxr-xr-x   2 root root       40 1970-01-01 00:00 metadata
drwxr-xr-x   2 root root       40 1970-01-01 00:00 oem
drwxr-xr-x   2 root root       40 1970-01-01 00:00 postinstall
drwxr-xr-x   2 root root       40 1970-01-01 00:00 product
drwx------   2 root root       40 2023-09-13 20:11 root
drwxr-xr-x   2 root root       40 1970-01-01 00:00 sdcard
drwxr-xr-x   2 root root       40 1970-01-01 00:00 second_stage_resources
drwxr-xr-x   2 root root       40 1970-01-02 00:56 sideload
d---r-x---   2 root sdcard_r   40 1970-01-02 00:56 storage
drwxr-xr-x   2 root root       40 1970-01-01 00:00 system_ext
drwxr-xr-x   2 root root       40 1970-01-01 00:00 vendor
lrwxrwxrwx   1 root root       17 1970-01-01 00:00 d -> /sys/kernel/debug
lrwxrwxrwx   1 root root       16 1970-01-01 00:00 init -> /system/bin/init
lrwxrwxrwx   1 root root       12 1970-01-01 00:00 default.prop -> prop.default
lrwxrwxrwx   1 root root       11 1970-01-01 00:00 bin -> /system/bin
lrwxrwxrwx   1 root root       11 1970-01-01 00:00 etc -> /system/etc
lrwxrwxrwx   1 root root       11 1970-01-02 00:56 sbin -> /system/bin
drwxr-xr-x   5 root root        0 1970-01-02 00:56 config
-rw-r--r--   1 root root        0 1970-01-01 00:00 odm_file_contexts
-rw-r--r--   1 root root        0 1970-01-01 00:00 odm_property_contexts
dr-xr-xr-x 453 root root        0 1970-01-01 00:00 proc
dr-xr-xr-x  13 root root        0 1970-01-02 00:56 sys
FP4:/ # ls -l $(which mount)
lrwxrwxrwx 1 root root 6 1970-01-01 00:00 /system/bin/mount -> toybox
FP4:/ # toybox --help | head -n1
Toybox 0.8.4-android multicall binary: https://landley.net/toybox (see toybox --help)
FP4:/ # mount /data
mount: '/dev/block/bootdevice/by-name/userdata'->'/data': Invalid argument
1|FP4:/ # ls -l /dev/block/bootdevice/by-name/userdata
lrwxrwxrwx 1 root root 16 1970-01-02 00:56 /dev/block/bootdevice/by-name/userdata -> /dev/block/sda11
FP4:/ # mount -t auto /dev/block/sda11 /mnt/userdata
mount: '/dev/block/sda11'->'/mnt/userdata': No such file or directory
1|FP4:/ # cat /etc/fstab
/dev/block/by-name/metadata /metadata ext4 discard 0 0
/dev/block/bootdevice/by-name/userdata /data f2fs discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt 0 0
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 barrier=1 0 0
/dev/block/bootdevice/by-name/modem_b /vendor/firmware_mnt vfat shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 0 0
/dev/block/bootdevice/by-name/dsp_b /vendor/dsp ext4 barrier=1 0 0
/dev/block/bootdevice/by-name/bluetooth_b /vendor/bt_firmware vfat shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 0 0
FP4:/ # find . -type f -size +10M
find: ./proc/2/task/2/exe: No such file or directory
find: ./proc/2/exe: No such file or directory
find: ./proc/3/task/3/exe: No such file or directory
find: ./proc/3/exe: No such file or directory
find: ./proc/4/task/4/exe: No such file or directory

[...]

find: ./proc/605/exe: No such file or directory
./mnt/system/system/apex/com.android.permission.capex
./mnt/system/system/apex/com.android.art.capex
./mnt/system/system/apex/com.android.vndk.current.apex
./mnt/system/system/apex/com.android.i18n.apex
./mnt/system/system/app/MagicEarth/oat/arm64/MagicEarth.vdex
./mnt/system/system/app/MagicEarth/MagicEarth.apk
[...]
1|FP4:/ # rm ./mnt/system/system/app/MagicEarth/MagicEarth.apk
rm ro ./mnt/system/system/app/MagicEarth/MagicEarth.apk (y/N):y
rm: ./mnt/system/system/app/MagicEarth/MagicEarth.apk: Read-only file system
1|FP4:/ # ls -lh ./mnt/system/system/app/MagicEarth/MagicEarth.apk
-rw-r--r-- 1 root root 58M 2009-01-01 00:00 ./mnt/system/system/app/MagicEarth/MagicEarth.apk

the /e/-recovery then won’t help, it can’t mount the userdata filesystem. With most phones you can just boot into another bootloader temporarily without flashing. You could check if TWRPs kernel is different and can mount userdata → https://dl.twrp.me/FP4/twrp-3.7.0_11-0-FP4.img.html

This thread had users with locked bootloaders that didn’t have that option, thus the dead end when the recoveries kernel wasn’t mounting.

Thank you for your answer,
is there any thead where my post would fit better ? No problem to moove it.

Thank you for the link to TWRP, I will try this solution even if as far I don’t understand how I should proceed…

So you reckon that there is no possibility with adb to access (and delete) some of the biggest files that are stored on the phone ?

1 Like

you need to be booted in normal mode or recovery mode to use adb
it is easier using the graphical interface of TWRP

the phone in fastboot mode, connected to a PC via USB,
on the PC, open a terminal from the folder where you downloaded twrp-3.7.0_11-0-FP4.img an type :

fastboot boot twrp-3.7.0_11-0-FP4.img

Thank you for your help

I put the phone in fastboot mode, and typed the command you gave. the terminal says

>fastboot boot recovery twrp-3.7.0_11-0-FP4.img
< waiting for any device >

Is there a graphical interface of TWRP for PC ? Because I can’t install anything on the phone right now

according to TWRP website :

Windows users will need proper drivers installed on their computer. You can try the simple FWUL adb/fastboot ISO or the Naked ADB drivers or the Universal ADB drivers if you don’t already have a working driver installed

is your PC running Windobe ?

regarding your posts, the cable seems working

is your bootloader unfortunaly relocked ?

No but it is full

I’ll check the drivers first

Yes Windows 11

Yep. It does

“windobe” is a french word play meaning “Win-Shit” or “Win-Stink”… and it sounds a bit like “Windows”

Yeah found that answer, corrected my post :wink:

I installed Universal ADB drivers
Rebooted PC,
rebooted phone, entered fastboot,
typed fastboot boot recovery twrp-3.7.0_11-0-FP4.img in a terminal
same < waiting for any device >
Unplugged-plugged the cable, nothing changed

“fastboot boot” is a command for a on time boot in TWRP,
“fastboot flash” is for permanent install (even if you can revert by flashing recovery-e via fastboot or via the install feature in TWRP itself)

according to TWRP website :

adb reboot bootloader

You should now be in fastboot mode.

Download the correct image file and copy the file into the same folder as your platform-tools. Rename the image to twrp.img and type:

fastboot flash recovery twrp-3.7.0_11-0-FP4.img

fastboot reboot

Note many devices will replace your custom recovery automatically during first boot. To prevent this, use Google to find the proper key combo to enter recovery. After typing fastboot reboot, hold the key combo and boot to TWRP. Once TWRP is booted, TWRP will patch the stock ROM to prevent the stock ROM from replacing TWRP. If you don’t follow this step, you will have to repeat the install.

according to my readings :

you also could try
fastboot reboot recovery

.

.

other method :

the phone in recovery mode, connected to a PC via USB, select “apply an update” → “apply from adb”
on the PC, open a terminal from the folder where you downloaded twrp-installer-3.7.0_11-0-FP4.zip an type :

adb sideload twrp-installer-3.7.0_11-0-FP4.zip

On the phone, go back to the main menu and choose advanced, reboot to recovery

not at all - if your phone hasn’t locked bootloader, you can boot into twrp on-the-fly, no flashing involved, just boot your devices twrp image and follow the examples in this thread where things worked out

fastboot boot twrp.img (no “recovery” between boot and .img file)

1 Like