[Solved] Unable to mount '/data' partition, unable to re-encrypt system | LCD replaced after phone flooding.

Search This thread


Aug 25, 2018
// Update (Original problem described in the bottom of the post)

So I have actually tried a lot of different things, in the end I wiped the encrypted storage and everything else using TWRP however I have another bizarre problem - whatever ROM I flash it doesn't boot, there is only black screen.

Trying to repair the '/data' filesystem or change it from ext4 to ext2 and back in TWRP gives an error:
Failed to mount '/data' (Operation not supported on transport endpoint)
Unable to mount storage
Trying to 'Repair or Change File System' in TWRP for 'Internal storage' gives an error (maybe because its really '/data/media' folder? - https://twrp.me/faq/datamedia.html):
Invalid partition selection

'/data' (partition) = 'userdata' in parted = whole internal storage
'/data/media' (folder, virtual parittion?) = sdcard = user files in internal storage

It looks like after every system boot, filesystem change or repair, '/data' (internal storage?) gets unmounted and can't be mounted back. I used 'parted' and `adb shell` to recreate `/data` partition manually (called `userdata` in parittion table) but it didn't help:

adb push parted /
chmod 755 parted
adb shell
cd /dev
/parted block/mmcblk0
unit b
rm 50
mkpart primary 5570568192 62537055743
name 50 userdata
mke2fs -t ext4 /dev/block/mmcblk0p50

Discarding device blocks: done
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3481600 inodes, 13907833 blocks
695391 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
425 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

My partition table looks like this, I don't know what to make of it:
Number  Start   End     Size    File system  Name          Flags
 1      67.1MB  155MB   88.1MB  fat16        modem
 2      201MB   201MB   1024B                fsc
 3      201MB   201MB   8192B                ssd
 4      201MB   202MB   524kB                sbl1
 5      202MB   202MB   524kB                sbl1bak
 6      202MB   203MB   524kB                rpm
 7      203MB   203MB   524kB                rpmbak
 8      203MB   206MB   2097kB               tz
 9      206MB   208MB   2097kB               tzbak
10      208MB   208MB   262kB                devcfg
11      208MB   208MB   262kB                devcfgbak
12      208MB   225MB   16.8MB  ext4         dsp
13      225MB   227MB   1573kB               modemst1
14      227MB   228MB   1573kB               modemst2
15      268MB   268MB   32.8kB               DDR
16      268MB   270MB   1573kB               fsg
17      270MB   270MB   16.4kB               sec
18      336MB   347MB   11.5MB               splash
19      403MB   404MB   1049kB               aboot
20      404MB   405MB   1049kB               abootbak
21      405MB   472MB   67.1MB               boot
22      472MB   539MB   67.1MB               recovery
23      539MB   540MB   1049kB               devinfo
24      540MB   3761MB  3221MB  ext2         system
25      3825MB  4094MB  268MB   ext4         cache
26      4094MB  4127MB  33.6MB  ext4         persist
27      4127MB  4128MB  1049kB               misc
28      4128MB  4129MB  524kB                keystore
29      4129MB  4129MB  32.8kB               config
30      4129MB  4397MB  268MB                oem
31      4429MB  4429MB  32.8kB               limits
32      4496MB  4497MB  524kB                mota
33      4497MB  4498MB  1049kB               dip
34      4498MB  4531MB  33.6MB               mdtp
35      4531MB  4532MB  524kB                syscfg
36      4532MB  4536MB  4194kB               mcfg
37      4563MB  4564MB  131kB                lksecapp
38      4564MB  4564MB  131kB                lksecappbak
39      4564MB  4564MB  262kB                cmnlib
40      4564MB  4564MB  262kB                cmnlibbak
41      4564MB  4564MB  262kB                cmnlib64
42      4564MB  4565MB  262kB                cmnlib64bak
43      4565MB  4565MB  262kB                keymaster
44      4565MB  4565MB  262kB                keymasterbak
45      4631MB  4631MB  262kB                apdp
46      4631MB  4631MB  262kB                msadp
47      4631MB  4631MB  8192B                dpo
48      4631MB  4698MB  67.1MB               logdump
49      4698MB  5571MB  872MB   ext2         cust
50      5571MB  62.5GB  57.0GB  ext4         userdata

I am confused because it should be more than enough.

Summary: I can flash ROMs and other things, they install without errors but to do that I have to first use TWRP's 'Format Data' each time and Reboot to Recovery. After that '/data' can be mounted properly in TWRP. Every time I try to do anything with the partition under TWRP it "dismounts" and can't be mounted back, if I try to boot the installed ROM (clean, any) instead, I end up with a Black Screen which rebooted to recovery again prevents '/data' from being mounted (until another 'Format Data').

I have also tried older versions of TWRP (to no avail) and newest OrangeFox recovery (touch doesn't work, presumably due to the original problem).


I really need your help guys, will be grateful for any assistance.

My `XIaomi Redmi 5 Plus` was accidentally flooded. I disassembled it completely, checked the parts, soaked and cleaned with 99% isopropyl alcohol, then waited for it to dry completely.

I have also replaced screen into this: https://allegro.pl/oferta/wyswietlacz-ekran-lcd-ramka-xiaomi-redmi-5-plus-8501826695?snapshot=MjAyMi0wMS0yMVQwMjoxNjo1Ny40NDRaO2J1eWVyOzUyNDA1ZTkzODY3MTkzYTRlYTVlOGZkYjM3OGIwZDJjOTQ0NGI4MmZiM2Y1MmQ4MGMzYjZlNGU4ODdkNzA1MjU=

I have `lineage-15.1-20180526-UNOFFICIAL-vince` ROM installed since 2018: https://forum.xda-developers.com/t/...al-lineageos-15-1-updated-26-05-2018.3780298/ (I am not sure if this is the correct version, I can provide the file if necessary)
Also TWRP and Magisk
My Android is encrypted and incompatible with TWRP decryption since day one (its a bug apparently).

Everything works except touch on Android (pre-boot auth screen), to my astonishment touch works under TWRP), I also have adb access.

Dirty and clean flashing different ROMs and kernels didn't fix the issue.
Last edited:


Aug 25, 2018
For future reference I fixed this issue with Black Screen by flashing the newest MIUI firmware (not ROM), it appears that firmware partition had to be corrupted or my firmware was too old.

Here is the file: https://xiaomifirmwareupdater.com/miui/vince/stable/V11.0.2.0.OEGMIXM/

As for the issue with inability to mount storage ('/data') partition:
- As stated earlier it doesn't work in any version of TWRP at the moment
- I tried OrangeFox Recovery - touch not working.
- I tried Pitch Black Recovery and it mounts correctly: https://pitchblackrecovery.com/vince/

You see even if I was able to correctly boot my ROM I still had to mount '/data' because it turned out that trying to encrypt back my phone I was experiencing the issue described here: https://forum.xda-developers.com/t/encrypting-just-reboots-the-phone.3405513/, caused by "Orig filesystem overlaps crypto footer region. Cannot encrypt in place." error.

It needs 16 kb of free space so I had to use 'resize2fs' which didn't work in TWRP with the parittion being unmountable.

`Pitch Black` (PERP) uses slightly newer 'resize2fs' (and entire suite including it) version (TWRP: resize2fs 1.42.9 (28-Dec-2013), PERP: resize2fs 1.43.3 (04-Sep-2016)), so I imagine this is what allowed me to move forward.

Installing `Pitch Black` has also fixed a long standing issue with broken encoding in 'adb shell' btw.

I backed everything up and tried to use the tool above:

vince:/ # resize2fs /dev/block/mmcblk0p50 57G
resize2fs 1.43.3 (04-Sep-2016)
The containing partition (or device) is only 13907833 (4k) blocks.
You requested a new size of 14942208 blocks.

Now I had more info:

4 k (kb) = 4 * 1024 b = 4096 b
partition has: 13907833 blocks = 4096 b * 13907833 = 56966483968 b
we need 16 kb of free space: 16 * 1024 b = 16384 b
new size is: 56966483968 b - 16384 b = 56966467584 b
in blocks: 56966467584 b / 4096 b = 13907829 blocks

Resizing threw:
resize2fs 1.43.3 (04-Sep-2016)
Please run 'e2fsck -f /dev/block/mmcblk0p50' first.

So I ran:
1|vince:/ # e2fsck -f /dev/block/mmcblk0p50
e2fsck 1.43.3 (04-Sep-2016)
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found.  Fix<y>? y
Inode 1368088 was part of the orphaned inode list.  FIXED.
Inode 2121750 was part of the orphaned inode list.  FIXED.
Inode 2121751 was part of the orphaned inode list.  FIXED.
Inode 2121754 was part of the orphaned inode list.  FIXED.
Inode 2121755 was part of the orphaned inode list.  FIXED.
Inode 2121756 was part of the orphaned inode list.  FIXED.
Inode 2121757 was part of the orphaned inode list.  FIXED.
Inode 2121768 was part of the orphaned inode list.  FIXED.
Inode 2121769 was part of the orphaned inode list.  FIXED.
Inode 2121802 was part of the orphaned inode list.  FIXED.
Inode 2121803 was part of the orphaned inode list.  FIXED.
Inode 2121828 was part of the orphaned inode list.  FIXED.
Inode 2121829 was part of the orphaned inode list.  FIXED.
Inode 2121889 was part of the orphaned inode list.  FIXED.
Inode 2121890 was part of the orphaned inode list.  FIXED.
Inode 2121892 was part of the orphaned inode list.  FIXED.
Inode 2121940 was part of the orphaned inode list.  FIXED.
Inode 2121941 was part of the orphaned inode list.  FIXED.
Inode 2121943 was part of the orphaned inode list.  FIXED.
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/block/mmcblk0p50: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p50: 20071/3481600 files (2.9% non-contiguous), 2729092/13907833 blocks

After that the resize was successful:
1|vince:/ # resize2fs /dev/block/mmcblk0p50 13907829
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/block/mmcblk0p50 to 13907829 (4k) blocks.
The filesystem on /dev/block/mmcblk0p50 is now 13907829 (4k) blocks long.

After that the encryption was successful, so 16 kb is all you need indeed (for the record I probably caused this issue by manually recreating '/data' parittion from the terminal).

Next was the problem with battery life decreased by 75% (it entirely discharged in 8 hours).

At first I used aggressive profiles and Naptime on top of it (I measure iwith Accubattery). Slow charging over USB was actually draining the battery instead of replenishing it.

It turns out that there must be a Bug in crDroid 7.13 (Android 11) because as soon as I disabled (ironically) battery management for all apps and battery saver (even with Naptime enabled) it dropped drastically.

Settings > Battery > Manage Apps Automatically > Off

Now I found out that speaker doesn't work...

..and the battery is still being drained way too fast.
Last edited: