eli5: what does (de-)fragmentation even mean?

437 views

After reading another post about why defragmentation isn’t as necessary with modern devices, i started wondering what exactly fragmentation even is. How and why does it happen and doesn’t it screw up your data?

In: 0

11 Answers

Anonymous 0 Comments

Let’s say you have a hard disk with 10 files on it, and file #4 is 8 blocks long. If you delete file #4, there is an 8 block “hole”. If you add a new 12 block file, there might be space at the end of the 10 files. At some point, however, there won’t be enough unused space at the end to fit the next file. Eventually, 8 blocks of some file will pe put where file #4 used to be and the rest of that file will be someplace else. That file will be in two fragments, one where file #4 used to be and another one someplace else. If you do this enough and the disk as little free space, eventually you’ll only have a bunch of 1 block holes. That means a new 15 block file will be split into 15 fragments, and that will take 15 times as long to read as if the file was all together. SSDs have no access time, eliminating this “longer time to read” effect.

Defragmentation is the process of copying all the files into a pattern where every file only needs one fragment. This involves a lot of copying and work, particularly if your disk has little free space.

Today, hard drives are big and running them almost completely full is uncommon, so the problem doesn’t occur much. The newest operating systems work to minimize fragmentation, and SSD drives are worn down by frequent defragmentation, so it’s not a common thing to do manually anymore.

You are viewing 1 out of 11 answers, click here to view all answers.