DEV Community

Cover image for Where Does Deleted Data Go? Unveiling the Secrets of File Deletion and Overwriting
Mahfuzur Rahman
Mahfuzur Rahman

Posted on

1

Where Does Deleted Data Go? Unveiling the Secrets of File Deletion and Overwriting

Ever wondered where the files go when you delete them from your computer or phone? Are they really gone or are they just playing an epic game of hide and seek behind those memory blocks, waiting to be recovered? I’ve got a burning curiosity and an urge to understand what actually happens at the lowest level when we delete a file. So, let’s embark on this journey of discovery… and hopefully, we’ll find out that the files aren’t just off on a tropical vacation!

To understand what happens when a file is deleted and overwritten, and how the storage system handles data at a deeper level, we need to break down how files are stored and managed on a storage device. We’ll also dive into the physical aspects of how bits and bytes are written, erased, and overwritten, and explain why they don’t “pile up” or continue to occupy space after being overwritten.

When you delete a file from your hard drive or SSD, the data isn't immediately erased. Instead, the system removes the file's reference and marks the storage space as available for reuse. On traditional hard drives (HDDs), the data remains as magnetic patterns until it's overwritten by new data. In solid-state drives (SSDs), a TRIM command marks the data for erasure, allowing faster overwriting. While deleted data can sometimes be recovered before it's overwritten, once new data replaces it, the old information is effectively lost. For secure deletion, special tools overwrite the data multiple times to ensure it cannot be restored. Understanding this process is crucial for managing storage and protecting sensitive information.

You can read my details explanation from here - My Blog

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay