TechKnowSurge
CompTIA Tech+ 3.1 CompTIA Tech+ 2.5 CompTIA A+ Core 2 1.3
InteractiveComputeFree

Fragmentation Visualizer

Watch seven files land on an empty 80-block disk as clean unbroken runs, watch three of them get deleted, and watch the next big write be forced to scatter into four separate gaps — then press Defragment.

Complete this interactive to capture a CTF flag worth 1 point.

About this interactive

What you’re seeing: an empty 80-block disk and a thirteen-step history played over it. Seven files write as clean unbroken runs, three of them are deleted, and then a 34-block file finds plenty of free space but no single run big enough to hold it — so it fills one gap, jumps to the next, and ends up in four separate pieces. Why it matters: fragmentation is normally shown as a picture of a messy disk, which explains nothing. The cause is a sequence, and the sequence is the lesson: files fragment because deleting things leaves free space in pieces, not because disks go wrong. How to use it: press Play the history, or Step through it one event at a time and watch each write fill block by block — the skip from the end of one free region to the start of the next is the moment it happens. Click a file in the table to isolate its blocks and see the pieces on their own, then press Defragment and watch every file consolidate while the extra-seek counter falls to zero. The seek model is printed on screen so you can argue with it, and the closing note carries the caveat that makes it true: this is a hard-disk argument, and an SSD has no head to move.

How to use this tool

An 80-block disk drawn as a grid, 4 KB per block, and a scripted thirteen-step history played over it. Each colour is one file; a free block is an empty outline.

Press Play the history and watch, or press Step to walk it one event at a time. Six files write first, and while the disk is still empty every one of them lands as a single unbroken run — that is what an unfragmented disk looks like, and it is the baseline everything after it is measured against. Then three files are deleted. Nothing moves to close the holes they leave, because closing a hole would mean rewriting everything after it.

The tenth step is the one to watch. project.mov needs 34 blocks. There are 47 free, but the largest single run is only 20, so the file system fills the first gap, jumps to the next, fills that, and jumps again. The file ends up in four pieces — and because each write fills one block at a time, you can see the jump happen rather than only see the result. Fragmentation is not something that went wrong with the disk; it is what deleting things does to free space.

Click a file in the table to isolate its blocks and keep it isolated. That is the clearest way to see that all four orange clusters are the same file.

The numbers are a stated model, not a measurement, and the model is printed under the readout so you can argue with it: reading a file costs one seek per piece at 10 ms each — a hard disk head move plus a platter rotation — plus 0.05 ms to stream each 4 KB block. EXTRA SEEKS is the sum of pieces minus one across every file, which is the part that is fragmentation’s fault and nothing else’s.

Then press Defragment. Every file is rewritten into one contiguous run, extra seeks fall to zero, and the modelled read of the whole disk drops by about 43%. It does not drop to zero, and should not: a contiguous file still costs one seek to find.

Two honest caveats, both stated on screen. Allocation here is first-fit, the simplest policy that fragments for the real reason; NTFS and ext4 both try considerably harder to keep files together, which is much of why modern desktops rarely need this done by hand. And every cost in the model is a physical head moving, so every conclusion is about hard disks. An SSD has no head and no platter, reaches any block as fast as any other, and gains nothing from defragmentation — running a defragmenter against one just spends write cycles.

Nothing here is graded and nothing is submitted. Press Reset to start the history over.

What you'll learn

Aligned to

CompTIA Tech+
3.1 Explain the purpose of operating systems.
2.5 Compare and contrast storage types.
CompTIA A+ Core 2
1.3 Given a scenario, use features and tools of the Microsoft Windows 10/11 operating system (OS).

Key terms

File Fragmentation
A condition where a file is stored in non-consecutive clusters across a storage volume, requiring the OS to retrieve data from multiple locations.
Defragmentation
The process of consolidating fragmented files on a storage device by rewriting them into contiguous clusters to improve access speed and reduce mechanical wear.
Cluster
The smallest unit of disk space that a file system allocates when storing data; a file occupies at least one cluster even if it is smaller, with common cluster sizes of 4,096 bytes.
Size on Disk
The amount of storage space a file occupies on a storage device, determined by the cluster size and always rounded up to the nearest full cluster.
File System
The method and data structures an operating system uses to organize, store, name, and retrieve files on a storage device; common examples include NTFS on Windows, APFS on macOS, and ext4 on Linux.
File Allocation Table
FAT
A simple legacy file system that uses a table to track which clusters on a disk are allocated to files and which are free, developed for early PC operating systems. FAT variants (FAT16, FAT32) are still used on removable media such as USB drives for broad compatibility.
New Technology File System
NTFS
The default file system for Windows operating systems that supports large file sizes, permissions, encryption, journaling, and compression. NTFS replaced FAT as the standard Windows file system and provides advanced features for enterprise environments.
Hard Disk Drive
HDD
A traditional storage device that uses rotating magnetic platters and read/write heads to store and retrieve data persistently. HDDs offer high-capacity storage at lower cost per gigabyte than SSDs, but with slower speeds and moving mechanical parts.
Solid State Drive
SSD
A storage device that uses flash memory chips with no moving mechanical parts to store data persistently, offering faster read/write speeds, lower latency, and greater durability than traditional hard disk drives. SSDs connect via SATA, NVMe, or M.2 interfaces.
Partition
A defined section of a physical storage drive that can be used for booting a device or organizing storage; a drive may contain one or more partitions.

Topics

Storage File System Fragmentation Defragmentation Cluster Hdd Ssd Seek Time Disk Maintenance Performance

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →