why is defragging not really a thing anymore?

734 views

I was born in 1973, got my first computer in 1994, defragging was part of regular maintenance. I can’t remember the last time I defragged anything, even though I have several devices with hard drives, including a Windows laptop. Has storage technology changed so much that defragging isn’t necessary anymore? Is it even possible to defrag a smart phone hard drive?

edit to add: I apologize for posting this same question several times, I was getting an error message every time I hit “post”… but from looking around, it seems I’m not the only one having this problem today.

In: 821

40 Answers

Anonymous 0 Comments

When I was 20 I ran a computer repair shop. You have no idea how much money I made just defragging computers to make them faster.

Anonymous 0 Comments

Imagine you want to high-five your friend while he’s riding a carousel – you can stand in one place and slap his hand each time he comes around. If you want to deliver 5 slaps, you have to wait for him to come around 5 times. If you want to deliver 100 slaps… you are gonna be waiting a while.

Now imagine a giant carousel with multiple rows of horses that 100 people can ride (this is effectively a Hard Disk Platter), and you’ve got 20 friends you want to high-five (your data stored on the platter). If you know where they are, and can reach far and fast enough, you can still stand in one place and slap them as they go by (and you’ve just become a hard disk’s read head). You’re still limited to one slap per rotation though, so if you want to deliver slaps faster, you’re going to have to speed up the carousel (higher end hard disk drives can spin at 15,000 RPM!).

You can see how it becomes a lot of work to slap each of your friends (by which I mean read your data), and it only gets to be even more work when drives have multiple platters – a stack of multiple carousels all spinning at the same time and you want to slap people on each one – wouldn’t it be easier if you could organize your friends to sit next to each other so you could just hold your hand out once or twice and let them get you as they go by?

This is effectively what defragging does. It repositions the data to be more optimally accessed, and back when all of us were suffering on these spinning hard disk drives every day, it was necessary to perform regularly in order to keep the computer feeing responsive – otherwise just like watching your friend on the far side of the carousel, you were stuck waiting.

There are many, many other improvements that have happened, but what as arguably made the largest difference is drive technology. Flash media that’s used in solid state drives means there’s no more “waiting for the carousel to come around again,” you can effectively reach and slap each and every one of your friends all at the same time, regardless of how spread out (fragmented) they are, and this means there’s no longer a need to re-organize the data (or defragment) all the time.

Anonymous 0 Comments

Defragging was a killer of HDDs, I’ve got HDDs that still work after 15 years, but defrag people are lucky to get 3 years. Lots of wear and tear defragging all the time

Anonymous 0 Comments

Defragmenting spinning disk hard drives is handled silently in the background by the operating system. This is thanks to faster hardware making the task trivial.

Defragmenting an SSD is actually bad for the drive. It creates unnecessary wear for little to no gain.

Anonymous 0 Comments

There’s so many wrong answers in this thread it’s insane.

The simple answer is that modern SSDs **do not** need defragmentation since they don’t have physical disks and disk heads that have a delay when moving between sectors to lookup data (this is why SSDs feel instantaneous and snappy, they always know where to read data from). Defragmenting an SSD actually lowers its lifespan since the cells have a limited write/rewrite capacity.

Modern OS and filesystems do perform maintenance on SSDs via a TRIM command, which tells the SSD what cells can be erased (deleting a file doesn’t actually delete it, it’s just marked as unused until trimmed). The the SSD’s controller keeps track of these changes and writes new data in a way that evenly wears the cells.

Anonymous 0 Comments

Defragging was needed as early filesystems wrote data at a convenient free space and spread it to multiple locations if that first free space was not sufficient for the total amount of data.

Later systems had more memory caches and better algorithms to make a better guess at how much data would be written. Knowing the total amount of data, the filesystem could figure out a much more suitable location, already decreasing fragmentation and therefor the need for defragmentation.

Today’s filesystems, actually still do defragmentation, but often it is done automatically in the background.
It is part of several different housekeeping chores labeled as *datascrubbing*, so the term *defragmentation* is not often used anymore.

Anonymous 0 Comments

Aside from SSDs, bigger drives is really the answer here.

Back in the day when you would regularly use most of your hard drive space and un/reinstall things to make room. Data that should have been contiguous was frequently fragmented and slotted in anywhere they would fit. HDD seeking was a high latency operation, so reading fragmented data from a disk was slow, and because people deleted things to make room for new stuff the problem got progressively worse until you needed to do something about it (defrag). FAT in particular was pretty aggressive about fragmenting files to efficiently use limited space, so it was particularly prone to this issue.

With a much larger drive you didn’t need to worry about it, because there were big ol’ blocks empty blocks that file systems could write new stuff to, so it didn’t get as fragmented. People didn’t have to delete stuff (leaving weird sized holes) to make room often, and when they did they usually deleted larger files which left bigger gaps, which caused less fragmentation. Modern file systems prioritised access speed over disk space utilisation which also helped, and then SSDs finally came in and rendered the whole idea of defragmentation redundant.

Anonymous 0 Comments

I remember the first time I defragged… Besides the fun watching the graphics, I remember how much quicker my pc felt!

Anonymous 0 Comments

I don’t see any complete answers here, so I’ll give it a try.

Hard drives basically just store a long string of ones and zeroes. To store files in a hard drive, we basically split this long string up into ranges and say “Bytes 0 to 10 000 is file X”. By storing these ranges in a table, we end up with a file system.

However, a problem can occur when we delete a file. If there are other files before and after the file we deleted, we now end up with a “hole” in the string of ones and zeroes. Over time, our harddrive will look like a swiss cheese of holes. At worst, this could mean that we could have a large amount of free space on the hard drive, but all that free space is spread out over lots of small holes. In that case, we’d be unable to store a large file, because there’s no single hole large enough to fit it. This problem is called fragmentation, and tends to get worse and worse as the drive fills up.

File systems solve this by allowing a file to be split up into multiple ranges. That means that a large file that can’t fit in a single hole can simply be split up into as many parts needed to fit the free holes. We just need to keep track of all of these separate ranges in the table.

Unfortunately, this can significantly slow down the performance of a hard drive due to additional seeking. While a mechanical hard drive can read over hundreds of megabytes per second as long as they’re reading a single block from start to finish, whenever the read head has to move it can take anywhere from 5 to 20 milliseconds, depending on the hard drive model, the physical distance between the blocks on the disk and the disk’s rotation speed. In 10 milliseconds, our harddrive can read more than a megabyte of data. This means that each time we split up a file to fit it into different blocks, we have to pay the additional seek time each time we want to read it.

Defragmentation is the process of moving files around on the hard drive to eliminate those holes and pack the files more neatly in the available space. While it takes time to do and causes wear on the hard drive from the additional use, it helps keep the performance of the drive up as the OS no longer needs to split up files when writing due to having to fit them into holes, and existing files are faster to read as they’re not split up either.

The reason why defragmentation has “disappeared” is two-fold. The first reason is that the OS got better and smarter at doing it automatically in the background. Your OS will automatically defragment hard drives when they aren’t in use to make sure that the performance stays optimal. It also tries to avoid defragmenting files that are very large in the first place, as the additional seek time cost of a 200 MB file is negligable; if it takes 1000 ms to read 200 MBs and a split adds 10 ms, it’s barely any difference. By only defragmenting small files, the defragmentation process becomes much faster.

The second reason is, like many others have mentioned, solid state drives. Solid state disks don’t have a single read head that has to find the data. Instead, it’s functionally as if each block of data had its own personal read head. While a mechanical hard drive can only seek to and read from one place at a time, an SSD can not only “seek” to different locations instantly, they can even read from many different locations simultaneously, their performance only being limited by the controller chip and transfer speed of the cable/slot the SSD is plugged into. As such, the “seek time” (which is really just the time it takes to process the read command and start returning data to the OS) of an SSD is generally less than 0.1 ms, at least a hundred times faster than a mechanical hard drive.

This changes the above equation significantly. If each split only adds 0.1 ms to reading a file, then it’s no longer worth defragmenting it unless it truly is tiny in the first place. This pretty much never happens, as tiny files easily fit in small holes, so they don’t usually need to be split up in the first place.

Defragmentation sounds even worse when we take the limited endurance of SSDs into account. Flash memory cells have a limited number of writes that can be done to them before they’re no longer able to store data anymore. Defragmentation is a very copy-intensive operation, usually requiring files to be copied to temporary memory and then to their new location. This causes excessive writes for essentially no benefit, so unless the fragmentation is extremely excessive defragmentation should be avoided for SSDs.

Anonymous 0 Comments

Windows has, since at least version 7, automatically defragged hard disks. SSDs don’t need to be defragged because they don’t rely on a spinning disk where the physical distance between chunks of data can have a significant impact on load time.
As to why Linux/Unix/Mac don’t generally need to be defragged – the filesystems distribute files much more sparsely across the disks than NTFS. FAT type filesystems simply stacked the files on top of each other so when a file was updated it would have to be continued outside of its original location.

0 views

I was born in 1973, got my first computer in 1994, defragging was part of regular maintenance. I can’t remember the last time I defragged anything, even though I have several devices with hard drives, including a Windows laptop. Has storage technology changed so much that defragging isn’t necessary anymore? Is it even possible to defrag a smart phone hard drive?

edit to add: I apologize for posting this same question several times, I was getting an error message every time I hit “post”… but from looking around, it seems I’m not the only one having this problem today.

In: 821

40 Answers

Anonymous 0 Comments

When I was 20 I ran a computer repair shop. You have no idea how much money I made just defragging computers to make them faster.

Anonymous 0 Comments

Imagine you want to high-five your friend while he’s riding a carousel – you can stand in one place and slap his hand each time he comes around. If you want to deliver 5 slaps, you have to wait for him to come around 5 times. If you want to deliver 100 slaps… you are gonna be waiting a while.

Now imagine a giant carousel with multiple rows of horses that 100 people can ride (this is effectively a Hard Disk Platter), and you’ve got 20 friends you want to high-five (your data stored on the platter). If you know where they are, and can reach far and fast enough, you can still stand in one place and slap them as they go by (and you’ve just become a hard disk’s read head). You’re still limited to one slap per rotation though, so if you want to deliver slaps faster, you’re going to have to speed up the carousel (higher end hard disk drives can spin at 15,000 RPM!).

You can see how it becomes a lot of work to slap each of your friends (by which I mean read your data), and it only gets to be even more work when drives have multiple platters – a stack of multiple carousels all spinning at the same time and you want to slap people on each one – wouldn’t it be easier if you could organize your friends to sit next to each other so you could just hold your hand out once or twice and let them get you as they go by?

This is effectively what defragging does. It repositions the data to be more optimally accessed, and back when all of us were suffering on these spinning hard disk drives every day, it was necessary to perform regularly in order to keep the computer feeing responsive – otherwise just like watching your friend on the far side of the carousel, you were stuck waiting.

There are many, many other improvements that have happened, but what as arguably made the largest difference is drive technology. Flash media that’s used in solid state drives means there’s no more “waiting for the carousel to come around again,” you can effectively reach and slap each and every one of your friends all at the same time, regardless of how spread out (fragmented) they are, and this means there’s no longer a need to re-organize the data (or defragment) all the time.

Anonymous 0 Comments

Defragging was a killer of HDDs, I’ve got HDDs that still work after 15 years, but defrag people are lucky to get 3 years. Lots of wear and tear defragging all the time

Anonymous 0 Comments

Defragmenting spinning disk hard drives is handled silently in the background by the operating system. This is thanks to faster hardware making the task trivial.

Defragmenting an SSD is actually bad for the drive. It creates unnecessary wear for little to no gain.

Anonymous 0 Comments

There’s so many wrong answers in this thread it’s insane.

The simple answer is that modern SSDs **do not** need defragmentation since they don’t have physical disks and disk heads that have a delay when moving between sectors to lookup data (this is why SSDs feel instantaneous and snappy, they always know where to read data from). Defragmenting an SSD actually lowers its lifespan since the cells have a limited write/rewrite capacity.

Modern OS and filesystems do perform maintenance on SSDs via a TRIM command, which tells the SSD what cells can be erased (deleting a file doesn’t actually delete it, it’s just marked as unused until trimmed). The the SSD’s controller keeps track of these changes and writes new data in a way that evenly wears the cells.

Anonymous 0 Comments

Defragging was needed as early filesystems wrote data at a convenient free space and spread it to multiple locations if that first free space was not sufficient for the total amount of data.

Later systems had more memory caches and better algorithms to make a better guess at how much data would be written. Knowing the total amount of data, the filesystem could figure out a much more suitable location, already decreasing fragmentation and therefor the need for defragmentation.

Today’s filesystems, actually still do defragmentation, but often it is done automatically in the background.
It is part of several different housekeeping chores labeled as *datascrubbing*, so the term *defragmentation* is not often used anymore.

Anonymous 0 Comments

Aside from SSDs, bigger drives is really the answer here.

Back in the day when you would regularly use most of your hard drive space and un/reinstall things to make room. Data that should have been contiguous was frequently fragmented and slotted in anywhere they would fit. HDD seeking was a high latency operation, so reading fragmented data from a disk was slow, and because people deleted things to make room for new stuff the problem got progressively worse until you needed to do something about it (defrag). FAT in particular was pretty aggressive about fragmenting files to efficiently use limited space, so it was particularly prone to this issue.

With a much larger drive you didn’t need to worry about it, because there were big ol’ blocks empty blocks that file systems could write new stuff to, so it didn’t get as fragmented. People didn’t have to delete stuff (leaving weird sized holes) to make room often, and when they did they usually deleted larger files which left bigger gaps, which caused less fragmentation. Modern file systems prioritised access speed over disk space utilisation which also helped, and then SSDs finally came in and rendered the whole idea of defragmentation redundant.

Anonymous 0 Comments

I remember the first time I defragged… Besides the fun watching the graphics, I remember how much quicker my pc felt!

Anonymous 0 Comments

I don’t see any complete answers here, so I’ll give it a try.

Hard drives basically just store a long string of ones and zeroes. To store files in a hard drive, we basically split this long string up into ranges and say “Bytes 0 to 10 000 is file X”. By storing these ranges in a table, we end up with a file system.

However, a problem can occur when we delete a file. If there are other files before and after the file we deleted, we now end up with a “hole” in the string of ones and zeroes. Over time, our harddrive will look like a swiss cheese of holes. At worst, this could mean that we could have a large amount of free space on the hard drive, but all that free space is spread out over lots of small holes. In that case, we’d be unable to store a large file, because there’s no single hole large enough to fit it. This problem is called fragmentation, and tends to get worse and worse as the drive fills up.

File systems solve this by allowing a file to be split up into multiple ranges. That means that a large file that can’t fit in a single hole can simply be split up into as many parts needed to fit the free holes. We just need to keep track of all of these separate ranges in the table.

Unfortunately, this can significantly slow down the performance of a hard drive due to additional seeking. While a mechanical hard drive can read over hundreds of megabytes per second as long as they’re reading a single block from start to finish, whenever the read head has to move it can take anywhere from 5 to 20 milliseconds, depending on the hard drive model, the physical distance between the blocks on the disk and the disk’s rotation speed. In 10 milliseconds, our harddrive can read more than a megabyte of data. This means that each time we split up a file to fit it into different blocks, we have to pay the additional seek time each time we want to read it.

Defragmentation is the process of moving files around on the hard drive to eliminate those holes and pack the files more neatly in the available space. While it takes time to do and causes wear on the hard drive from the additional use, it helps keep the performance of the drive up as the OS no longer needs to split up files when writing due to having to fit them into holes, and existing files are faster to read as they’re not split up either.

The reason why defragmentation has “disappeared” is two-fold. The first reason is that the OS got better and smarter at doing it automatically in the background. Your OS will automatically defragment hard drives when they aren’t in use to make sure that the performance stays optimal. It also tries to avoid defragmenting files that are very large in the first place, as the additional seek time cost of a 200 MB file is negligable; if it takes 1000 ms to read 200 MBs and a split adds 10 ms, it’s barely any difference. By only defragmenting small files, the defragmentation process becomes much faster.

The second reason is, like many others have mentioned, solid state drives. Solid state disks don’t have a single read head that has to find the data. Instead, it’s functionally as if each block of data had its own personal read head. While a mechanical hard drive can only seek to and read from one place at a time, an SSD can not only “seek” to different locations instantly, they can even read from many different locations simultaneously, their performance only being limited by the controller chip and transfer speed of the cable/slot the SSD is plugged into. As such, the “seek time” (which is really just the time it takes to process the read command and start returning data to the OS) of an SSD is generally less than 0.1 ms, at least a hundred times faster than a mechanical hard drive.

This changes the above equation significantly. If each split only adds 0.1 ms to reading a file, then it’s no longer worth defragmenting it unless it truly is tiny in the first place. This pretty much never happens, as tiny files easily fit in small holes, so they don’t usually need to be split up in the first place.

Defragmentation sounds even worse when we take the limited endurance of SSDs into account. Flash memory cells have a limited number of writes that can be done to them before they’re no longer able to store data anymore. Defragmentation is a very copy-intensive operation, usually requiring files to be copied to temporary memory and then to their new location. This causes excessive writes for essentially no benefit, so unless the fragmentation is extremely excessive defragmentation should be avoided for SSDs.

Anonymous 0 Comments

Windows has, since at least version 7, automatically defragged hard disks. SSDs don’t need to be defragged because they don’t rely on a spinning disk where the physical distance between chunks of data can have a significant impact on load time.
As to why Linux/Unix/Mac don’t generally need to be defragged – the filesystems distribute files much more sparsely across the disks than NTFS. FAT type filesystems simply stacked the files on top of each other so when a file was updated it would have to be continued outside of its original location.