Why not delete photos from the gallery on Android Xiaomi: a full analysis of the problem

You're trying to make room for the Xiaomi Redmi Note 12 or POCO X5 Pro, but photos are stubbornly returning to the gallery after being deleted? This problem is familiar to many owners of smartphones on MIUI, Xiaomi's branded shell. Most often, the fault is not the files themselves, but the mechanisms of their display: from the cache of the Gallery app to synchronization with the Mi Cloud.

In this article, weโ€™ll look at 7 main reasons why photos arenโ€™t deleted from Xiaomiโ€™s phone, from basic user errors to hidden system bugs. Youโ€™ll learn how to check if files are deleted from the deviceโ€™s memory, why they can be โ€œrecoveredโ€ after a reboot, and what to do if the issue is related to Media Storage or access rights. For each reason, weโ€™ll give you step-by-step instructions based on the latest versions of MIUI 14/15.

Important: Some solutions require access to Developer Settings or ADB. If you're not sure what you're doing, skip those steps -- they're marked with special warnings. Let's start with the simplest and get to the hardest.

The most common reason for photos to come back is cached thumbnails. The Gallery app (or Google Photos, if installed) saves smaller copies of images for quick download, and even after deleting the original file, the thumbnail can be displayed in the interface, creating the illusion that the photo has โ€œreturned.โ€

How to check:

  • ๐Ÿ” Open the Gallery and find the deleted photo. Tap it and select Information (or Details) if the location section indicates a path of the type /storage/emulated/0/DCIM/.thumbnails โ€” This is cache.
  • ๐Ÿ“ Use any file manager (such as Mi File Manager) and check the folder DCIM/.thumbnails. Here are the miniatures.
  • ๐Ÿ—‘๏ธ If the photo opens, but the size of 0 KB is indicated in detail - the original is deleted, and only the preview is displayed.

How to clear the cache:

  1. Go to Settings โ†’ Applications โ†’ Application Management.
  2. Find the gallery (or Google Photos) and tap it.
  3. Select Warehouse. โ†’ Clear the cache.
  4. Reboot the phone.

โ˜‘๏ธ Checklist for cleaning the cache

Done: 0 / 4

If you still show photos after cleaning the cache, move to the next section, and maybe the problem is deeper, the Media Storage system process.

2.The Media Storage system process does not update the database

In Android, the Media Storage system (or com.android.providers.media) scans the deviceโ€™s memory and creates a database (media.db) that all applications, including the Gallery, use, and if this process freezes or the database is corrupted, photos can be displayed even after deleting.

Signs of a problem:

  • ๐Ÿ”„ The photos disappear after deletion, but reappear after a few minutes or after rebooting.
  • ๐Ÿ“Š In Settings โ†’ Storage occupied space does not decrease after deleting files.
  • ๐Ÿšซ New photos are not displayed in the gallery, although they are in the folder DCIM.

How to fix it:

  1. Media Storage: adb shell am force-stop com.android.providers.media adb shell am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard These commands send a signal to the system to "connect" the drive, forcing it to rescan the files. ADB And the debugging on. USB.
  2. Clear Media Storage Data (Secure, but Reset All Media Labels): Go to Settings โ†’ Annexes โ†’ Show all applications (โ‹ฎ) โ†’ Show them system. Find the Media Storage. โ†’ Clear the data.

๐Ÿ’ก

If the photos are missing after cleaning the Media Storage data, but returned after an hour, check the cloud sync (section 4).

โš ๏ธ Attention: Media Storage data cleanup will remove all custom tags, albums and gallery location tags, and the files on the device will remain intact, but they will have to be reorganized.

3. Photos are synced to Mi Cloud or Google Photos

If your Xiaomi has Mi Cloud or Google Photos enabled, deleted locally files can automatically be restored from the cloud, which is standard behavior, but many users forget about it.

How to check:

  • ๐ŸŒฅ๏ธ Open the Settings. โ†’ Accounts and synchronization โ†’ Mi Cloud (or Google). Check if Gallery sync or Google Photos is enabled.
  • ๐Ÿ“ฒ In the Google Photos app, go to Settings โ†’ Backup and synchronization.
  • ๐Ÿ”„ If the cloud has a copy of the photo, it can download back when connected to Wi-Fi (especially if Auto-Recovery is enabled in Mi Cloud).

How to turn off auto-recovery:

  1. For Mi Cloud: Go to Settings โ†’ Accounts and Sync โ†’ Mi Cloud โ†’ Gallery. Turn off Auto-Recover (or Gallery Sync). Delete photos from the cloud manually: open Mi Cloud โ†’ Gallery in your browser and delete files.
  2. For Google Photos: Open the app, tap the avatar โ†’ Photo settings โ†’ Backup. Turn off Backup and Sync. Delete the photos from the Google Photos Recycle Bin (they are stored there for 60 days).
ServiceThe path to settingsWhat to turn off
Mi CloudSettings โ†’ Accounts โ†’ Mi Cloud โ†’ GalleryAuto-Recovery, Synchronization Gallery
Google PhotoAppendix โ†’ Avatar โ†’ Settings โ†’ BackupBackup and synchronization
OneDriveAppendix โ†’ I โ†’ Settings โ†’ BackupAutomatic photo uploading

โš ๏ธ Warning: If you delete photos from the cloud, they will disappear from all devices that enable sync. Before mass deletion, back up important files to your computer.

๐Ÿ“Š What cloud service do you use for your photo?
Mi Cloud
Google Photo
OneDrive
Yandex.Disk.
I don't use it.

4.Photos are stored on SD-filesystem error card

If you use a microSD card on a Xiaomi smartphone, the problem may be caused by file system damage.

  • ๐Ÿ“› Photos are deleted but returned after retrieving/pasting the card.
  • ๐Ÿšซ New files are not saved to SD-map.
  • โš ๏ธ Notification appears SD-map damaged.

How to check the card for errors:

  1. Connect. SD-card to the computer through the card reader.
  2. In Windows, open This computer, right-click on the map โ†’ Properties โ†’ Service โ†’ Check.
  3. On a Mac, use Disk Utility (select card โ†’ First Aid).
  4. On Linux, run the command: sudo fsck /dev/sdX1 (replace sdX1 with the current section of your map).

If the check didn't work,

  • ๐Ÿ”„ Format the map in FAT32 or exFAT (via phone or PC).
  • ๐Ÿ›’ Replace the card โ€“ if it is old or cheap (class below Class 10), it may not be able to handle the load.
  • ๐Ÿ“ฑ In the phone settings go to the Warehouse โ†’ Settings (โš™) โ†’ Format as an internal drive (for high speed cards only!).
What to do if your phone canโ€™t see SD-map?
If the card is not determined after formatting, try: 1. Reboot the phone with the card inserted. 2. wipe the contacts of the card with a smoother (carefully!). 3. Check the card on another device. If nothing helps, the card is physically damaged and must be replaced.

5. Access rights or MIUI encryption block deletion

MIUI has two features that can prevent you from deleting files:

  1. Privacy Protection โ€“ blocks access to files without confirmation.
  2. Folder encryption โ€“ if the DCIM folder or individual photos are encrypted, they cannot be deleted without a password.

How to check:

  • ๐Ÿ”’ Try to delete the photo through the file manager. If you have a request to enter a password, the folder is encrypted.
  • ๐Ÿ“‚ Go to Settings. โ†’ Confidentiality โ†’ Special permits โ†’ Access files and check the rights for the Gallery.

Decisions:

  1. For encrypted folders: Open Settings โ†’ Privacy โ†’ Encrypted folders. Enter your password and unlock the folder with the photo. Delete the files manually.
  2. For limited rights: Go to Settings โ†’ Applications โ†’ Application Management โ†’ Gallery โ†’ Permissions. Make sure Storage and Files and Media are enabled.

โš ๏ธ Note: If you forget the password from the encrypted folder, you can't restore access to files without resetting your phone to factory settings. Xiaomi doesn't provide tools to unlock encryption without a password.

6. Virus or malware restores files

Rarely, some viruses block deleting files or recovering them from hidden copies, which is true if you have installed applications from unknown sources or connected your phone to an infected PC.

Signs of infection:

  • ๐Ÿฆ  Photos return even after cache reset and cloud shutdown.
  • ๐Ÿ“ฅ Unknown files appear in folders DCIM download.
  • ๐Ÿ”‹ The phone is quickly discharged or warmed for no reason.

How to check and clean:

  1. Install an antivirus (such as Malwarebytes or Dr.Web Light) and scan the device.
  2. Check the list of installed apps in Settings โ†’ Apps. Uninstall suspicious ones (especially with Administrator or Accessibility rights).
  3. Turn on Google Play Protect: Open the Google Play Store โ†’ Menus (โ˜ฐ) โ†’ Play Protect. Scan the slide.

If the virus is found:

  • ๐Ÿ—‘๏ธ Delete infected files via Safe Mode (press the power button) โ†’ Safe regime).
  • ๐Ÿ”„ Reset the phone to factory settings (Settings) โ†’ The phone. โ†’ Resetting settings).

๐Ÿ’ก

Android viruses are often disguised as system applications (such as Android System or Media Service).

7. Hardware failure or memory damage

If none of the above methods worked, the problem could be physical damage to the phone's memory.

  • ๐Ÿ“ฑ Smartphones after falling or getting moisture.
  • ๐Ÿ”‹ Devices with worn flash memory (especially after 3-5 years of use).
  • ๐Ÿ› ๏ธ Phones after unqualified repairs.

How to diagnose:

  • ๐Ÿ“Š Check the state of memory with the help of AIDA64 (storage โ†’ Status. NAND). Pay attention to the Reallocated Sector Count and Uncorrectable Error Count settings โ€“ if their values are above 0, the memory is worn out.
  • ๐Ÿ”ง Connect your phone to your PC and try to delete files through ADB: adb shell rm -f /sdcard/DCIM/Camera/photo.jpg If the command returns a Read-only file system error, the memory partition went into read-only mode due to a hardware failure.

Decisions:

  • ๐Ÿ”„ Reset your phone to factory settings (this can temporarily restore memory access).
  • ๐Ÿ›’ If the warranty is valid, contact the Xiaomi service center.
  • ๐Ÿ’พ Move your important data to a memory card or cloud, as continued use of your phone could result in the loss of all files.

โš ๏ธ Warning: If the phone is making errors when writing files (for example, failed to save a photo), you can not ignore the problem - this is a sign of imminent failure of memory.

FAQ: Frequent questions about removing photos on Xiaomi

โ“ Why are photos deleted, but space on the disk is not freed?
It's because: Cache thumbnails โ€” clear the cache of the Gallery app. A damaged Media Storage database โ€” clear its data in settings. Hidden copies in the.thumbnails folder โ€” delete them manually through the file manager. Also check Settings section. โ†’ Warehouse โ†’ Analysis โ€“ it is possible that other files take place (for example, downloads or cache of messengers).
โ“ How to permanently delete photos so they donโ€™t recover?
Follow this algorithm: Turn off sync with Mi Cloud and Google Photos. Delete the photo from the gallery. Clean the cart in Gallery and Google Photos. Clear the Gallery and Media Storage cache. Check the DCIM/.thumbnails folder and delete the remaining thumbnails. For complete confidence, use the root file manager (like Root Explorer) and manually check the /storage/emulated/0/DCIM and /storage/emulated/0/Pictures folders.
โ“ Can I recover the photo after resetting to factory settings?
It depends on the type of discharge: ๐Ÿ”„ Soft reset (via Settings) โ€“ photos remain in memory, but access to them is lost. They can be restored using DiskDigger or Recuva (when connected to a PC). ๐Ÿงน Hard reset (via Recovery) โ€“ remarks memory, chances of recovery are minimal (only with professional tools like the help of a recovery tool) UFS Explorer). โš ๏ธ After reset, do not write new files to your phone โ€“ this reduces the chances of recovery.
โ“ Why photos are deleted only after rebooting?
This is because of the Media Storage process, and when you delete a file, the gallery sends a signal to the system to change it, but sometimes Media Storage doesn't have time to update the database. The restart forcefully restarts the process, and the changes apply. Solutions: Clear the cache and the Media Storage data (section) 2). Send Broadcast-intent for forced scanning: adb shell am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file:///sdcard/DCIM/
โ“ How to remove photos from your phone if they are protected DRM?
Photo by protection DRM (For example, screenshots from some applications or files with watermarks can not be deleted by standard methods. ADB: adb shell rm -f /path/to/protected/file.jpg (Root rights are required. Move files to the PC and delete them from there. Disable protection DRM in the settings of the application that created the files (if possible). โš ๏ธ Removal DRM-Secure files can disrupt the applications that created them (for example, banking or streaming services).