New Mi Mix 2 Encryption Bug


feeskies

Members
Mar 12, 2012
15
13
Hi,

I received my xiaomi Mi Mix 2 and installed TWRP 3.1.1.0 and Xiaomi.eu rom 7.11.2.

When I try to "Encrypt Phone" it get stuck during the process (I waited for more than 4 hour).
During the process the phone restart than we see a progression bar completing and a text saying to not restart before it finishes. On this screen, we can see the notification bar with airplane mode and the hour.
After more than 4 hour i reboot the phone myslef and I have a message saying the encryption was not completed and my data are not accessible anymore. I do a format data in TWRP and I can boot in Android again (will all my data and settings gone).

I tried 4 times this process and I did a reinstallation of TWRP and also the rom without any change.

On my other phone Mi Mix 1, I have the same 7.11.2 and Chinese TWRP 3.0.2.0 and I can ecnrypt the phone in less than 5 minutes.

I need the encryption to access my company data.

Guys, can you confirm you have the same problem ?
 
Last edited:
I had the same problem on my Mi6 with the current xiaomi.eu Rom (Version V9.0.3.0.NCACNEI stable).

I tried 2 times to encrypt my device. The second time I waited for about 9 hours (over night) but nothing changed. I also had to reboot by holding the power button and the os said, that encryption was not completed.

I really like to encrypt my device. Does anybody have an idea how to fix this issue?
 
Actually, is someone is working on this ? It seems "encryption bug" is known since ages on many different Xiaomi phones.
I'am afraid we'll have to change for another model / brand if we need it for work. Me I need it to activate my Outlook professional acount.
 
I had the same issues with my mix2 with stable or beta ROM EU. I can’t install my pro email with Outlook. The encryption fails... Any idea how to solve this?
 
I have a workaround for this bug. You need to backup all your data before trying.

TL;DR: The EU rom disables force encryption by default in the ramdisk (boot.img/fstab.qcom). We simply re-enable the force encryption in boot.img. And the data partition will be automatically encrypted during the first time of flashing.

Flashable zip for enabling force encryption:
https://goo.gl/N6WviS

Steps:
1. Flash TWRP recovery and boot into the recovery mode.
2. Format /data partition. (Notice: You will lose all data, including the external storage. You need to *format* not just clear or delete. This step is for decrypting the partition.)
3. Flash the EU rom and my flashable zip as usual.
4. Reboot to system, setup a screen lock during initial setup and the partition should be encrypted (check it in the settings -> privacy).
5. Recover your personal data.

Good luck!
 
Hi,

I didn't try yet, but thanks for sharing.
Do you know why xiaomi.eu remove this from the rom ? Faster rom cause less cpu cycles ?
I will look more on this topic.

I didn't see a warning for that, like "if you use xiaomi.eu rom forget about encryption."

Thanks you
 
Hi,

I didn't try yet, but thanks for sharing.
Do you know why xiaomi.eu remove this from the rom ? Faster rom cause less cpu cycles ?
I will look more on this topic.

I didn't see a warning for that, like "if you use xiaomi.eu rom forget about encryption."

Thanks you
BTW, this workaroud only works for ROM based on Android 7.x (Nougat).

For Oreo-based MIUI (Android 8.x), the location of "fstab.qcom" has been moved to /system/vendor/etc/fstab.qcom. You need to modify that file accordingly, by changing "encryptable=ice" to "fileencryption=ice".

Edit: If you already encrypted the data partition in Nougat/Oreo MIUI, there is no need to re-format the partition when flashing the new system. The partition will be kept encrypted. But you need a recovery (TWRP) with encryption support (try @raupe 's TWRP Build 20180124-0958 or later version).
 
Last edited:
Hi guys,

I have this same problem with my Xiaomi Mi 6, and I was wondering if the patched zip file would be compatible or if it's only for Mi Mix 2 ?

Thanks
 
BTW, this workaroud only works for ROM based on Android 7.x (Nougat).

For Oreo-based MIUI (Android 8.x), the location of "fstab.qcom" has been moved to /system/vendor/etc/fstab.qcom. You need to modify that file accordingly, by changing "encryptable=ice" to "fileencryption=ice".

Edit: If you already encrypted the data partition in Nougat/Oreo MIUI, there is no need to re-format the partition when flashing the new system. The partition will be kept encrypted. But you need a recovery (TWRP) with encryption support (try @raupe 's TWRP Build 20180124-0958 or later version).
Hi, would you explaine this step by step, please.
I have now flashed @raupe twrp, formated data and flashed eu-rom (latest beta (oreo)). Should i now flash your "mix2-force-encrypt.zip" and then edit that file in "/system/vendor/etc/fstab.qcom"? Does edit happen in txt-editor?
 
Is there any way to get encryption working without wiping my phone? Don't want to wipe everything and have to set everything up again if I can avoid it.
 
BTW, this workaroud only works for ROM based on Android 7.x (Nougat).

For Oreo-based MIUI (Android 8.x), the location of "fstab.qcom" has been moved to /system/vendor/etc/fstab.qcom. You need to modify that file accordingly, by changing "encryptable=ice" to "fileencryption=ice".

Edit: If you already encrypted the data partition in Nougat/Oreo MIUI, there is no need to re-format the partition when flashing the new system. The partition will be kept encrypted. But you need a recovery (TWRP) with encryption support (try @raupe 's TWRP Build 20180124-0958 or later version).
Will this also work on Marshmallow? This bug also affects Redmi 4 Prime
 
Try this script after a clean install of xiaomi.eu Oreo 8 under the last TWRP (which supports encryption)
forum.xda-developers.com/showpost.php?p=76566067&postcount=356

it works on Mi Mix 2, the phone is indicated encrypted under android, and under TWRP you must type your PIN to decrypt the partition.
The key is a modification of the file vendor\etc\fstab.qcom

I had the same issue when trying to encrypt the phone using the default android button under xiaomi.eu. The encryption never ends.
 
Last edited:
Try this script after a clean install of xiaomi.eu Oreo 8 under the last TWRP (which supports encryption)
forum.xda-developers.com/showpost.php?p=76566067&postcount=356

it works on Mi Mix 2, the phone is indicated encrypted under android, and under TWRP you must type your PIN to decrypt the partition.
The key is a modification of the file vendor\etc\fstab.qcom

I had the same issue when trying to encrypt the phone using the default android button under xiaomi.eu. The encryption never ends.

... mhh sorry did not work for me on MIUI v9 8.5.8 for Mi MIX 2 :-/

I'll get redirected to TWRP after flashing and reboot to system.

What ROM for four MI MIX do you use in combination for this script?
Did you made any further modifications before or after running the scipt?

Thanks for your help!
 
... mhh sorry did not work for me on MIUI v9 8.5.8 for Mi MIX 2 :-/

I'll get redirected to TWRP after flashing and reboot to system.

What ROM for four MI MIX do you use in combination for this script?
Did you made any further modifications before or after running the scipt?

Thanks for your help!

Same for me, flashed 9.5.6.0 stable then this fix and it boots to TWRP every time. Had to reflash 9.5.6.0 without the fix to get it working again.
 
It's importanent to put the word "quota" behind your fstab.qcom in the userdata row.

Example:

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check,reservedsize=128M,fileencryption=ice quota
 
It's importanent to put the word "quota" behind your fstab.qcom in the userdata row.

Example:

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc wait,check,reservedsize=128M,fileencryption=ice quota

Hello berlinux!

Has it to be put at the end with an space like in your post or with an comma after "...fileencryption=ice"?
 
1. Format wipe all
2. Install new Rom with twrp
3. Reboot again Into Recovery !!!dont reboot Into System
4. Mount system
5. Adb Push fstab.qcom
6. Edit fstab.qcom
7. Adb Pull fstab.qcom
8. Dont Install First Boot magisk
9. Reboot Into System and Finish Installation
 
@berlinux
Thanks for the detailed steps!
I was trying to convert an existing install/nandroid backup to an encrypted install - sadly this is not possible this way.

Interesting side info:
With complete fresh install (and formatting & wiping all partitions) the userdata partition was autoencrypted by the xiaomi.eu 8.5.8 weekly ROM.
 
  • Like
Reactions: JackSlater
@berlinux
Thanks for the detailed steps!
I was trying to convert an existing install/nandroid backup to an encrypted install - sadly this is not possible this way.

Interesting side info:
With complete fresh install (and formatting & wiping all partitions) the userdata partition was autoencrypted by the xiaomi.eu 8.5.8 weekly ROM.
Thanks to your report I was able to get encryption working on my Mi5: the encryption button works perfectly on the xiaomi.eu v. 8.5.10. So it looks like a problem affecting recent rom versions.
Previously I had tried the solution from @berlinux but didn't work for me (the phone was stuck on the Mi logo). Thanks anyway.
Does anyone know a Nougat based rom where encryption works?
 
  • Like
Reactions: raupe