What is Disk Fragmentation on Windows and how does it optimize your hard disk?

1.10K views

What is Disk Fragmentation on Windows and how does it optimize your hard disk?

In: 57

52 Answers

Anonymous 0 Comments

This doesn’t apply to newer solid state drives, but rather the slightly older spinning-disk style hard drives.

With the spinning disks, there is a seeker head, like the needle on a record player, that has to physically go to the location on the disk where the relevant bit of information is stored. If all those bits are right in a row on the disk, this is a very quick operation.

However, it can happen that those bits get scattered all over the physical platter, so that the seeker head has to travel to many different places on the disk. That’s called fragmentation, and it makes it take many times longer to read a file.

Defragmenting a disk is the process of taking all those fragmented files, and rewriting them so they’re in nice rows on the disk again.

It mostly doesn’t matter these days though, even if you don’t have an SSD, modern operating systems do a good job of not fragmenting drives too badly. This is mostly something we worried about back in the Windows 98 era and before.

Anonymous 0 Comments

What you mean is DEfragmentation.

The disk in this case is the “hard disk” aka the hard drive where you save everything.

So when you save something, imagine the disk as a container that has a bunch of squares where you can shove things. Let’s say it has 100 squares and that you save something worth 30 squares, they will all be saved in sequence as a singular chunk or block. Then you save something that is 5 squares then 20 squares. So you are at 45 squares left. You then uninstall the thing worth 5 squares and then this is where it gets weird.

A computer rarely ever really “deletes” anything. Instead it just marks that section as “ok to rewrite” , this is how you can still recover things off a hard drive even after you’ve “deleted” everything.

So that 5 memory block is there, waiting to be rewritten but still taking up space. Now you try to install something worth 50 blocks. Computers work much better if all memory is sequential instead of having to dig through the whole disk. However in order to shove the 50 blocks of data in, it needs to write 5 in that spot that is ok to be rewritten and then go over to the free 45 spaces to write the rest, so the disk now has some “fragmentation”

As you use the computer and continue on writing and rewriting to the disk, more info gets separated, and programs that use that info will have to scour the entire box to get what it needs. Part 1 is in the top left corner in block 1, part 3 is on block 49, etc etc.

So defragmenting is like resorting that box so all like information is with like. It is like when you organize your inventory in resident evil 4 to have the guns all in one space, the ammo in another and the healing in another spot so when you open up the inventory you can quickly find it.

Anonymous 0 Comments

This is how my dad explained it to me when I was 8, yea it’s not 5, but close enough.

Your hard drive is like your room. You saving data is like you putting more stuff into your room. Over time your room becomes more crowded and you have to rip stuff out in order to throw stuff into the trash. Defragmentation is like cleaning up your room and organizing it so that items you don’t touch often might be kept under the bed, stuff you use more is on your desk, etc.

As I grew up I had to tell this to a friend. It’s different because I wanted to try my hand at explaining.

Your PC saves data similar to you building a tower of Jenga blocks. When you delete something, you are removing certain blocks from the tower. It’s not going to collapse, but it does leave holes. Over time your tower is massively tall mostly because of those holes. Defragmentation is when you let your computer help you reorganize, where in this analogy you would be rebuilding the tower putting certain colors together so it keeps things efficient and nice looking.

Anonymous 0 Comments

This is how my dad explained it to me when I was 8, yea it’s not 5, but close enough.

Your hard drive is like your room. You saving data is like you putting more stuff into your room. Over time your room becomes more crowded and you have to rip stuff out in order to throw stuff into the trash. Defragmentation is like cleaning up your room and organizing it so that items you don’t touch often might be kept under the bed, stuff you use more is on your desk, etc.

As I grew up I had to tell this to a friend. It’s different because I wanted to try my hand at explaining.

Your PC saves data similar to you building a tower of Jenga blocks. When you delete something, you are removing certain blocks from the tower. It’s not going to collapse, but it does leave holes. Over time your tower is massively tall mostly because of those holes. Defragmentation is when you let your computer help you reorganize, where in this analogy you would be rebuilding the tower putting certain colors together so it keeps things efficient and nice looking.

Anonymous 0 Comments

I believe a common analogy from back in the day is books on a shelf.

Let’s say I put some books on a shelf. Usually, I’ll place the books in stacks wherever there’s space. When I remove books, I’ll leave some gaps sometimes. When I place a new stack of books on the shelf, I’ll try and fill up the gaps first, thereby breaking up the existing stack. So, since now the stack is broken up, if I want to look for a stack that has already been separated, it becomes more difficult to look for it.

When I optimise/defragment, I will rearrange everything properly and push it all to one side so that there’s continuous space at the end instead of gaps among the books. Now it’s easier to look for the books because they’re all together with no gaps.

Anonymous 0 Comments

Basically, imagine the layout of the desktop and folders you can see in your computer as if they were real physical papers. Imagine how tiring and time consuming it’d be to move them all around to different places!

Now, what if instead of moving papers around constantly among a thousand different filing cabinets, you usually kept files in whatever cabinet you first put them in, and just kept a filing cabinet purely for keeping track of what goes where. Kind of like the Index in a book. Now you can change where a paper is “located” quickly, or you can mark that you don’t care about a paper any more and it’s okay to throw it away if you need more space, while hardly having to do any work at all!

The only problem is, as you do this more and more, especially with many small different papers, you might have to split up where you place some of them even though you’ll still act like they’re in one group in your little “Index”.

Eventually, you’ll be running all around your warehouse of filing cabinets just to do a simple task. This is why you might have to Defragment a disk drive, it’s a little like deciding to organize everything more efficiently, and try to place a lot of empty cabinets all in one place so it’s easier to place new papers there in the future.

Non ELI5 note: This only strictly applies to HDDs (Hard Drives with physical spinning discs). I believe many SSDs (Solid State Drives, with no moving parts) don’t really work this way in a way the system handles, as that would probably result in unnecessary read/write operations which reduce their lifespan? But strongly prefacing that I don’t know as much for SSDs in this case, so take that comment with a healthy fistful of salt.

Anonymous 0 Comments

I believe a common analogy from back in the day is books on a shelf.

Let’s say I put some books on a shelf. Usually, I’ll place the books in stacks wherever there’s space. When I remove books, I’ll leave some gaps sometimes. When I place a new stack of books on the shelf, I’ll try and fill up the gaps first, thereby breaking up the existing stack. So, since now the stack is broken up, if I want to look for a stack that has already been separated, it becomes more difficult to look for it.

When I optimise/defragment, I will rearrange everything properly and push it all to one side so that there’s continuous space at the end instead of gaps among the books. Now it’s easier to look for the books because they’re all together with no gaps.

Anonymous 0 Comments

Basically, imagine the layout of the desktop and folders you can see in your computer as if they were real physical papers. Imagine how tiring and time consuming it’d be to move them all around to different places!

Now, what if instead of moving papers around constantly among a thousand different filing cabinets, you usually kept files in whatever cabinet you first put them in, and just kept a filing cabinet purely for keeping track of what goes where. Kind of like the Index in a book. Now you can change where a paper is “located” quickly, or you can mark that you don’t care about a paper any more and it’s okay to throw it away if you need more space, while hardly having to do any work at all!

The only problem is, as you do this more and more, especially with many small different papers, you might have to split up where you place some of them even though you’ll still act like they’re in one group in your little “Index”.

Eventually, you’ll be running all around your warehouse of filing cabinets just to do a simple task. This is why you might have to Defragment a disk drive, it’s a little like deciding to organize everything more efficiently, and try to place a lot of empty cabinets all in one place so it’s easier to place new papers there in the future.

Non ELI5 note: This only strictly applies to HDDs (Hard Drives with physical spinning discs). I believe many SSDs (Solid State Drives, with no moving parts) don’t really work this way in a way the system handles, as that would probably result in unnecessary read/write operations which reduce their lifespan? But strongly prefacing that I don’t know as much for SSDs in this case, so take that comment with a healthy fistful of salt.

Anonymous 0 Comments

This is obsolete software and if you are running a ssd it can half the lifespan of it or even kill it these days data is written in blocks and only deleted when written over. Defragging a ssd will most likely kill or make your blocks unusable

Anonymous 0 Comments

This is obsolete software and if you are running a ssd it can half the lifespan of it or even kill it these days data is written in blocks and only deleted when written over. Defragging a ssd will most likely kill or make your blocks unusable