SSDs get defragged?


Recommended Posts

I thought Windows only "optimizes" SSD's using the trim command. Not an actual defrag.

Link to comment
Share on other sites

I thought Windows only "optimizes" SSD's using the trim command. Not an actual defrag.

Well according to this article, SSDs can get fragmented and it does cause performance issues so Windows defrags it.

I thought fragmentation was the point of wear leveling?

Link to comment
Share on other sites

wear leveling distributes writes across the chips so that one chip doesn't get 1000 writes and the others stay at 2.  It is so that all of your drive gets used. 

 

wear leveling isn't the same as defragging.  wikipedia is your friend.

Link to comment
Share on other sites

Wear levelling hasn't got anything to do with preventing fragmentation, all WL does is make sure each flash cell gets an equivalent amount of use so you don't rapidly burn through it's P/E cycles.

 

The defrag Windows 8.x does to SSDs is a subset of the routines in a regular defrag run monthly to keep the number of filesystem fragments to a manageable level, rather than reducing the need for head seeks as in a HDD.

Link to comment
Share on other sites

Fragmentation on an SSD will produce some slight delay compared to if all files were contiguous... And you would notice that if time went 1,000,000 times slower for you. (i.e. if every file on SSD A is jumbled all over the place, but on SSD B is all continious, you would not notice a difference in the slightest).

 

Defragging SSDs just reduces their lifespan, and provides no benefit what so ever.

Link to comment
Share on other sites

I believe this was posted on Neowin previously but cannot be bothered to look it up right now.

 

In the article though, it clearly states:

 

 

The file systems metadata keeps track of fragments and can only keep track of so many. Defragmentation in cases like this is not only useful, but absolutely needed.

 

Yes, your SSD's file system sometimes needs a kind of defragmentation and that's handled by Windows, monthly by default, when appropriate.

 

In short, Windows does NOT defrag SSDs to improve performance like it does on HDDs, it defrags SSDs because it has to, otherwise the file system would break because it had more fragments than it could keep track of.

 

That being said, after reading that my Evo 840 has a expected lifespan of 20+ years with pretty heavy usage (more-so than monthly defrags and general system usage will use), I'm not worried about losing SSD lifespan due to a little bit of defragging that must happen.

Link to comment
Share on other sites

Do you have an obsession with the phrase 'wear leveling'?

What the hell is that supposed to mean? I am not supposed to say that? It's a function of an SSD that I thought prevented things like defragging and writing zeroes. I didn't realize I wasn't supposed to say it.

wear leveling distributes writes across the chips so that one chip doesn't get 1000 writes and the others stay at 2.  It is so that all of your drive gets used. 

 

wear leveling isn't the same as defragging.  wikipedia is your friend.

I know what it does. due to wear leveling, the drive is fragmented. Data is not on sequential blocks.

Link to comment
Share on other sites

Already posted: https://www.neowin.net/forum/topic/1238740-the-real-and-complete-story-does-windows-defragment-your-ssd/

@OP

It's clearly stated why the defragmenter still works on SSDs: "There is a maximum level of fragmentation that the file system can handle"

Ah. Oops apparently I posted in that topic and didn't remember. My apologies. That is embarrassing. I am still confused how it works. How can it guarantee data is sequential?
Link to comment
Share on other sites

n_K, perhaps you should read the article.

"When he says volume snapshots or "volsnap" he means the Volume Shadow Copy system in Windows. This is used and enabled by Windows System Restore when it takes a snapshot of your system and saves it so you can rollback to a previous system state"

I don't use shadow copy.

Link to comment
Share on other sites

yes only 20 years.  I will have replaced my computer only 4 times by then which will replace the hard drive too.  it is too short...we need an infinite lifespan so that the drive lasts longer than I do, after the sata standard has passed into direct optical input to our brains. 

 

In all seriousness, I would have probably forgotten what is on the drive before it dies.


"When he says volume snapshots or "volsnap" he means the Volume Shadow Copy system in Windows. This is used and enabled by Windows System Restore when it takes a snapshot of your system and saves it so you can rollback to a previous system state"

I don't use shadow copy.

so then you don't have anything to worry about being that you have disabled the system restore feature (enabled by default, which also takes a copy of your system state every time windows update applies patches). He goes on to state that defrag is only runs when this feature is enabled.

Link to comment
Share on other sites

yes only 20 years.  I will have replaced my computer only 4 times by then which will replace the hard drive too.  it is too short...we need an infinite lifespan so that the drive lasts longer than I do, after the sata standard has passed into direct optical input to our brains. 

 

In all seriousness, I would have probably forgotten what is on the drive before it dies.

Exactly, I have an aging OCZ Apex SSD that I just upgraded from with a Christmas present, the drive still works fine but anyone who invested in early SSDs knows what "works fine" means for old JMicron-based SSDs. But it has not died yet (despite OCZ being notorious for drive failures). Now I have a decent SSD that's rated with a much higher expected life than my old one and I will likely replace it long before its even halfway to its expected age before failure.

 

Anybody worried about defrags (especially only once a month) affecting SSD lifespan either has a very old SSD (like my Apex), or doesn't understand how much better current SSDs are at lasting a long while.

Link to comment
Share on other sites

I think the old graphic of seeing color blocks moved in realtime is causing more of the confusion.  Modern defrag doesn't exactly work like that on SSD's.  It should probably be labeled disk optimization and health now.

Link to comment
Share on other sites

Exactly, I have an aging OCZ Apex SSD that I just upgraded from with a Christmas present, the drive still works fine but anyone who invested in early SSDs knows what "works fine" means for old JMicron-based SSDs. But it has not died yet (despite OCZ being notorious for drive failures). Now I have a decent SSD that's rated with a much higher expected life than my old one and I will likely replace it long before its even halfway to its expected age before failure.

 

Anybody worried about defrags (especially only once a month) affecting SSD lifespan either has a very old SSD (like my Apex), or doesn't understand how much better current SSDs are at lasting a long while.

I am curious to know how it works though. How can it "defrag" and guarantee that data is sequential on the drive? As I said, I thought with wear leveling, data is not always sequential - this having a fragmented drive (data scattered around) is good.

Link to comment
Share on other sites

I am curious to know how it works though. How can it "defrag" and guarantee that data is sequential on the drive? As I said, I thought with wear leveling, data is not always sequential - this having a fragmented drive (data scattered around) is good.

 

There is no such thing as sequential in memory chips.  When you have a set amount of flash chips on the SSD, accessing the chip is the same for any block/page in that chip.  So sequential doesn't matter for the access/read/write part.  What having less fragmentation does is allow the file tables to keep less chunks per file to keep the total records down per file.  On a mechanical drive, every single block is a physical location that has to be physically read by the head.  Once you access a flash chip you have access to any data on that chip equally.  Hope that helps.  

 

One note, sequential actually hurts SSD's since you would rather split the data into chunks for each physical chip so they can all be read at once like a RAID0.

Link to comment
Share on other sites

There is no such thing as sequential in memory chips.  When you have a set amount of flash chips on the SSD, accessing the chip is the same for any block/page in that chip.  So sequential doesn't matter for the access/read/write part.  What having less fragmentation does is allow the file tables to keep less chunks per file to keep the total records down per file.  On a mechanical drive, every single block is a physical location that has to be physically read by the head.  Once you access a flash chip you have access to any data on that chip equally.  Hope that helps.

So it is like I thought? It does not defrag the drive (moving stuff around)?

Link to comment
Share on other sites

Well I have never actually looked to see if it is moving blocks but it would have to at some point.  Chips are still broken into smaller pieces by design that will not fit the puzzle needed for the given file.  Modern SSD's and file system will minimize it greatly but it is still a flaw.  I'd like to find out, I'll have to look.  Something about that article bothers me however.  They speak of 

"If you disable defragmentation completely, you are taking a risk that your filesystem metadata could reach maximum fragmentation and get you potentially in trouble."

 

Now this doesn't seem to make sense.  I think maybe one big file being too fragmented could be a problem but not the total number of fragmentations.  Someone with tons of small files would have many more records than a common drive with just a lot of fragmentation. In the end its all records, fragmentation is just more records. I'd like to hear what other people think about that. 

Link to comment
Share on other sites

Well I have never actually looked to see if it is moving blocks but it would have to at some point.  Chips are still broken into smaller pieces by design that will not fit the puzzle needed for the given file.  Modern SSD's and file system will minimize it greatly but it is still a flaw.  I'd like to find out, I'll have to look.  Something about that article bothers me however.  They speak of 

"If you disable defragmentation completely, you are taking a risk that your filesystem metadata could reach maximum fragmentation and get you potentially in trouble."

 

Now this doesn't seem to make sense.  I think maybe one big file being too fragmented could be a problem but not the total number of fragmentations.  Someone with tons of small files would have many more records than a common drive with just a lot of fragmentation. In the end its all records, fragmentation is just more records. I'd like to hear what other people think about that. 

Yes that is why I find the article confusing. If it moves data around, how is it any less fragmented? Yes wear leveling is something that comes in the discussion here. Surely a single 500GB file does not take up one block on the SSD. So it is fragmented in the sense that relevant data is not next to adjacent blocks.

Link to comment
Share on other sites

windows 8 does *not* 'defrag' ssds. defragging an ssd in the windows 8 defrag tool simply sends trim command to the drive.

 

It even says its 'trimming' and not defragging when you click optimize: 

 

6GIfFRv.png

Link to comment
Share on other sites

The article also says, and is quite vague regarding, that it does not defrag a ssd the same as a hdd.  Upon reading the wiki, it says that Disk Defragmenter handles the trim commands to the drive.  But what exactly other than trim that is doing is still a mystery, if it is doing anything other than trim at all.

"In addition, Disk Defragmenter is also responsible performing TRIM command on SSDs.[13]"

Link to comment
Share on other sites

windows 8 does *not* 'defrag' ssds. defragging an ssd in the windows 8 defrag tool simply sends trim command to the drive.

 

It even says its 'trimming' and not defragging when you click optimize: 

 

6GIfFRv.png

 

Still doesn't mean that trim wont move blocks.  I believe it does still move blocks or else how would it ensure the chips were being used evenly.  It has to analyze the usage of the data and determine the location based on that.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.