Does it make sense to defrag a SSD?
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
Good question. Other comments favor NO or just TRIM (which is something else and was an issue when, long time ago, you couldn't yet set things up to do this automatically). Arguments on the hardware side are pretty convincing, but then still: - hardware: why is reading/writing the same bytes in different sized packages so much slower for small packages? - what about the OS having to emit many more diskrequests, switching from user mode? Can't that slow things down? - and finally, what about measuring? My impression is that it does make a difference. So, max once a month, when I believe it is useful, I do a full defrag. There is (in my case) an argument against in differential backup (diskimage): defrag will cost many more backup bites than without defrag, so much so, after a few backups, that a new complete backup is an option. So, I will lower my defrag frequency even more to say once in 3 months. Never say never!
-
The short answer is, yes, Windows does sometimes defragment SSDs, yes, it's important to intelligently and appropriately defrag SSDs, and yes, Windows is smart about how it treats your SSD. The real and complete story - Does Windows defragment your SSD? - Scott Hanselman's Blog[^]
Wrong is evil and must be defeated. - Jeff Ello
I respectfully disagree. Windows recognizes that your drive is an SSD and doesn't do it. Instead, there are other optimizations that Windows does to SSDs that are good to keep it working well. From my reading and understanding over the years, defragmenting, however, does nothing at all to an SSD drive except needlessly burn read/write cycles. If you know of information supporting your viewpoint, I'd love to read about it.
-
I respectfully disagree. Windows recognizes that your drive is an SSD and doesn't do it. Instead, there are other optimizations that Windows does to SSDs that are good to keep it working well. From my reading and understanding over the years, defragmenting, however, does nothing at all to an SSD drive except needlessly burn read/write cycles. If you know of information supporting your viewpoint, I'd love to read about it.
Keefer S wrote:
If you know of information supporting your viewpoint, I'd love to read about it.
You read the link?
Wrong is evil and must be defeated. - Jeff Ello
-
The short answer is, yes, Windows does sometimes defragment SSDs, yes, it's important to intelligently and appropriately defrag SSDs, and yes, Windows is smart about how it treats your SSD. The real and complete story - Does Windows defragment your SSD? - Scott Hanselman's Blog[^]
Wrong is evil and must be defeated. - Jeff Ello
-
The short answer is, yes, Windows does sometimes defragment SSDs, yes, it's important to intelligently and appropriately defrag SSDs, and yes, Windows is smart about how it treats your SSD. The real and complete story - Does Windows defragment your SSD? - Scott Hanselman's Blog[^]
Wrong is evil and must be defeated. - Jeff Ello
ok... Note of course the post is 9 years old. So maybe something has changed since then. Additionally it does not provide any references. Closest is the following
"I dug deeper and talked to developers on the Windows storage team"
The first image gives a screen shot. On my personal computer I can see that the service is not on. Which suggests that to a certain extent, if Microsoft thinks it should be happening, it is not (on my computer.) The article says this.
"First, yes, your SSD will get intelligently defragmented once a month."
And it also says the following
"Windows 7, along with 8 and 8.1 come with appropriate and intelligent defaults and you don't need to change them for optimal disk performance."
I did not change the default. And as noted it is not on. I am running Windows 10. So perhaps no longer as relevant. And at least back then, 2014, SSDs had a reliability problem. So maybe that has changed since then.
-
dandy72 wrote:
Some people have called him a quack
dandy72 wrote:
it's clear he's technical to an extreme and very knowledgeable
You can be both you know. :-)
Wrong is evil and must be defeated. - Jeff Ello
:-D Fair point. But I've been listening to his podcast for over a decade, and I have come to the conclusion that those who called him a quack were just poorly informed. I forget what his exact concern was (something about XP's default network configuration?), but in the end he was proven right and Microsoft eventually had to seriously lock it down with SP2, which introduced (for the first time) the Windows firewall.
-
ok... Note of course the post is 9 years old. So maybe something has changed since then. Additionally it does not provide any references. Closest is the following
"I dug deeper and talked to developers on the Windows storage team"
The first image gives a screen shot. On my personal computer I can see that the service is not on. Which suggests that to a certain extent, if Microsoft thinks it should be happening, it is not (on my computer.) The article says this.
"First, yes, your SSD will get intelligently defragmented once a month."
And it also says the following
"Windows 7, along with 8 and 8.1 come with appropriate and intelligent defaults and you don't need to change them for optimal disk performance."
I did not change the default. And as noted it is not on. I am running Windows 10. So perhaps no longer as relevant. And at least back then, 2014, SSDs had a reliability problem. So maybe that has changed since then.
Well,it was still around three years ago on windows 10, since they released a bugfix for it. Microsoft fixes Windows 10 bug causing excessive SSD defragging[^] If you think about it, it makes sense to defrag also SSDs, just not very often. If you get a lot of file fragments spread all over the disk, it will cause excessive writes since it will have to spread out the files on more blocks. Default setting since windows 8.1 is every 28 days.
Wrong is evil and must be defeated. - Jeff Ello
-
Does a "defrag" use less space? Are there fewer "pointers" to follow? How much can you "save" in extreme cases? Is space a concern on a "maxed out" SSD?
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
The short answer is, yes, Windows does sometimes defragment SSDs, yes, it's important to intelligently and appropriately defrag SSDs, and yes, Windows is smart about how it treats your SSD. The real and complete story - Does Windows defragment your SSD? - Scott Hanselman's Blog[^]
Wrong is evil and must be defeated. - Jeff Ello
I've only read bits and pieces of Scott's article, looking for specific keywords, but (I think) what he fails to mention is that Windows has *adapted* its defrag approach so it now knows how to tell an SSD apart from a spinner. I believe there were justified concerns at the time, when SSDs first came out (if I remember my timeline correctly), XP's defragger just treated all drives like any spinner (the only thing it knew about) and blindly tried to run the defrag code that only made sense for traditional drives. It's only later that MS introduced the Trim command to Windows.
-
I've only read bits and pieces of Scott's article, looking for specific keywords, but (I think) what he fails to mention is that Windows has *adapted* its defrag approach so it now knows how to tell an SSD apart from a spinner. I believe there were justified concerns at the time, when SSDs first came out (if I remember my timeline correctly), XP's defragger just treated all drives like any spinner (the only thing it knew about) and blindly tried to run the defrag code that only made sense for traditional drives. It's only later that MS introduced the Trim command to Windows.
The trim command was introduced with win 7 iirc
Wrong is evil and must be defeated. - Jeff Ello
-
:-D Fair point. But I've been listening to his podcast for over a decade, and I have come to the conclusion that those who called him a quack were just poorly informed. I forget what his exact concern was (something about XP's default network configuration?), but in the end he was proven right and Microsoft eventually had to seriously lock it down with SP2, which introduced (for the first time) the Windows firewall.
I remember him alright. He isn't a quack, but has a tendency to fight windmills. :)
Wrong is evil and must be defeated. - Jeff Ello
-
Well,it was still around three years ago on windows 10, since they released a bugfix for it. Microsoft fixes Windows 10 bug causing excessive SSD defragging[^] If you think about it, it makes sense to defrag also SSDs, just not very often. If you get a lot of file fragments spread all over the disk, it will cause excessive writes since it will have to spread out the files on more blocks. Default setting since windows 8.1 is every 28 days.
Wrong is evil and must be defeated. - Jeff Ello
Yup. The problem isn't so much degraded performance speed-wise. I think the problem is that fragmentation reduces the MTBF (mean time before failure). As fragmentation makes it increasingly impossible to write data in contiguous blocks, it means things getting stored are going to take both more writes and more reads. I think this "death spiral" in fact killed more than few early adopter SSDs.
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
The part that matters isn't so much performance like defrag can help with a spinning platter. I think Windows is supposed to approach defrag differently based on the firmware of the drive and its being SSD (it just happens). The reason it matters to an SSD is because when an SSD gets heavily fragmented, what it can mean is much faster wear and tear on the drive. This is because instead of being able to stick data in one place in a full page it has to put it multiple different places.... so instead of 1 read/write for that file now, you're doing 5. Not exactly, but pretty much. I think early on, this, and the fact that they needed to treat SSD different in this regard was not recognized and caused several brands of drives to die well before their expected MTBF.
-
Saw an article this morning recommending that you run the command: "Defrag C:" from time to time on your SSD drives. But does it make sense to defrag a SSD? I can understand that it is of value on old spinning disk hard drives, where fragmentation can cause the reader to physically jump from fragment to fragment, but a SSD has no moving parts. What do the experts say?
Ok, I have had my coffee, so you can all come out now!
Other posts provided links but I still have not seen anything authoritative. Following, still not authoritative, seems to follow what other even less authoritative sources say. And at least the post date is more recent. https://www.pcmag.com/how-to/how-to-defrag-your-hard-drive-in-windows-10[^] That link, and others, state that a SSD should not be 'defragged'. But rather it is 'trimmed'. And that is what that process does. As noted in my other post, my windows 10 computer does NOT have the stated process enabled. I didn't turn it off. And I think I remember installing Windows 10 directly (I remember because I was annoyed that it didn't come installed out of the box.) But I can't find anything that suggests whether the default is turned on or off.
-
The part that matters isn't so much performance like defrag can help with a spinning platter. I think Windows is supposed to approach defrag differently based on the firmware of the drive and its being SSD (it just happens). The reason it matters to an SSD is because when an SSD gets heavily fragmented, what it can mean is much faster wear and tear on the drive. This is because instead of being able to stick data in one place in a full page it has to put it multiple different places.... so instead of 1 read/write for that file now, you're doing 5. Not exactly, but pretty much. I think early on, this, and the fact that they needed to treat SSD different in this regard was not recognized and caused several brands of drives to die well before their expected MTBF.
jochance wrote:
The reason it matters to an SSD is because when an SSD gets heavily fragmented, what it can mean is much faster wear and tear on the drive.
As quite a few links indicate (posted here and when googled) describe what happens for a SSD. With the older hard disk drives there was a physical spinning platter. Thus 'wear and tear' as the arm switched back and forth over the various tracks. With an SSD there is no arm to move. Addressing is direct.
-
Yup. The problem isn't so much degraded performance speed-wise. I think the problem is that fragmentation reduces the MTBF (mean time before failure). As fragmentation makes it increasingly impossible to write data in contiguous blocks, it means things getting stored are going to take both more writes and more reads. I think this "death spiral" in fact killed more than few early adopter SSDs.
Even magnetic disks do low level reallocation of blocks when a bad block is detected. The disk addresses appear continuous, but one or more blocks may be physically located in a different location. On a magnetic disk, this of course affects average access time. Probably less than you would think. SSDs always do a physical layer 'reallocation' (which is really an allocation, without the re), below the disk address level, to even out wear, so that the same physical blocks are not used again and again, but new writes are distributed among all free blocks. I would be very surprised if this allocation mechanism wouldn't handle bad pages as well. What would make sense on an SSD is if the disk driver kept track of blocks in read-only files, written once and later only read. If the disk is 90% full, and other files come and go, even with wear leveling the remaining 10% of the blocks may have been written 50,000 times. It would make sense to move read-only files into this area, to provide a 'virgin' area for the next million block writes. (I never heard of any SSD disk doing this, but maybe some of them do.)
-
jochance wrote:
The reason it matters to an SSD is because when an SSD gets heavily fragmented, what it can mean is much faster wear and tear on the drive.
As quite a few links indicate (posted here and when googled) describe what happens for a SSD. With the older hard disk drives there was a physical spinning platter. Thus 'wear and tear' as the arm switched back and forth over the various tracks. With an SSD there is no arm to move. Addressing is direct.
jschell wrote:
Thus 'wear and tear' as the arm switched back and forth over the various tracks.
I never ever heard of a disk with a worn out arm. (Nor of a loudspeaker with a worn out voice coil - the mechanisms are similar. The speaker has probably made magnitudes more back-and-forth moves.) There is no physical contact between the arm/head and the platter, and no physical wear from long use.
With an SSD there is no arm to move. Addressing is direct.
Down to some level. While a magnet can be flipped one way or the other a more or less unlimited number of times, a cell in an SSD is worn out with repeated writes. A good rule-of-thumb used to be 100.000 writes; some people said that was overly optimistic. Technology may have improved, but still all SSDs use some kind of wear leveling: There is a mapping to physical blocks, so that writing is spread evenly on the free blocks. The external address you use when writing a block does not map directly to one physical location on the SSD.
-
I remember him alright. He isn't a quack, but has a tendency to fight windmills. :)
Wrong is evil and must be defeated. - Jeff Ello
Jörgen Andersson wrote:
fight windmills.
I had never heard of that one. That's a cute variation on "tempest in a teapot". I like it. Probably because it applies exactly. LMAO. :-) "Fighting windmills" is probably how I thought of him at the time I sided against him on some of his old claims. One thing I'll say for him, is that he's got honest beliefs. He believes in what he claims, and doesn't try to BS anyone. Which doesn't mean he can't ever be wrong.
-
The trim command was introduced with win 7 iirc
Wrong is evil and must be defeated. - Jeff Ello
-
Even magnetic disks do low level reallocation of blocks when a bad block is detected. The disk addresses appear continuous, but one or more blocks may be physically located in a different location. On a magnetic disk, this of course affects average access time. Probably less than you would think. SSDs always do a physical layer 'reallocation' (which is really an allocation, without the re), below the disk address level, to even out wear, so that the same physical blocks are not used again and again, but new writes are distributed among all free blocks. I would be very surprised if this allocation mechanism wouldn't handle bad pages as well. What would make sense on an SSD is if the disk driver kept track of blocks in read-only files, written once and later only read. If the disk is 90% full, and other files come and go, even with wear leveling the remaining 10% of the blocks may have been written 50,000 times. It would make sense to move read-only files into this area, to provide a 'virgin' area for the next million block writes. (I never heard of any SSD disk doing this, but maybe some of them do.)
"below the disk address level, to even out wear, so that the same physical blocks are not used again and again, but new writes are distributed among all free blocks. I would be very surprised if this allocation mechanism wouldn't handle bad pages as well. " Yeah... that bit is what I thought TRIM was doing. Defrag just does that now if it is pointed at an SSD? But I think so does windows now without you specifically messing with it.