How to completely clean Xiaomi before selling: delete data irrevocably

Selling a Xiaomi smartphone is not only a matter of price and presentable appearance of the device, but also a guarantee of the security of your personal data. Even after a standard reset to factory settings, experienced attackers can recover photos, correspondence or passwords using specialized software. In this article, we will discuss how to properly prepare Xiaomi for sale to prevent leakage of information and avoid problems with the new owner.

Xiaomi phones are deeply integrated with the Mi Account ecosystem, which connects the device to cloud services, payment systems, and even a smart home. Simply deleting files is not enough: untie the account, deactivate MIUI protection, and make sure the reset is error-free. We'll look at all the steps from backing up to checking the device after cleaning.

Why a routine reset is not enough: the risks of data recovery

Many users mistakenly believe that the factory reset option in Xiaomi's menu completely erases information.

  • ๐Ÿ“ Files remain on the disk โ€“ reset only removes links to them in the file system. Special utilities (for example, DiskDigger or Recuva) can recover up to 80% of data.
  • ๐Ÿ”‘ Logins and passwords are saved โ€“ browsers, messengers and applications often cache authorization data in protected memory areas.
  • ๐Ÿ“ฑ Mi Account remains tied โ€“ the new owner will not be able to activate the device without your login / password (risk of locking through Find Device).

V 2023 In the past year, researchers from Kaspersky conducted an experiment: 10 Xiaomi smartphones after reset and recovered from them more 3000 photo, 500 The reason is the lack of full disk encryption and the use of outdated cleaning methods (for example, fastboot erase userdata without a flag). --force).

โš ๏ธ Note: If you sell Xiaomi with an unlocked bootloader, an attacker can reflash the device and access your backups in the Mi Cloud. Be sure to check the lock status through the fastboot oem device-info command.

Step 1: Backing up important data

Before cleaning, save everything you need. Xiaomi has built-in redundancy tools, but they don't cover all scenarios:

  • โ˜๏ธ Mi Cloud โ€“ automatically syncs contacts, notes, photos (if enabled). โ†’ Mi Account โ†’ Mi Cloud.
  • ๐Ÿ“ฑ Local copy โ€“ created through Settings โ†’ The phone. โ†’ Backup. Select "System Data" and "Applications".
  • ๐Ÿ’พ Manual copying โ€“ transfer to PC or external drive: Folder DCIM (Photo/video) Downloads folder (downloads) Files from Android/data (play-off)

What is NOT automatically saved:

  • ๐Ÿ” Wi-Fi Passwords (Export through Settings) โ†’ Wi-Fi โ†’ Save networks).
  • ๐ŸŽฎ Save games (use Google Play Games or manual copying).
  • ๐Ÿ“ SMS/MMS (apps SMS Backup & Restore will help you).

Synchronize with Mi Cloud|Create a local backup copy|Copy the folder. DCIM PC-only|Exporting Wi-Fi passwords|Save. SMS third-party|Checking game saves-->

If you use Google Photos for backup, make sure all media files are uploaded in their original quality. Open the app, go to Settings โ†’ Backup and Sync, and check status.

Step 2: Delete your Mi Account and untie your device

The most common mistake when selling Xiaomi is forgetting to exit the Mi Account, which leads to:

  • ๐Ÿšซ Locking the device via Find Device (new owner will not be able to use the phone).
  • ๐Ÿ”„ Automatically synchronize your data to someone elseโ€™s device.
  • ๐Ÿ’ณ Access to Mi Pay and other payment services.

Step-by-step:

  1. Open Settings โ†’ Accounts and Sync โ†’ Mi Account.
  2. Click on your profile and select Delete Account.
  3. Enter the password for confirmation.
  4. Reset the device.

If the option to delete the account is inactive:

  • ๐Ÿ”ง Check if the unlock is enabled OEM In Settings โ†’ For developers (if not, turn on and try again).
  • ๐Ÿ“ถ Make sure your phone is connected to the internet (required to be checked by Xiaomi server).
  • ๐Ÿ”„ Try to delete your account through the web version of Mi Account (Device Management section").

โš ๏ธ Note: On Xiaomi models with MIUI 14+ After deleting the account, you may need to enter a password the next time you log in to Settings โ†’ It's normal -- that's how theft protection works.

๐Ÿ’ก

If your phone is locked after deleting your account, try resetting it via fastboot with a flag. --erase_frp. This will remove the link to the Google account (FRP).

Step 3: Complete reset to factory settings

Now, to reset itself, Xiaomi has two ways:

MethodAdvantagesDeficienciesSuitable for
Through the settings menuJust, it doesn't require a PC.It is not always possible to delete data completely.Models on MIUI 12-14
Through fastboot.Guaranteed removal of all sectionsRequires a computer and driversAll models, especially those with unlocked bootloader
Through Recovery.It works without a PC, clears the cacheDoes not delete Mi Account on new firmwareDevices with a locked bootloader

Method 1: Reset via Settings (for most users)

  1. Go to Settings โ†’ About the phone โ†’ Reset settings.
  2. Choose to erase all data.
  3. Check the box to clear internal memory (if you have an option).
  4. Confirm the action and wait for the reboot (it will take 5-10 minutes).

Method 2: Reset via fastboot (maximum cleaning)

This is a method that's suitable for advanced users, and you'll need to:

  • A computer with ADB/Fastboot drivers installed.
  • USB Type-C cable (original)
  • Unsealed Platform Tools from Google.
fastboot devices # Check the connection


fastboot erase userdata # Deletion of user data




fastboot erase cache #Cache cleanup




fastboot erase frp # Delete FRP (Google account)




fastboot reboot

For models with Dynamic Partitions (e.g. Xiaomi 12/13), use:

fastboot erase --all

โš ๏ธ Note: On certain devices (e.g, POCO F5) The fastboot erase userdata command can lead to a "brick" (unbootable state) if you do not first unlock the bootloader. XDA Developers.

Through the settings menu | Through Recovery | Through fastboot |I don't know what this-->

Step 4: Checking the device after resetting

Don't rush to hand over the phone to the customer, make sure all data is deleted.

  • ๐Ÿ“ฑ First start โ€“ the device must prompt you to select a language and region, as in the first setup.
  • ๐Ÿ” Memory Check โ€“ Open the File Manager and make sure the folders are DCIM, Downloads and Android are empty.
  • โ˜๏ธ No Accounts โ€“ in Settings โ†’ Accounts should not be linked to Mi Account or Google.
  • ๐Ÿ”’ Security โ€“ Enable Find Device through your new account and check that the old owner canโ€™t remotely lock the phone.

For a thorough check:

  1. Install DiskUsage from Google Play, and it shows you occupied space, and if you have more than 1-2 GB of data taken after reset, the data is not completely deleted.
  2. Connect your phone to your PC and check through ADB: adb shell ls /data/data The folder should be empty (except for system files).
How to check residual data through ADB?
1. Connect the phone to the PC with debugging enabled USB (Settings โ†’ For developers โ†’ Debugging by USB). 2. Enter the command: adb shell su -c "find /data -type f | wc -l" If the result > 1000, The data is not completely deleted. To clean it completely, repeat the reset via fastboot with the flag. --force.

Step 5: Additional Security Measures (for Paranoids)

If you sell a phone with sensitive information (like a Xiaomi worker), a standard reset isn't enough.

  • ๐Ÿ” Encrypting data before reset: Go to Settings โ†’ Security โ†’ Encrypt your phone. Set your password and wait until it's done (it can take an hour.

Replacement of IMEI (for experienced)

Redmi Note 10 Pro

POCO X3

#

#

Physical clean-up

eMMC

Xiaomi

dd

ADB

adb shell


su




dd if=/dev/zero of=/dev/block/mmcblk0 bs=1M

โš ๏ธ It will destroy all partitions, including firmware! Use only if you are confident in your actions.

Which won't help:

  • โŒ Delete files manually โ€“ they remain in memory and are restored.
  • โŒ Recovery formatting without fastboot โ€“ does not affect system partitions.
  • โŒ Use Clean Master Apps โ€“ They Only Clear Cache.

FAQ: Answers to Frequent Questions

Can I sell Xiaomi without deleting my Mi Account?
Technically, it is possible, but the new owner will not: Activate the device after the reset (you will need your login / password); use Mi Cloud, Mi Pay and other services; Update the firmware (on some models); You also risk that a buyer will block your current phone through Find Device if you have multiple devices on the same account.
How to check if your phone is completely cleaned?
Here are 3 reliable ways: Visual inspection โ€” after reset, your phone should not have your photos, apps or accounts. Check through ADB โ€” connect your phone to your PC and do: adb shell ls /data/app The folder should be empty. Recovery test โ€” use DiskDigger (free version). If it finds your files, the reset failed.
What if the phone asks for an old Mi Account after a reset?
This means that: You did not delete your account before resetting. Factory Reset Protection (FRP) is enabled on the device. Solutions: Enter your Mi Account, then delete it and reset it. If you do not remember the password, restore it on the Mi Account website. For models with an unlocked bootloader, you can reset FRP via fastboot: fastbootse era frapbootse config If nothing helps, contact the Xiaomi service center with documents on your phone.
Should I take it out? SIM-map SD-pre-reset?
I will, the reason: SIM-Card: This includes your number, contacts and SMS. Even after the phone is dropped, the data SIM remain. SD-card - does not clear when reset via the menu. It can be formatted separately in the phone (Settings) โ†’ Memory. โ†’ Format SD-It's more reliable to do it on a PC. If you're selling a phone with a computer. SD-Format it in exFAT format or FAT32 via computer, this will eliminate file recovery.
How to clean up Xiaomi if it doesnโ€™t turn on?
If the phone is locked, the screen is broken or does not respond to buttons, try: Hard reset via Recovery: Turn off the phone (clip the power supply). + Volume up for 10 seconds. Press power down. + Volume up until the Mi Recovery logo appears. select Wipe Data โ†’ Wipe All Data (volume button control) Reset via fastboot (if the phone is determined by a PC): fastboot erase userdata fastboot erase cache fastboot reboot Calling service - if the phone does not respond to buttons, the motherboard may be damaged. In this case, the data cannot be restored. โš ๏ธ If the screen is broken, but the phone turns on, connect it to the PC through ADB and perform reset command: adb reboot recovery