How to decrypt the Data partition in TWRP on Xiaomi: the full guide 2026

If you encounter a message like β€œData may be corrupted” or β€œUnable to mount /data” when you try to log into TWRP on a Xiaomi smartphone, it means that the user data section is encrypted, a situation typical of devices with MIUI 12+, where File-Based Encryption (FBE) encryption is activated by default. Without proper decryption, you will not be able to access files, make a backup or flash custom firmware.

In this article, we will discuss all the current ways to decrypt Data in TWRP for Xiaomi in 2026, including bypassing encryption via fastboot, using patches for OrangeFox Recovery, and manually deleting passwords. Particular attention will be paid to models with Qualcomm Snapdragon (for example, Redmi Note 10 Pro, POCO X3 Pro) and MediaTek (Redmi 9T, POCO M3), where the encryption algorithms are different.

We warn you that the wrong actions can lead to complete loss of data or a device blink. If you are not sure of your skills, contact a specialist. All manipulations you perform at your own risk.

Why is the Data in TWRP on Xiaomi encrypted?

Starting with Android 10 (and MIUI 12), Xiaomi has implemented mandatory FBE (File-Based Encryption) encryption of the Data partition, meaning that each file is encrypted separately using a unique key tied to:

  • πŸ”‘ Password/pattern lock of the user (if installed).
  • πŸ“± The hardware key in the chip. eMMC/UFS (unique to each device).
  • πŸ”„ Firmware versions (when updated) MIUI keys can change).

TWRP (especially in unofficial builds) often lacks FBE decryption support, so the /data partition appears corrupted. This is not a recovery error, but a feature of Xiaomi's protection.

On models with MediaTek (for example, Redmi 9A, POCO C31) additionally uses encryption via keymaster - a hardware security module that blocks access to keys without the correct bootloader unlock.

⚠️ Note: If you reset your device via fastboot with the fastboot erase userdata command, but you didn’t delete the file /data/misc/vold/, The encryption will remain active, and TWRP It will still not be able to install the section.

How to decrypt Data in TWRP on Xiaomi

There are 5 basic methods for decrypting /data partitions in TWRP. The choice depends on the device model, the version of MIUI and the availability of a backup. Let's consider each in detail.

1. Use of an official password

If you know the password or pattern lock that was installed on the device, try entering it directly into TWRP:

  1. Download to TWRP (hold Power + Volume Up).
  2. Press Cancel when you request a password (if it appears).
  3. Go to Mount β†’ Enable MTP.
  4. Go back to the main menu and select Advanced β†’ Terminal.
  5. Enter the command: twrp decrypt [your password]

If the command is successful, the /data partition will be mounted, which works on 70 percent of Qualcomm devices, but rarely works on MediaTek.

πŸ“Š What is the processor in your Xiaomi?
Qualcomm Snapdragon
MediaTek Helio/Dimensity
Other (specify in the comments)
I don't know.

2. Install a patch for TWRP (OrangeFox or PitchBlack)

Standard. TWRP supportive FBE-decryption on new versions MIUI. The solution is to use modified recovery:

  • 🦊 OrangeFox Recovery – supports decryption for most Xiaomi models (including: POCO X3 NFC, Redmi Note 11).
  • πŸ–€ PitchBlack Recovery – Optimized for MediaTek (e.g. Redmi 9 Power).

Installation instructions:

Download the latest version of OrangeFox for your model from [official website](https://orangefox.download)

Rename the file to recovery.img

Download fastboot (Power + Volume Down)

Fastboot flash recovery recovery.img

Reboot Recovery (Fastboot Reboot Recovery)

-->

Once installed, OrangeFox will automatically prompt you to enter your password when you mount /data. If you don't have a password, move on to the next method.

3. Data Formatting (total data loss!)

If access to the data is not critical, you can format the partition by removing the encryption.

  • πŸ”„ Devices after reset via fastboot.
  • πŸ“¦ Smartphones before customization firmware ROM (For example, LineageOS).

Instructions:

  1. In TWRP, go to Wipe β†’ Format Data.
  2. Enter yes to confirm.
  3. Reboot to recovery and check the mounting /data.

⚠️ Note: This method deletes all data, including photos, messages and apps. If the device has been enabled Mi Account, after formatting, you may need authorization to unlock.

4. Delete encryption files via ADB

For power users, there is a way to remove encryption keys through ADB without formatting the partition completely.

  • πŸ”“ Device unlocked (OEM Unlock on).
  • πŸ“ Have access to fastboot or ADB sideload.

Follow the commands:

adb shell


rm -rf /data/misc/vold/*




rm -rf /data/misc/keystore/*




rm -rf /data/misc/gatekeeper/*




reboot recovery

Once rebooted to TWRP, the /data partition must be mounted without a password.This method does not guarantee 100% success on MIUI 14+.

5. Use of script disable_dm-verity_forceencrypt

For Android devices 11+ (for example, Xiaomi 11T, POCO F4) You can turn off the forced encryption through a special script. disable_dm-verity_forceencrypt.zip and run it through TWRP:

  1. Download the archive and transfer it to the device.
  2. V TWRP Choose Install β†’ Select an archive β†’ Swipe to confirm.
  3. Reboot to recovery and check the mounting /data.

The script modifies fstab files, disabling automatic encryption when downloaded. It does not work on devices with a locked bootloader!

What to do if the script doesn’t work?
If after the firmware disable_dm-verity section /data It's not mounting anyway, try it: 1. Switching Magisk (sometimes helps you bypass restrictions). 2. Delete files /data/unencrypted/ through ADB. 3. Use an alternative recovery, such as SkyHawk Recovery (for new Xiaomi models).

Table of compatibility of decryption methods

MethodQualcomm (Snapdragon)MediaTek (Helio/Dimensity)Do you need a password?Data loss?
Entering a password in TWRPβœ… Yes.❌ No (rarely)βœ… Yes.❌ No.
OrangeFox/PitchBlackβœ… Yes.βœ… Yes.βœ… Yes.❌ No.
Formatting Dataβœ… Yes.βœ… Yes.❌ No.βœ… Complete.
Removal of keys through ADBβœ… Yes.⚠️ Partially.❌ No.⚠️ Possible.
Script disable_dm-verityβœ… Yes.❌ No, nah. MTK)❌ No.❌ No.

For MediaTek devices (such as the Redmi Note 10 with the Helio G88), most often only full formatting or OrangeFox firmware with pre-unlocking the bootloader helps.

Frequent mistakes and their solutions

When you decrypt Data into TWRP, users are faced with typical problems.

1. Unable to mount /data error after entering password

Reasons:

  • πŸ”„ Wrong version TWRP (obsolete or incompatible with MIUI).
  • πŸ”‘ The password contains Cyrillic symbols or special characters (for example, @#$).
  • πŸ“± The device was reset via Mi Cloud and the encryption keys reset.

Decision:

  • πŸ”§ Please contact OrangeFox Recovery (see section above).
  • πŸ”€ Try to enter the password in the English layout.
  • πŸ”„ Run fastboot erase userdata, then try again.

2.TWRP asks for password, but it never was

This is because of the automatic encryption in MIUI, even if the user has not set the password.

  • πŸ”“ Use an empty password (just press Enter in the terminal) TWRP).
  • πŸ“ Delete key files through ADB (see section 4).
  • πŸ”„ Please. disable_dm-verity and reboot.

3. After decrypting the Data, the phone does not boot

If after manipulation with /data, the device hangs on the logo or goes to the bootloop, the reasons may be as follows:

  • πŸ”§ Incompatible version TWRP damaged the fstab.
  • πŸ“¦ Critical files are deleted in /data/misc.
  • πŸ”„ The firmware was interrupted.

Decision:

  1. Sweep the stock firmware through fastboot:
  2. If it doesn’t work, do a full reset via the Mi Flash Tool.

πŸ’‘

If you have decrypted /data in TWRP applications (such as Google Play) stop working, clear the cache and dalvik via Wipe β†’ Advanced Wipe β†’ Cache + Dalvik.

How to Avoid Encryption Problems in the Future

To avoid mounting data errors in TWRP, follow these guidelines:

  • πŸ”“ Turn off encryption before installing custom recovery: C Settings β†’ Additionally. β†’ Privacy disable Encryption of the device. perform reset to factory settings (required!).

Use OrangeFox

TWRP

MIUI

Don't update MIUI

/data

Create a key backup

ADB

adb pull /data/misc/vold/ vold_backup

If you experiment with firmware often, consider disabling FBE through a modified kernel (like KernelSU).However, this requires an unlocked bootloader and may disrupt some features (like Google Pay).

πŸ’‘

On Android 12+ and MIUI 13+ devices, it is almost impossible to disable encryption without losing data. The only reliable way is to format /data and disable passwords in the future.

FAQ: Frequent questions about decrypting data in TWRP

Can I decrypt Data without losing data if I forget my password?
No, if you've forgotten your password, you can't decrypt it without formatting. The encryption keys are tied to the password, and without it, access to the data is locked at the hardware level. The only way out is to reset the device via fastboot erase userdata, but that will delete all the data.
Why is OrangeFox Data not mounted after firmware?
The reasons may be as follows: πŸ”§ The wrong version of OrangeFox (download the build just for your model). πŸ”‘ The device was reset via Mi Cloud and the encryption keys reset. πŸ“± The device has activated an anti-rollback function that blocks access. Solution: try flashing. disable_dm-verity, Then re-mount.
Can Data be decrypted on Xiaomi with a locked bootloader?
No, most methods require an unlocked bootloader. TWRP, But it only works if recovery is supported. FBE-On locked devices, the only option is an official reset via the Mi Flash Tool.
What if after decrypting the Data, the phone asks for a Mi Account?
This is because the device is linked to the Mi Account: πŸ”“ Enter the account that was linked to the phone. πŸ“§ If your account is deleted, contact Xiaomi with proof of ownership. πŸ”§ To bypass protection (at your own risk) can be used EDL-Mode and flash stock firmware through Mi Flash Tool with the option clean all.
Does Magisk support data decryption in TWRP?
Magisk doesn't decrypt /data by itself, but it can help bypass some limitations, like when you run a firmware, Magisk sometimes manages to mount /data into TWRP if you've previously deleted the encryption keys, but it's not a guaranteed method.