TWRP Xiaomi: what partitions to backup before firmware, so as not to lose data

Backup through TWRP โ€” critical step before any manipulation of the firmware Xiaomi, whether it is the installation of custom software, unlock the bootloader or even a banal update through fastboot. Error in the selection of partitions for backup can lead to loss of personal data, disruption of the module NFC, Or even the device's "brick" when the smartphone turns into a useless "brick," but how do you know which sections are really important and which ones you can skip to save space on the memory card?

In this article, we will analyze not only the standard set of sections (boot, system, data), but also those that are often forgotten: persist (responsible for the maintenance of the system). IMEI and the serial numbers of the modules, modem (contains the modem firmware), and even a vendor, without which the cameras on some Redmi models can stop working. POCO. We will pay special attention to the โ€œpitfallsโ€ of the backup on devices with dynamic partitions, which Xiaomi has been actively implementing since 2021.

You will learn how to name backups correctly, so as not to get confused in them after six months, why you can not backup the userdata section on devices with encryption FBE (File-Based Encryption) without prior preparation, and how to restore only individual partitions if something goes wrong. And for owners of flagships like Xiaomi 13 Ultra or Mix Fold 3, we have prepared separate recommendations โ€“ these models have unique sections that you will not find in the budget Redmi.

Why backup in TWRP Xiaomi is not a luxury, but a necessity.

Many Xiaomi users mistakenly believe that backup is only needed before installing custom firmware like LineageOS or Pixel Experience. MIUI Updaters may not go according to plan, especially if youโ€™re switching between Android versions (like 12 to 13:

  • ๐Ÿ“ฑ Lose all data in Internal Storage, including photos and videos (even if they were in the cloud, the application cache cannot be restored).
  • ๐Ÿ“ก Staying out of touch due to a damaged modem partition โ€“ SIM cards will simply cease to be defined.
  • ๐Ÿ”’ Get the error "Device is corrupted" when downloading if the boot or dtbo is damaged.
  • ๐ŸŽฎ Lose the performance of sensors (gyroscope, accelerometer) due to a failure in persist.

Moreover, since 2022, Xiaomi has been actively using dynamic partitions in its devices, which means that traditional partitions like the system or vendor can be replaced with a super โ€“ a single container that is designed to be used for the purpose of creating a new system. TWRP Without special plugins or manual subdivision of super, your backup will be useless.

โš ๏ธ Attention: On devices with Android 12+ Dynamic partitions (e.g. Xiaomi 12 Pro, Redmi Note 11 Pro)+) standard backup TWRP It doesn't save critical data from super, and it requires modified versions of recovery or scripts like lpunpack.

Another common error is the backup of the userdata partition on File-Based Encryption devices (FBE). If you didnโ€™t turn off the encryption before creating a backup, it wonโ€™t be possible to restore it โ€” TWRP It just can't decrypt the data. This applies to all Xiaomi on Android 10.+.

๐Ÿ“Š How often do you backup before Xiaomi firmware?
Always, before any manipulation
Only before installing custom firmware
Only if I am updating through fastboot
I never do backups.

List of mandatory sections for backup in TWRP Xiaomi

Not all partitions are equally useful, for example, backup cache or recovery is mostly useless, and you can restore them automatically, but persistent or modem can be a serious problem. Below is the minimum set of partitions you need to backup on any Xiaomi device (including Redmi and the like). POCO):

SectionWhat it keeps.Effects of lossMandatory?
bootkernel and ramdisk (boot settings)The device will not boot or will be bootloopโœ… Yes.
dtboDevice configurations (DTBO โ€” Device Tree Blob Overlay)Sensors, cameras, speakers are not working.โœ… Yes.
modemModem firmware (basebands, IMEI)No network, no definition. SIM-mapโœ… Yes.
persistIMEI, Module serial numbers, sensor calibrationLoss of loss IMEI, The camera/gyroscope is not workingโœ… Yes.
vendorProprietary drivers and librariesCameras are not working, Wi-Fi, Bluetoothโœ… Yes.

For devices without dynamic partitions (up to Android 11), it is also recommended to backup:

  • ๐Ÿ“ system - the firmware itself (useful if you want to roll back on the previous version).
  • ๐Ÿ“ฑ Data โ€“ User data (only if encryption is disabled) FBE!).

On devices with dynamic partitions (Android 12)+) Instead of system and vendor, it's going to be a super section:

  1. Use it. TWRP Support for Dynamic Partitions (e.g., OrangeFox or SkyHawk versions).
  2. Or manually unpack super into subsections using lpunpack.

Charge the device to a minimum 50%|Download the current version TWRP forecast|Disable encryption (if you plan to backup data)|Check the vacant space for SD-card (backup takes up) 3-10 GB)|Take a screenshot of the current version MIUI (Settings โ†’ The phone)

-->

How to Backup Partitions with Dynamic Partitions (Super)

If your Xiaomi device is running on Android 12/13/14, It probably has a super section instead of the traditional system, vendor and product. TWRP can not properly backup such a section, so you will have to use workarounds.

Here are three working ways:

  1. Use modified recovery: ๐Ÿ› ๏ธ Install OrangeFox Recovery or SkyHawk TWRP โ€” They support dynamic partitions out of the box". ๐Ÿ“Œ In the backup menu, select Super (Dynamic) โ€“ recovery will automatically unpack it into subsections.

super

adb pull /dev/block/by-name/super super.img


lpunpack super.img

This will create a folder with sections. system.img, vendor.img etc. which can be separately used.

Backup via Fastboot

fastboot flash backup_super super.img


fastboot reboot

Then copy it. backup_super PC-only.

For Xiaomi devices with HyperOS (new Android 14 software), the process is complicated โ€” some modified recovery does not yet support new partition structures, in which case the only reliable way is to back up through fastboot or use the new partition structures. MIUI Official Recovery with backup (but it doesnโ€™t save all partitions).

โš ๏ธ Attention: On Xiaomi 13T Pro, Redmi K60 Ultra and other devices with UFS 4.0 The backup of the super section can take up to 20-30 Do not interrupt the process, even if recovery seems to be โ€œhangingโ€ โ€“ this is normal for high-speed memory.

What to do if TWRP I can't see the super section?
If your recovery doesn't display a super partition, it means it doesn't support dynamic partitions: 1. Install a newer version TWRP (For example, from OrangeFox). 2. Use the fastboot getvar all command to check the partition structure. If there is a super:yes string in the output, then you have dynamic partitions. 3. For emergency backup, you can use the tool payload_dumper firmware MIUI (Unpack the official fastboot-rom and extract the necessary sections).

What sections can not be backup (and why)

Some of the sections are not all equally useful. Some of them take up a lot of space, but you can restore them automatically or they don't contain critical information. Here's a list of partitions that you can skip without risking to the device:

  • ๐Ÿ—‘๏ธ cache - application cache and temporary files, restored automatically when you first download.
  • ๐Ÿ”„ Recovery is the recovery itself. If it's damaged, you can always reflash it over fastboot.
  • ๐Ÿ“ฆ metadata โ€“ service data for F2FS (File system. You can restore it via fastboot. format:f2fs /dev/block/....
  • ๐Ÿ”ง misc - system status flags (e.g. reset counter) - not critical for operation.
  • ๐Ÿ“ก Bluetooth is a Bluetooth firmware module that is restored from the vendor or official firmware.

You can also skip:

  • ๐ŸŽต dsp is the audio processor settings. It only affects the sound in the headphones, it's recovered from the stock firmware.
  • ๐Ÿ“ก Wifi is the firmware of the Wi-Fi module. Like Bluetooth, it's not critical.

However, there are two exceptions when even "unnecessary" sections are worth saving:

  1. If you are experimenting with custom cores (such as FrancoKernel or Kirisakura), the boot and dtbo backup should include all related partitions, including vbmeta (responsible for checking the integrity of the boot).
  2. On certain devices (e.g, POCO F5 or Redmi Note 12 Pro+) The metadata section contains data from Virtual A/B โ€” The loss of the system can lead to a cyclical reboot.

๐Ÿ’ก

If you're not sure if a specific section backup is needed, check its size. 10 MBs (e.g. misc, keymaster) are usually not critical (100-300 MB) or persist (5-20 MB - mandatory.

Step-by-step: how to make a backup in TWRP Xiaomi

Now, let's get to the practice. Here's a step-by-step algorithm for backing up the data. TWRP For any Xiaomi device:

  1. Preparation of the device: ๐Ÿ”‹ Charge your smartphone at least 50% (better 80%). ๐Ÿ“ Move important files from internal memory to your PC or cloud (data backup is not always reliable). ๐Ÿ”“ Turn off encryption (if you plan to backup data): go to Settings โ†’ Additionally. โ†’ Confidentiality โ†’ Encryption and Accounts and Delete PIN/password.
  2. Loading into TWRP: ๐Ÿ”„ Turn off the device. ๐Ÿ”˜ Hold the Power. + Volume Up before the logo appears MI (Some models need to be kept in place. 10-15 seconds). ๐Ÿ“ฑ If you have a request to unlock the bootloader, confirm (this is normal for first launches). TWRP).
  3. Creating a backup: ๐Ÿ“‹ Go to the Backup section. โœ… Check the sections from our list (see table above). ๐Ÿ’พ Select a location to save (preferably MicroSD or USB-OTG, Because internal memory can be encrypted). ๐Ÿ”„ Press Swipe to Backup and wait until it is completed (can take 5 to 30 minutes).

Backup check.

  • ๐Ÿ“‚ Go to the folder. TWRP/BACKUPS/[Serial number and make sure that the files are not damaged.
  • ๐Ÿ” Check the size of the archives: boot is usually 30-100 MB, data - several GB.

๐Ÿ’ก

Do not rename backup files manually! TWRP It uses a strict name structure (for example, 2026-05-20--12-34-56_boot_emmc.img). Changing the name will lead to errors in the recovery process.

Frequent errors in backup TWRP and how to avoid them

Even experienced users sometimes have problems building backups.-5 errors and ways of solving them:

Mistake.Reason.Decision
"Unable to mount /data"Encryption is on. FBE, TWRP Can't decipher the sectionTurn it off. PIN/password MIUI before loading into recovery
"Backup failed: insufficient storage"There is not enough space on the memory card.Use it. SD-map โ‰ฅ32 GB or USB-OTG
"E:unknown filesystem 'f2fs'"TWRP It does not support the file system F2FSInstall a newer version of recovery with support F2FS
Backup has been built for too long (>1 hour)Memory problems (UFS/EMMC) cable OTGCheck the cable, try another port. USB
After recovery, there is no network (IMEI reset)No backup was provided to the persist or modem partition.Restore these sections separately or run the stock modem through fastboot.

Another common problem is damaged backups, to avoid this:

  • ๐Ÿ›‘ Do not remove the memory card during the backup.
  • ๐Ÿ”‹ Do not allow the battery to be below 20%.
  • ๐Ÿ“ต Do not interrupt the process (even if recovery seems to be stalled").

If the backup is still damaged, try to restore it through ADB:

adb pull /sdcard/TWRP/BACKUPS/ [path to PC]


tar -xvf [backup name].tar

Check the integrity of the files using sha256sum.

โš ๏ธ Note: On HyperOS devices (e.g. Xiaomi 14 or Redmi) K70) Standard backup methods may not work due to the changed super structure. In this case, use the official Mi Flash Tool to create a full copy of the firmware.

FAQ: Answers to Frequent Questions about Backup TWRP Xiaomi

โ“ Can you backup only the data section without the rest?
Technically yes, but it is not recommended. The data section contains user files, but without boot, modem and persist, the device may not boot or lose communication. MIUI Backup or Swift Backup.
โ“ Why backup takes up so much space (20)+ GB)?
This is normal if you backup data (which stores all your files) or super (contains multiple subsections).To reduce the size: Eliminate data from the backup (copy files manually). TWRP (In the backup settings, select Compression: High. Remove old backups, they can take up space unnoticed.
โ“ How to restore the backup if TWRP he doesn't see the file BACKUPS?
This happens if: Folder TWRP Solution: connect the memory card to your PC and check it for errors (chkdsk in Windows). The file system of the card is not supported. Solution: format the card into a computer. FAT32 Or exFAT. The backup is made on another device. Solution: manually copy the folder. BACKUPS into /sdcard/TWRP/. If the folder is missing after the update TWRP, Try to find her on the way. /data/media/0/TWRP/.
โ“ Can I backup? TWRP Xiaomi with a blocked bootloader?
No, it's impossible. TWRP You need an unlocked bootloader. If the bootloader is locked, you can: Use the official bootloader. MIUI Backup (saves only data, not system partitions) Create backup through ADB Backup (limited functionality) Unlock the bootloader via Mi Unlock Tool (requires a Mi Account binding and a wait of 7 days). โš ๏ธ Unlocking the bootloader erases all data from the device!
โ“ How to Backup Persistent on Xiaomi with HyperOS?
On HyperOS, the persist partition can be integrated into super. To backup it: Use OrangeFox Recovery (supports HyperOS). From the backup menu, select Super (Dynamic) - recovery will automatically extract persist. super.img manually through lpunpack and find persist.img. If nothing helps, copy persist through ADB: adb shell su dd if=/dev/block/by-name/persist of=/sdcard/persist.img