UnixDroid

Lesson 1 of 8 · 6 min

Why deleted files aren't really gone

Deleting a file removes the pointer, not the data. Here's why that's where every forensic investigation begins.

When you press Delete and empty the Recycle Bin, the file feels gone. Usually it isn't. Deleting a file mostly removes the pointer to the data, not the data itself, and that gap is where digital forensics begins.

Think of a library. Deleting a book doesn't burn it. It just tears its card out of the catalogue. The book stays on the shelf until someone needs that space for a new one.

What actually happens when you delete

1. The file system entry is marked "free". On Windows (NTFS), the file's record in the Master File Table (MFT) is flagged as unused. On Linux (ext4), the inode is released.

2. The data blocks are marked available. The actual bytes stay exactly where they were on the disk.

3. Nothing is wiped. The data survives until new files happen to overwrite those blocks.

What decides whether you can get it back

SituationChance of recovery
Deleted minutes ago on a hard disk (HDD)Very high
Disk heavily used since the deletionPartial: some blocks are overwritten
Quick formatHigh: only the file system was rebuilt
Full format (Windows Vista and later)Very low: free space is zeroed
SSD with TRIM enabledLow: the drive can erase freed blocks on its own
Securely wiped (shred, DBAN)Practically none

Tip: SSDs are the big exception. TRIM tells the drive which blocks are free, and it can clear them in the background within minutes. On SSD cases, speed matters.

Where else "deleted" data hides

  • Recycle Bin / Trash: the first place to look, every time.
  • Unallocated space: free disk space full of old file fragments.
  • Slack space: leftover bytes at the end of a cluster that a smaller file didn't fill.
  • Shadow copies and backups: Windows Volume Shadow Copies often hold older versions of files.
  • Thumbnails, caches and logs: a deleted photo can live on as a thumbnail.

Why this matters for an investigator

Attackers delete their tools, scripts and stolen archives to cover their tracks. A forensic investigator assumes the evidence is still there somewhere. That's why the very first rule is: don't write anything new to that disk, or you might overwrite the exact blocks you need.

Every lesson in this path builds on that one idea: data leaves traces, and your job is to find them without destroying them.

Try it yourself
  1. On your Kali VM, create a small practice disk: dd if=/dev/zero of=practice.img bs=1M count=20 and then mkfs.ext4 practice.img
  2. Mount it: mkdir mnt && sudo mount -o loop practice.img mnt
  3. Write a secret and delete it: echo "secret-evidence-123" | sudo tee mnt/note.txt, then sudo rm mnt/note.txt and sudo umount mnt
  4. Search the raw image: grep -a "secret-evidence-123" practice.img. If your text prints, the "deleted" data is still on the disk.
No Linux machine? Practise in the free online terminal

Quick check

When you delete a file, what usually gets removed: the data or the pointer to it?

Need a hint?

The library catalogue card, not the book.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →