How to erase all data from Xiaomi before selling: the complete guide

Selling a Xiaomi smartphone is a big step, especially if you're looking at a big memory model that has been accumulating photos, correspondence, banking data and other sensitive information for years, and even after a standard factory reset, some of the data can be recovered using specialized software. Why is this happening?

The point is that the operating system MIUI (Like any other Android shell, it doesn't physically erase files -- it only labels memory sectors as "free," leaving the possibility for recovery:

  • ๐Ÿ“ธ Photos and videos in internal memory (including hidden folders.thumbnails and DCIM/.hidden)
  • ๐Ÿ’ฌ Message logs from messengers (even deleted messages in WhatsApp or Telegram)
  • ๐Ÿฆ Cash of banking applications (for example, Sberbank Online or Tinkoff)
  • ๐Ÿ“ Geolocation data from com.google.android.gms and com.miui.location

In this article, we will discuss three levels of cleanup: basic (for most users), advanced (with data encryption), and expert (with physical memory wiping), and you will learn how to check if files are deleted without recovery.

1.Reset preparation: what to do before data deletion

Before you start cleaning, follow a few critical steps, and skipping them can result in your Mi Account being unable to recover after you reset (if you forgot your password) or losing access to Google Play purchases.

Delete all Google accounts (Settings) โ†’ Accounts)

Unlock the device from Mi Account (Settings) โ†’ Mi Account โ†’ Delete the account)

Backup important data (Settings โ†’ Additional โ†’ Backup)

Get out. SIM-microSD card and memory card (if any)

Record the IMEI of your phone (type *#06#)

-->

Pay special attention to the Mi Account deletion clause, if you are selling a phone with a Xiaomi account tied, the new owner will be able to:

  • ๐Ÿ”“ Unlock the device through your email/phone (if you know the password)
  • ๐Ÿ›’ Get your shopping notifications at the Mi Store
  • ๐Ÿ“ฑ Use Find Device features to track your phone

โš ๏ธ Note: If you forget the password from Mi Account, you can reset it only through the official website account.xiaomi.com. After resetting the phone without detachment of the account, the new owner will see a request to enter your data when you first turn on (Mi Account Lock).

Also check if the phone is linked to a mobile operator (such as MTS Bonus or Beeline Subscriptions) and some rates are automatically renewed and payments can be charged to your card even after the device is sold.

2.Basic reset: how to make Factory Reset on Xiaomi

The standard factory reset is the minimum necessary procedure before the sale.

  • ๐Ÿ“ฑ All installed applications and their data
  • ๐Ÿ“ Personal files in internal memory (except system files)
  • ๐Ÿ”ง System settings (Wi-Fi, Bluetooth, wallpaper, etc.)

However, as mentioned earlier, files are not physically erasedโ€”they can be restored by programs like DiskDigger or Recuvaโ€”but without this step, there is no point in further manipulation.

Method 1: Through the settings menu

The easiest method available on all Xiaomi, Redmi and other models POCO:

  1. Open the Settings. โ†’ The phone.
  2. Tap 7 times on the item Version MIUI, to activate the developer mode (optional, but useful for the following steps)
  3. Return to the main settings menu and select Additional โ†’ Recovery and Reset
  4. Click Reset Settings โ†’ Delete all data
  5. Enter. PIN-code or pattern lock, confirm the action

Method 2: Recovery Mode (if the phone is not turned on)

If your smartphone is locked or not booting, use the Restore mode:

  1. Turn off your phone (press the Power + Volume Up for 10 seconds)
  2. Hold on to the Power. + Volume Up before the Mi logo appears
  3. In the Recovery menu, select Wipe Data (manage โ€“ volume buttons, confirmation โ€“ Power)
  4. Confirm the action, wait until the completion (usually 1-3 minutes)
  5. Select Reboot to Reboot

๐Ÿ’ก

If after reset, the phone asks to enter a password from the previous Google account (FRP-locking, so you didn't delete it beforehand. Solution: enter the data or perform a bypass. FRP via Fastboot (instructions are available on the 4PDA).

3. Advanced Cleanup: Encrypting Data Before Resetting

To make it harder to recover files, you can encrypt internal memory before resetting, and this is effective because:

  • ๐Ÿ” Data is encrypted using a key that is erased when Factory Reset is used.
  • ๐Ÿ›ก๏ธ Without a key, decryption is almost impossible (even for professionals)
  • โšก It works for all Xiaomis with MIUI 9+ Android 7.0+

Encryption instructions:

  1. Charge your phone to at least 80% (the process takes 30-60 minutes)
  2. Go to Settings. โ†’ Additionally. โ†’ Encryption and credentials
  3. Select Encrypt Phone (if the option is inactive, install it). PIN-code)
  4. Follow the instructions on the screen (you will need to enter a password 2-3 times)
  5. After the encryption is complete, perform Factory Reset (see Section 2)

โš ๏ธ Note: Encryption will only delete data when reset if you use File-Based Encryption (FBE), which is activated by default in new versions MIUI. Older devices (until 2018) may require manual setup.

To check the type of encryption enter in the terminal (rights required) ADB):

adb shell getprop ro.crypto.type

If the file answer is correct, if the block method is less reliable, then it is better to use physical rubbing (see section 4).

Expert method: physical erasure of memory

For maximum certainty that data recovery is impossible, use full wiped internal memory with random data (wipe).

  • ๐Ÿ“ฑ Phones with sensitive information (working devices, business phones)
  • ๐Ÿ”ง Devices that are sold through bulletin boards (high risk of fraud)
  • ๐Ÿ› ๏ธ Models with old versions MIUI (until 2019, where encryption is unreliable

This will require:

  • ๐Ÿ–ฅ๏ธ Computer with installed ADB and Fastboot
  • ๐Ÿ”Œ Cable USB Type-C (original, undamaged)
  • ๐Ÿ“„ Unlocked Bootloader โ€“ If not, follow Xiaomiโ€™s instructions

Step-by-step:

  1. Activate Developer Mode (see Section 2) and enable Debugging by USB In Settings โ†’ Additionally. โ†’ For developers
  2. Connect your phone to your PC and execute the command: adb reboot bootloader
  3. After you switch to Fastboot, type in: fastboot erase userdata fastboot erase cache
  4. For complete wiping (3-5 passes with random data): fastboot format:ext4 userdata
  5. Reboot the phone: fastboot reboot
Team team.What's he doing?Implementation time
fastboot erase userdataRemove the section with user data10โ€“30 seconds
fastboot format:ext4 userdataFormats a data-brushing section5-15 minutes (depending on the amount of memory)
fastboot oem lockBlocks the bootloader (optional, for security)5 seconds

โš ๏ธ Attention: The fastboot erase and fastboot format commands permanently delete all data, including system files, and once they are executed, the phone will stop loading until the firmware is re-booted. Use only if you are confident in your actions!

What if the phone doesnโ€™t turn on after formatting?
If the device does not boot after fastboot format commands, you will need to flash it again through the Mi Flash Tool. Download the official firmware for your model from the Xiaomi Firmware website and follow the instructions for firmware in Fastboot mode.

5.Verification: How to make sure that data is actually deleted

Even after all the manipulations, you should check if there are traces of your activity on the phone.

Method 1: Checking with Recovery

If you have done a reset through Recovery, check:

  1. Press Power + Volume Up to log in to Recovery
  2. Choose Mount โ†’ System and Mount โ†’ Data
  3. Connect your phone to your PC and check the contents of folders through ADB: adb shell ls /data/data/ If the folder is empty or contains only system files, the data is deleted.

Method 2: Using Recovery Programs

Install a data recovery program on your PC (for example, DiskDigger or 7-Data Recovery) and scan the phone's internal memory:

  • ๐Ÿ” The program finds files with names like deleted_1234.jpg โ€” discharge was incomplete
  • ๐Ÿ—‘๏ธ Files are restored but opened as โ€œbrokenโ€ โ€“ encryption worked
  • โŒ The program finds nothing โ€“ the data is erased without the possibility of recovery

For the test, connect the phone in mode MTP (as a flash drive) and scan the userdata section. If you used physical wiping, the programs should not find any personal files.

Standard Factory Reset

Encryption + reset

Physical wiping through Fastboot

I sell without cleaning (I trust the customer)

Another way.-->

6. Additional security measures

In addition to cleaning up your memory, pay attention to:

1. MicroSD memory card

If you have a memory card installed in your phone, you need to clean it, too. Phone formatting is not enough, use:

  • ๐Ÿ’พ Full formatting on PC through SD Card Formatter (select the Overwrite format option)
  • ๐Ÿ”ฅ Utility. HDD Low Level Format Tool for Physical Grinding

2. SIM-map

Even if you took it out. SIM-map, the phone could have stayed on:

  • ๐Ÿ“ž Logs of calls (stored in the /data/com.android.providers.contacts/databases)
  • ๐Ÿ“ฉ SMS-message (folder) /data/com.android.providers.telephony/databases)

Remove them manually through Settings โ†’ Annexes โ†’ All applications โ†’ Communications/Contacts โ†’ Warehouse โ†’ Clear the data.

3. Accounts and synchronization

Check if you have left on your phone:

  • ๐Ÿ“ง Email accounts (e.g. Yandex Mail or Mail.ru)
  • โ˜๏ธ Cloud services (Mi Cloud, Google Drive, Dropbox)
  • ๐ŸŽฎ Accounts in games (Google Play Games, Game Center)

Remove them through Settings โ†’ Accounts or Settings โ†’ Synchronization.

๐Ÿ’ก

Even after a complete cleanup, avoid selling a phone with the original packaging if it has documents preserved (IMEI, Serial number โ€“ can be used to restore access to certain services.

7. Frequent mistakes and how to avoid them

Many users make critical mistakes in preparing Xiaomi for sale.

Mistake.Effects of consequencesHow to fix it
Not deleted by Mi AccountThe new owner can unlock the phone through your accountUntie the device in Settings โ†’ Mi Account
Reset without disabling your Google accountFRP-lock (requires you to enter your password after resetting)Delete your account in Settings โ†’ Accounts. โ†’ Google
Use of fast microSD formattingFiles are easy to recover with programs like RecuvaFull formatting through SD Card Formatter with Overwrite option
Selling a phone with an unlocked bootloaderThe new owner can sew custom firmware with a backdoorClose the bootloader with the command fastboot oem lock

Another common problem is residual data in the app cache, like Viber or WhatsApp, which can back up your emails in folders:

  • /sdcard/Android/media/com.whatsapp/WhatsApp/Databases
  • /data/data/com.viber.voip/files/viber_data

Remove them manually through a file manager with root rights or using the ADB:

adb shell rm -rf /sdcard/Android/media/com.whatsapp/*

FAQ: Answers to Frequent Questions

โ“ Should I take it out? SIM-pre-reset?
Yes, I will. SIM-The card contains your phone number, operator data and can be used to restore access to certain services (for example, through the use of a mobile phone). SMS-In addition, when resetting, the phone can send a message to your number (for example, a notification about the change of device in the Mi Account).
โ“ Can I recover data after fastboot erase userdata?
Theoretically, no, if the command is executed correctly. fastboot erase physically wipes the userdata partition with zeroes, making recovery impossible without specialized hardware (which costs tens of thousands of dollars and is only used in laboratories). However, if the phone was not flashed after the command, the residue of data can remain in unused memory sectors.
โ“ How to sell Xiaomi if you forget your Mi Account password?
If you donโ€™t remember your password and canโ€™t untie your account, you have two options: Restore access through Xiaomiโ€™s official website (youโ€™ll need a linked email or phone); Sell the phone as โ€œaccount-linkedโ€ at a discount (usually 20โ€“30% of market value). The buyer will be able to use the device, but will not be able to reset it without your data. โš ๏ธ Warning: Selling a phone with someone else's Mi Account violates Xiaomi's user agreement and could be regarded as fraud.
โ“ Does Googleโ€™s Find My Device Reset Work?
Yes, but only if: Phone is connected to the Internet (via mobile network or Wi-Fi) Find My Device feature is enabled in Google settings You remember the password from the Google account associated with the device For remote reset: Go to Find My Device Page Select your Xiaomi in the list of devices Click Erase data and confirm this method does not replace a full reset via Recovery or Fastboot, as it does not affect the system partitions.
โ“ Can we get around? FRP-lock-up?
Technically yes, but for new models (Xiaomi) 12/13, Redmi Note 11/12) The processor requires special equipment (EasyJTAG, Medusa Pro) and is worth it. 1000โ€“3000 RUB in the service center, on old devices (up to) 2020 (a) you can exploit vulnerabilities in the Fastboot or EDL-It's a breach of warranty, but it's a breach of warranty. FRP It resets the device to a "clean" state, which cancels all your efforts to clean it safely.