# The Hidden Truth About File Deletion: Docker, MinIO, and Storage Layers Explained

DevFeed: [The Hidden Truth About File Deletion: Docker, MinIO, and Storage Layers Explained](<https://devfeed.tech/articles/the-hidden-truth-about-file-deletion-docker-minio-and-storage-layers-explained-62441.md>)

Original publisher: [Read original article](<https://blog.devops.dev/the-hidden-truth-about-file-deletion-docker-minio-and-storage-layers-explained-1f7aa5ef2b04?source=rss----33f8b2d9a328---4>)

Author: Has San

Published: 2026-09-30T12:09:54Z

Content type: article

Language: en

Sources: [DevOps.dev](<https://devfeed.tech/sources/devops-dev.md>)

Topics: [MinIO](<https://devfeed.tech/topics/minio.md>), [Data Recovery](<https://devfeed.tech/topics/data-recovery.md>), [file](<https://devfeed.tech/topics/file.md>), [container images](<https://devfeed.tech/topics/container-images.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [backend-development](<https://devfeed.tech/tags/backend-development.md>), [block](<https://devfeed.tech/tags/block.md>), [data](<https://devfeed.tech/tags/data.md>), [delete](<https://devfeed.tech/tags/delete.md>), [docker](<https://devfeed.tech/tags/docker.md>), [file](<https://devfeed.tech/tags/file.md>), [filesystem](<https://devfeed.tech/tags/filesystem.md>), [forensic](<https://devfeed.tech/tags/forensic.md>), [index](<https://devfeed.tech/tags/index.md>), [layers](<https://devfeed.tech/tags/layers.md>), [minio](<https://devfeed.tech/tags/minio.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [recovery](<https://devfeed.tech/tags/recovery.md>), [software-development](<https://devfeed.tech/tags/software-development.md>), [storage](<https://devfeed.tech/tags/storage.md>), [volumes](<https://devfeed.tech/tags/volumes.md>)

## AI overview

Deletion usually removes a reference or hides data from a namespace, while physical bytes may remain until the storage layer reuses or reclaims them. On HDDs, freed blocks can sometimes be recovered before reuse; SSD TRIM marks pages reclaimable, with cleanup handled later by garbage collection. In Docker, deleting a file in a container's writable layer hides it through OverlayFS, while removing a container leaves its volumes intact; named volumes require separate removal. MinIO object deletion removes an object from the bucket view, but storage cleanup depends on its engine. With bucket versioning enabled, a delete may add a marker while prior versions remain, requiring explicit version deletion or a lifecycle policy. The article also notes that PostgreSQL space may await VACUUM and Git history retains removed files in earlier commits.

## Source excerpt

The Hidden Truth About File Deletion: Docker, MinIO, and Storage Layers Explained I assumed for a long time that delete meant gone. Like, actually gone -- bytes wiped, storage reclaimed, done. It doesn't work that way. And once I understood what actually happens at the storage layer, a bunch of confusing behavior I'd run into with Docker volumes and MinIO suddenly made sense. A file isn't one thing Take report.pdf. It looks like a single object on your disk. It's not. The filesystem splits it into three separate concepts: Directory entry: "report.pdf" ↓ Metadata (size, permissions, timestamps) ↓ Pointers to blocks: [102, 103, 104] ↓ Block 102: [bytes] Block 103: [bytes] Block 104: [bytes] The filename is a label. It points to metadata. The metadata points to where the actual bytes live. Three layers, not one. This matters the moment you delete. What rm actually doesrm report.pdf The filesystem: Removes the directory entry Marks blocks 102, 103, 104 as available Moves on That's it. It doesn't overwrite anything. The bytes are still physically on disk -- they're just not indexed anymore. Block 102: [old PDF bytes] -> marked FREE Block 103: [old PDF bytes] -> marked FREE Block 104: [old PDF bytes] -> marked FREE Think of it like tearing the table of contents out of a book. The pages are still there. You just can't find them easily anymore. Why deleted files can be recovered Recovery tools don't use the filesystem index. They scan raw disk blocks looking for recognizable file signatures. PDFs start with %PDF. ZIPs start with PK. If the blocks haven't been reused yet, the data is often intact. This is how forensic recovery works. And it's why deleting a sensitive file isn't enough if you actually need it gone: shred -u report.pdf shred overwrites the blocks multiple times before removing the directory entry. Much harder to recover after that. The blocks eventually get overwritten anyway when new files need space. But "eventually" could be minutes or months depending on how bu