When you tap the trash icon in the Files app, Android simply removes the pointer to the data. The underlying bytes stay on the flash storage until the block is reused. Because modern eMMC and UFS chips use wear‑leveling, the physical location of those bytes can move, making it hard for a normal overwrite to guarantee that the original data disappears. If someone gains physical access to the device, forensic tools can sometimes recover those “deleted” files.
Secure deletion tries to make recovery impractical by overwriting the storage area with random data (or a known pattern) before the block is released. On Android you can achieve this without root by using a combination of:
shred or dd.Secure deletion writes additional data to the storage medium. This can slightly increase wear on the flash cells, though the impact is negligible for occasional use. Make sure the device is charged above 30 % and you have a stable Wi‑Fi connection for downloading packages.
/sdcard/) or an external SD card.shredTermux provides a Debian‑based environment where you can install the GNU coreutils package that includes shred. This method works on any Android version that can run Termux (Android 5.0+).
shredapt update && apt upgrade -y
apt install coreutils -y
The coreutils package contains shred, dd, and other useful tools.
Android’s scoped storage prevents apps from reading arbitrary paths. Use the termux-setup-storage command to create a shared /storage/emulated/0 folder that Termux can see.
termux-setup-storage
When the dialog appears, tap Allow. The command creates a ~/storage shortcut pointing to your internal storage.
Assume the file you want to erase is /sdcard/Downloads/secret.pdf. From Termux you can refer to it as ~/storage/downloads/secret.pdf (the downloads shortcut is created by termux-setup-storage).
ls -l ~/storage/downloads/secret.pdf
If the file is on an external SD card, first find its mount point with df -h and then navigate to the appropriate folder under /storage/.
shred to overwrite the fileThe basic command overwrites the file three times with random data and then removes it:
shred -v -n 3 -z ~/storage/downloads/secret.pdf
-v – verbose, shows progress.-n 3 – number of overwrite passes (default is 3).-z – adds a final pass of zeros to hide shredding activity.After the command finishes, the file disappears from the file manager. The data has been overwritten, making forensic recovery extremely difficult.
ls -l ~/storage/downloads/secret.pdf
You should see “No such file or directory”. Open the Files app and confirm the file no longer appears.
If you prefer a graphical interface, the F‑Droid repository hosts several open‑source apps that implement secure deletion. One of the most reputable is Secure Delete (package name org.securedelete). It uses the same overwrite algorithm as shred but presents a simple UI.
Downloads).When the process ends, the file disappears from the file manager, and the app reports “Success”.
Sometimes you need to erase many files at once, for example before selling a device or repurposing an SD card. Overwriting each file individually works, but it can be tedious. The following approach uses dd to overwrite the whole block device, effectively scrubbing every sector.
From Termux, run:
su 2>/dev/null || echo "Root not required, but we need read access"
ls -l /dev/block/bootdevice/by-name/
On most devices the internal storage appears as /dev/block/mmcblk0. For an external SD card it may be /dev/block/mmcblk1. Use df -h to confirm which mount point corresponds to which block.
**Warning:** This will destroy all data on the selected device. Double‑check the path before proceeding.
dd if=/dev/urandom of=/dev/block/mmcblk1 bs=4M status=progress
The command streams random data from /dev/urandom to the block device. The bs=4M block size speeds up the process; expect several minutes for a 64 GB card.
After dd finishes, you can optionally write zeros to make the card usable again:
dd if=/dev/zero of=/dev/block/mmcblk1 bs=4M status=progress
Then re‑format the SD card using Android’s Settings > Storage > SD card > Format. The card will be clean and ready for reuse.
Flash memory uses wear‑leveling: the controller maps logical blocks to physical cells and may move data around to spread wear. Because of this, overwriting a logical block does not guarantee that the original physical cells are cleared. The practical impact is:
shred or a secure‑wipe app reduces the chance of recovery to a negligible level.If you need the highest assurance (e.g., before disposing of a device), consider a factory reset combined with a full‑disk encryption enable‑then‑reset cycle, or physically destroy the storage.
shred, run sync to flush buffers before checking the file manager./data/data/…) that Termux cannot reach without root. In those cases, the only practical method is to delete the app itself and reinstall it.shred utility works, but the SD card’s controller may implement its own wear‑leveling, so a full‑device overwrite (dd) is more reliable.Even though Termux can access shared storage, it cannot write to the raw block device without root. Ensure you are targeting a regular file path (e.g., ~/storage/downloads/…) and not a system directory. For SD‑card wipes, you must use dd on the block device, which also requires root on many devices. If you lack root, stick to file‑level shredding.
Some older apps haven’t been updated for the new scoped‑storage model. In that case, use the Termux method, or look for a newer app on F‑Droid that targets API 30+.
Android’s media scanner may cache thumbnails. Open Settings > Apps > Files > Storage > Clear cache. Then reopen the Files app; the ghost entry should disappear.
| Scenario | Best method | Why |
|---|---|---|
| One or a few sensitive documents | Termux + shred | Fast, no extra app needed. |
| Non‑technical users who prefer a UI | Secure Delete app (F‑Droid) | Graphical, simple pass selection. |
| Wiping an entire SD card before resale | dd random‑data overwrite | Ensures every sector is overwritten. |
| Device that will be discarded | Full‑disk encryption → Factory reset | Encryption key deletion makes remaining data unreadable. |
Secure deletion on Android without root is entirely feasible. By using Termux’s shred command, a trusted open‑source app, or a block‑level dd overwrite, you can dramatically reduce the risk of accidental data exposure. Remember the underlying limitation of flash wear‑leveling and, when maximum certainty is required, combine secure wiping with full‑disk encryption or physical destruction.
With the steps above you should be able to confidently erase private files, prepare an SD card for a new owner, or simply gain peace of mind that your deleted data won’t be easily recovered.









