Deleted Data Recovery on Mobile Devices
Deleted data recovery on mobile devices surveys the technical mechanisms that allow forensic examiners to retrieve records that operating systems have marked as erased. This topic covers SQLite free pages, unallocated NAND flash blocks, thumbnail caches, and the practical impact of encryption, TRIM, and OS version on recovery success.
Last updated:
Deleted data recovery on mobile devices is the forensic process of extracting records that have been logically removed by a user or application but not yet physically overwritten on storage. Mobile operating systems do not immediately zero the storage cells backing a deleted file or database row. Instead, they mark the space as available for reuse and reclaim it later. This gap between logical deletion and physical erasure creates a window in which original content can be read by an examiner who knows where to look. The three primary recovery targets are SQLite free pages (which hold deleted rows from messaging, call-log, and browser databases), unallocated NAND flash blocks (which may contain file fragments from recently deleted media and documents), and thumbnail caches (which retain preview images after the source file has been removed).
The practical success of any recovery attempt depends heavily on three factors: the acquisition method used, the encryption state of the device, and how much time has passed since deletion. A logical acquisition can read SQLite databases directly but cannot access unallocated blocks. A physical acquisition or chip-off gives access to all NAND cells, but only if the device is unencrypted or the examiner can supply the decryption key. TRIM and garbage-collection cycles, which run automatically on modern Android and iOS devices, progressively erase unallocated blocks and reduce the window for recovery. Understanding these constraints is as important as knowing the recovery techniques themselves.
The legal framework for acquiring and presenting deleted mobile data varies by jurisdiction. In the United States, the Stored Communications Act and Fourth Amendment warrant requirements govern access to device content. The UK's Police and Criminal Evidence Act 1984 (as updated) and the Investigatory Powers Act 2016 set the equivalent framework. In India, the Information Technology Act 2000 governs electronic evidence admissibility, supplemented by the Bharatiya Sakshya Adhiniyam 2023 for court proceedings. Across the European Union, the General Data Protection Regulation imposes additional constraints on retaining personal data extracted from devices. Regardless of jurisdiction, courts expect the examiner to demonstrate that the acquisition method did not alter the device, that a verified bit-for-bit copy was made before analysis, and that chain of custody was maintained throughout.
By the end of this topic you will be able to:
- Explain the SQLite free-page mechanism and describe how examiners parse free pages to recover deleted rows from messaging and call-log databases.
- Describe the NAND flash erase-block model and explain why unallocated blocks may retain recoverable content after logical deletion.
- Identify the thumbnail cache locations on Android and iOS and explain why thumbnails can persist after source media is deleted.
- Evaluate the impact of TRIM, garbage collection, OS version, and full-disk encryption on the probability of successful recovery.
- Select the correct acquisition method for a given recovery scenario and explain what each method can and cannot recover.
- SQLite free page
- A database page that SQLite has placed on an internal free-page list after a row deletion. The page retains its original content until SQLite reuses it for new data. Free pages are listed in the database file header and are readable by forensic tools without any special extraction step.
- NAND flash erase block
- The minimum unit that can be electrically erased in NAND flash memory. Erase blocks are larger than write pages (often 256 KB to 4 MB). The OS writes at page granularity but erases at block granularity, so a block containing deleted sectors cannot be cleared until all live pages in the block have been relocated.
- TRIM
- A command issued by the file system to the flash controller identifying blocks that are no longer in use, so the controller can pre-erase them during idle time. On mobile devices, TRIM runs automatically and progressively shrinks the window for deleted-data recovery from unallocated blocks.
- Thumbnail cache
- A store of small preview images generated by the OS or applications when media is first viewed. On Android the primary cache is stored in a .thumbnails directory or a MediaStore database; on iOS thumbnails are managed by the Photos framework in DCIM and PhotoData directories. Caches are evicted on their own schedule, independent of source file deletion.
- Wear levelling
- A flash controller algorithm that distributes write operations across all blocks evenly to prevent any single block from wearing out prematurely. A side effect is that logically deleted data may be physically stored in a block the controller has not yet selected for erasure, making recovery possible longer than expected.
- File-based encryption (FBE)
- An Android encryption model introduced in Android 7.0 in which each file is encrypted with a separate key derived from the user credential. FBE replaced full-disk encryption (FDE) on most devices from Android 10 onward. Under FBE, even chip-off acquisition of unallocated blocks yields ciphertext that cannot be decrypted without the per-file key.
SQLite free pages: the primary source of deleted records
Nearly every forensically significant database on a mobile device uses SQLite: SMS and MMS stores, WhatsApp and Signal message databases, call logs, browser history, contact databases, and application preference files. SQLite organises data into fixed-size pages, with the default size being 4 096 bytes and the configurable range 512 bytes to 65 536 bytes. When the application deletes a row, SQLite does not zero the storage. It adds the page to an internal free-page list, which is tracked in the database file header as a linked list of page numbers. The page's previous content remains intact in the file until SQLite decides to reuse that page for new data.
Forensic tools such as Cellebrite UFED, Oxygen Forensic Detective, and AXIOM parse the free-page list from the SQLite header and read the raw bytes of each listed page. Because the SQLite file format is documented and stable, this parsing is reliable. A recovered free page typically contains a complete or near-complete row, including all text fields, integer values, and BLOB references. What is missing is the row ID index entry: deleted rows no longer appear in the B-tree index, so queries against the live database do not find them. The examiner reads the raw page content directly.
The volume of recoverable data depends on how active the application is. A messaging app that sends and receives hundreds of messages per day reuses free pages quickly, and deleted messages may survive for only minutes before their page is overwritten with new content. A call-log database that receives only a few entries per week may retain deleted records in free pages for months. This asymmetry means the examiner should always note the activity level of the relevant application when reporting confidence in deleted-record recovery.
Unallocated NAND blocks and physical recovery
NAND flash memory is organised into pages (the smallest writable unit, typically 4 KB to 16 KB) and erase blocks (the smallest erasable unit, typically 256 KB to 4 MB). A block can only be written from the erased state, meaning all bits set to 1. To overwrite data, the controller must first erase the entire block containing it. This is expensive in time and wear cycles, so controllers defer erasure using wear-levelling and garbage-collection algorithms. When a file is deleted by the file system, the file's pages are marked as invalid in the flash translation layer (FTL), but the block is not erased until the controller decides it is needed for new writes.
Physical acquisition of the raw NAND, either through JTAG, ISP (in-system programming), or chip-off, can read these unallocated but not-yet-erased blocks. The examiner then runs file carving tools such as Foremost, Scalpel, or PhotoRec against the raw image. File carvers identify known file headers and footers (JPEG SOI/EOI markers, MP4 ftyp boxes, PDF %PDF headers) and reconstruct files regardless of whether the file system has an entry for them. This approach recovers media files, documents, and application data containers from deleted files.
| Factor | Increases recovery probability | Reduces recovery probability |
|---|---|---|
| Time since deletion | Device acquired immediately | Days or weeks elapsed with normal use |
| TRIM activity | TRIM disabled or device powered off | TRIM enabled and running continuously |
| Write volume after deletion | Low (device idle) | High (active messaging, downloads) |
| Wear levelling | Deleted blocks not yet selected | All blocks cycled recently |
| Encryption | Device unlocked, FDE with known key | FBE with per-file keys, locked device |
| Acquisition method | Chip-off or ISP (physical image) | Logical acquisition only |
Not all data in unallocated blocks is from recently deleted files. Wear levelling may move old data to blocks that are currently marked unallocated from the file system's perspective, creating a situation where content from months or years ago coexists in the same unallocated region as content from last week. Examiners should not assume that all carved content is contemporaneous with the incident under investigation. Timestamps embedded in file metadata (EXIF, MP4 creation boxes) provide the primary basis for dating carved files, but these can be manipulated.
Thumbnail caches and media artifact persistence
Thumbnail caches are a consistent source of evidence in cases involving images and video. When a user opens the camera roll, a gallery application, or a file browser, the OS or application generates a small preview image for each media file and stores it in a dedicated cache. The cache is maintained separately from the media library and is evicted according to its own schedule, which on most devices is based on age and total cache size rather than on the deletion status of the source file. This means that when a user deletes an image, the original file is removed from the file system and its NAND blocks become candidates for erasure, but the thumbnail typically remains in the cache database for days to weeks.
On Android, the primary thumbnail store moved from a hidden .thumbnails directory in DCIM to a MediaStore database entry from Android 10 onward. The thumbnails themselves are stored as JPEG blobs within the MediaStore SQLite database at /data/data/com.android.providers.media/databases/ or in the external storage equivalent. The MediaStore database is itself a SQLite file, so deleted thumbnail entries follow the free-page recovery path described above. On iOS, the Photos framework maintains thumbnail pyramids in the PhotoData directory within the photo library bundle. These are not individually accessible through a logical acquisition but are retrievable in a file-system or physical acquisition.
Third-party applications maintain their own caches independently of the OS media store. WhatsApp stores received media thumbnails in its private data directory under /sdcard/WhatsApp/Media/.Statuses/ and analogous paths. Telegram caches preview images in its application support directory. Instagram and other social applications similarly maintain internal thumbnail stores. Each of these represents an independent evidence source that may retain image previews after the in-app deletion of the corresponding message or post.
Impact of encryption on recovery
Encryption is the single largest barrier to deleted-data recovery on modern mobile devices. iOS has encrypted all user data with hardware-backed AES keys since iPhone 3GS (2009). Android moved from optional full-disk encryption (FDE) to mandatory file-based encryption (FBE) starting with Android 7.0 and made FBE the default from Android 10 onward. Under both regimes, data written to NAND flash is always ciphertext. A chip-off acquisition of an encrypted device yields a block image that cannot be read without the cryptographic key material.
iOS derives per-class keys from the device's UID (burned into the Secure Enclave at manufacture) and the user's passcode. Data Protection classes (Complete, Complete Unless Open, Protected Until First User Authentication, No Protection) determine when each key is accessible. Content in the Complete class is encrypted with a key that is destroyed when the device locks; a chip-off of a locked iOS device cannot recover any Complete-class data. The SQLite databases containing messages and call logs are typically in the Complete class on iOS 16 and later, which means logical acquisition through an unlocked device or a known passcode is the only viable path.
Android FBE adds a further complication: different directories use different keys. Credential-encrypted (CE) storage, which covers most application data, requires the user's PIN, pattern, or password to decrypt. Device-encrypted (DE) storage covers only the minimal data needed before first unlock (lock screen assets, alarm state). A forensic extraction that bypasses Android authentication but cannot supply the user credential recovers only DE data. The practical result is that on a modern, patched Android device with an unknown PIN, deleted SQLite rows from messaging applications are effectively unrecoverable.
OS version, TRIM, and the recovery window
The probability of recovering deleted data from unallocated NAND blocks decreases as a function of time, write activity, and TRIM aggressiveness. Android has issued fstrim commands through the vold daemon since Android 4.3, with the idle maintenance window (typically 2 to 5 hours after the device goes idle) being the primary trigger. From Android 8.0, Inline Encryption and more aggressive FTL garbage collection further reduced the practical window. iOS performs TRIM-equivalent operations through its own storage layer; the exact scheduling is not publicly documented, but empirical testing by forensic researchers has consistently shown that unallocated block content on iOS devices becomes sparse within 24 to 48 hours of deletion under normal usage.
Older OS versions retain deleted content longer. An Android 4.x device without regular fstrim activity may contain recoverable file fragments months after deletion. An iOS 8 or 9 device may yield substantially more from unallocated blocks than an iOS 16 device acquired under the same conditions. This version dependence is important for historical investigations where the device was running an older OS at the time of the events in question, even if it has since been updated. The update itself may have triggered a TRIM pass, but data written before the update on older blocks may still be present.
The most reliable way to preserve the recovery window is to power off the device at seizure or place it in airplane mode and keep it charged, then acquire it as quickly as possible. Powering off stops TRIM from running in the idle window. The trade-off is that powering off also transitions the device to BFU state, which may lock out physical extraction tools that depend on AFU key availability. First-responder guidance therefore varies by case context: for encryption-unlocked devices where NAND recovery is the primary goal, power off and acquire; for locked devices where AFU exploitation is the only path, maintain power and isolate from networks.
Acquisition method selection for recovery scenarios
The choice of acquisition method determines what recovery is possible. Logical acquisition extracts data through the device's operating system API or backup protocol (iTunes backup on iOS, ADB backup or Android Debug Bridge file pull on Android). It delivers application databases, including free-page content, but cannot access unallocated blocks or files that the OS does not expose. File-system acquisition, available on jailbroken iOS devices and rooted Android devices, delivers a fuller directory tree including application container directories, but still does not provide a raw NAND image. Physical acquisition delivers a bit-for-bit image of the storage device, enabling file carving of unallocated blocks, but requires either chip removal (chip-off), an ISP connection to the eMMC or UFS chip, or JTAG access.
For SQLite free-page recovery, logical or file-system acquisition is usually sufficient: the free pages are inside the database file, and the database file is accessible at those acquisition levels. For unallocated block recovery, physical acquisition is required. For thumbnail cache recovery, the answer depends on the device: on Android, the MediaStore database is accessible at file-system level; on iOS, the PhotoData directory requires file-system or physical acquisition.
The admissibility of evidence recovered from deleted locations has been tested in courts across multiple jurisdictions. In the United Kingdom, courts have accepted SQLite free-page evidence when the examiner demonstrates that the forensic tool did not modify the database and that the recovery methodology is reproducible, following the principles in the ACPO Good Practice Guide for Digital Evidence (now replaced by the Digital Evidence framework under the Forensic Science Regulator). In the United States, Daubert standard challenges to mobile deleted-data recovery have generally succeeded when the tool and method are validated and documented. Indian courts, operating under the Bharatiya Sakshya Adhiniyam 2023, require electronic evidence to be accompanied by a certificate under Section 63 from the examiner attesting to the device state and acquisition method.
What happens to a SQLite page when an application deletes a row from a mobile database?
Key Takeaways
- SQLite free pages are the most reliable source of deleted mobile records: when a row is deleted, its page is placed on an internal free-page list in the database file and retains its content until reused, making it accessible through logical or file-system acquisition.
- Unallocated NAND flash blocks may contain deleted file content because NAND erasure is deferred to block granularity and managed by garbage collection; physical acquisition (chip-off, ISP, or JTAG) is required to read these blocks.
- Thumbnail caches persist independently of source media and can confirm a file's existence on a device even after the original has been deleted and its NAND blocks erased.
- TRIM, garbage collection, and file-based encryption progressively close the recovery window: acquisition should occur as quickly as possible after seizure, and device power state at seizure (BFU vs AFU) determines which physical extraction techniques are viable.
- Jurisdictions including the United States, United Kingdom, European Union, and India each impose distinct legal requirements on mobile evidence collection and admissibility; the examiner must document acquisition method, device state, and integrity hashes to satisfy any jurisdiction's standards.
Why is deleted data often recoverable from mobile devices?
What is a SQLite free page and how do examiners recover data from it?
How does TRIM affect deleted data recovery on mobile devices?
Does full-disk encryption prevent deleted data recovery?
What are thumbnail caches and why are they forensically significant?
Test yourself on Mobile and Network Forensics with free, timed mocks.
Practice Mobile and Network Forensics questionsSpotted an error in this page? Report a correction or read our editorial standards.