• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

SSD Defragging: The safe way

Running that command, I do see defrag messages. Should I be concerned?
Nope. Whether Windows runs an actual defrag or just the trim option every week, your SSD won't die from this.

The two guidelines I recommend to SSD users is to first backup your data regularly (especially since you can't hear a SSD starting to fail like you can with a hard drive).

The second guideline is to keep some free space in the SSD, whether it is user-enforced free space or overprovisioning by the SSD software.

I do trim my SSDs weekly and defrag the most commonly fragmented files with Defraggler (files with more than 10 fragments) once a month. My 980 Pro lifespan after two years is still at 99%.

That 1% reduction is not the defrag but the 15 TB of benchmarking, game installs and reinstalls, etc over the years.
 
Diskeeper used to outright prevent fragmentation completely, it made sure files were always written to disk in one continuous piece. Unfortunately they no longer offer it anymore and all it's features are now rolled up into their enterprise products.
I Have a feeling that the prevent fragmentation bit of diskeeper may just be a Filter Driver.
If so It's likely possible to install only that Filter Driver from within device manager. and bin all the other nonsense.

IIRC there's a 2nd Defrag app that does a similar thing and better...apparently...
Who was that again?

Just use your SSD as it is meant to, you don't need any special tools for it. Just use it and don't look back! There's many things to say about it, but defragging means unnecessary wear, so don't do it. But it's your SSD, and your money, it's just advice.:)
:)
Is it really "meant to" to be used as SSD manufacturers mean you to use it?
Because SSD manufacturers mean you to use it to death ASAP as SSD manufacturers mean you to buy a new one as soon as they possibly can get you too without you complaining, because they mean to make as much money as they possibly can..!
Part of their plan is to convince the world that SSDs should be used as THEY mean us to.

eg:
... a new technology that claims to extend the lifetime of a flash drive to more than 100 million cycles.​
Even if you were to write and erase data 1,000 times per day, such a drive would last 274 years.
Engineers from Macronix developed the technology and said that even 100 million cycles is not the real end. They simply didn't have the resources to test the memory for 1 billion cycles as it would take several months.​
The improvement to flash lies in adding onboard heaters to small groups of memory cells, which can in turn heal flash memory cells that degrade over time. In fact, flash memory makers are facing a substantial challenge as this degradation accelerates with smaller cells. However, Macronix said that briefly heating the cell to 800 degrees Celsius can entirely heal the cell, prevent degradation and returning the cell to full operation.

Now where's this technology?
It's nowhere to be seen as it would bankrupt? and close down? NAND manufacturers..?

So no; I will not be using SSDs just as manufacturers mean me to.
I might even be treating my SSD to an occasional stint in an oven! :)

TRIM - Defrag - TRIM happens quite often here.
I use myDefrag (myDefrag's flash script)
I've also modded that script to only defrag files and not consolidate space, which I use even more often.

Memory block fragmentation, filesystem fragmentation, and TRIM​


There are 2 kinds of fragmentation that concern SSD disks. The first kind of fragmentation is memory block fragmentation. SSD disks are written in pages (generally 4KB in size) but can only be erased in larger groups called blocks (generally 128 pages or 512KB). This causes fragmentation and results in severe performance loss after the disk has been used for a while. Speed can easily drop by 50% or more. The SSD manufacturers have developed a solution called the TRIM instruction, for more information see  * this Wikipedia article. It is a hardware solution that needs support in the operating system, and only applies when files are being deleted. MyDefrag knows nothing about memory block fragmentation because MyDefrag operates at the filesystem level, not the hardware level. However, the MyDefrag script for Flash memory disks will consolidate free space, and this reduces the problems caused by this kind of fragmentation.​
The second kind of fragmentation is filesystem fragmentation. Files can be split into parts that are placed anywhere on the disk, just like on harddisks. Many users think that this kind of fragmentation does not matter for SSD disks, because the disks have a very low latency (no harddisk heads that have to move about). But Windows still has to do more work when a file is fragmented, to gather all the fragments. There is significant overhead inside Windows, nothing to do with the hardware, and it is all the more noticeable because SSD is so fast. MyDefrag deals with this kind of fragmentation.​

ie:
Defraging the files: good for speed.
Consolidating free space: Good for avoiding future fragmentation and thus wear.
 
You-all may know @THEBOSS619 for his modded drivers.
He's also active on the Win-Raid forum where modded drivers etc are 'The Subject!'

A light version of Diskeeper is what windows uses as it's defrag app for HDDs (and for SSDs on a 1 month schedule apparently)

(I used myDefrag for HDDs as it's around 13% faster than Windows' defrag thx to intelligent file placemment)

The full version of Diskeeper contains the Intelliwrite function that avoids file fragmentation in the 1st place.
ie:
The initial write does not just start in the 1st available bit of space and then fragment with little bits in every subsequent bit of space as normally happens.

It's a filter driver that, it would seem, can be installed via device manager, without all the rest of Diskeeper and is 30 day trial BS.

Here's the full post, with replies from THEBOSS:
" I still use Diskeeper’s feature until now on Windows 10 [and 11] and still doing wonders for me for over 3 years it is a must for any storage devices no matter what to be honest...​
...Only install DKRtWrt, DKTLFSMF, CTFLTMGR, tcefs drivers..."​


I've had WinBlows in square chunks and moved to Linux Mint and Steam's Proton for gaming.
That means I can't/won't be testing this and reporting here at this point.
I hope others here find it easy to install and useful.
You-all might invite THEBOSS to comment here if that's a forum feature I've missed.
 
Last edited:
ou-all may know @THEBOSS619 for his modded drivers.
He's also active on the Win-Raid forum where modded drivers etc are the subject.

A light version of Diskeeper is what windows uses as it's defrag app for HDDs (and for SSDs on a 1 month schedule apparently)

(I used myDefrag for HDDs as it's around 13% faster than Windows' defrag thx to intelligent file placemment)

The full version of Diskeeper contains the Intelliwrite function that avoids file fragmentation in the 1st place.
ie:
The initial write does not just start in the 1st available bit of space and then fragment with little bits in every subsequent bit of space as normally happens.

It's a filter driver that, it would seem, can be installed via device manager, without all the rest of Diskeeper and is 30 day trial BS.

Here's the full post, with replies from THEBOSS:
" I still use Diskeeper’s feature until now on Windows 10 [and 11] and still doing wonders for me for over 3 years it is a must for any storage devices no matter what to be honest...​
...Only install DKRtWrt, DKTLFSMF, CTFLTMGR, tcefs drivers..."​


I've had WinBlows in square chunks and moved to Linux Mint and Steam's Proton for gaming.
That means I can't/won't be testing this and reporting here at this point.
I hope others here find it easy to install and useful.
You-all might invite THEBOSS to comment here if that's a forum feature I've missed.
Hey! thank you for the heads up! :respect: it's really nice to see you here as well :) Linux worlds is full of possibilities I was once a hardcore daily driving Linux OS [PopOS!] during my kernel development for Samsung Note 9 devices... so I know how it feels using an OS that allows you to do anything with it with no consequences :D

Yup, I still use just Diskeeper drivers only till this very day + PrimoCache for speedy operations + my own modded [RAID] driver all while daily driving Win11 24H2 Dev Insider :D

I like to see BSOD screens & rainbows whenever I mess with Windows... especially when messing with SSDs drivers :roll:it's very sensitive thing but I got my Macrium backup saving the day always:laugh:
 
Don't defrag and wear leveling conflict with each other?
 
Don't defrag and wear leveling conflict with each other?
My opinion is yes and no.

Defragging should reduce metadata which free up cells for improved wear levelling.

I think the main reason windows defrags though is nothing to do with wear levelling, but to keep the integrity of the file system intact, NTFS has issues if is too many fragments.
 
I think the main reason windows defrags though is nothing to do with wear levelling, but to keep the integrity of the file system intact, NTFS has issues if is too many fragments.
Exactly. NTFS is a P'o'S file system that always produce errors. Whenever I do disk check, it ALWAYS finds errors to be repaired despite not having any unsafe shutdowns.

 
Exactly. NTFS is a P'o'S file system that always produce errors. Whenever I do disk check, it ALWAYS finds errors to be repaired despite not having any unsafe shutdowns.

NTFS is a file system that suffers from too much success too early on. It was pretty good, maybe even cutting edge when it first came out. But that was a long time ago, better file systems like ZFS have come out but Microsoft has not transitioned to a successor to NTFS (or contributed to one of the open-source FS options that Microsoft could use like).

ReFS was going to be the next broad-interest Microsoft file system but the company lost interest. (yes it is supported by Microsoft and you can use it but Microsoft is not transitioning over to it).
 
Exactly. NTFS is a P'o'S file system that always produce errors. Whenever I do disk check, it ALWAYS finds errors to be repaired despite not having any unsafe shutdowns.
There must be something wrong with your storage device. In the past 30 something years of using NTFS I have never had that happen with any regularity.
 
NTFS has issues if is too many fragments.
I don't see how any filesystem by itself could be resistant to fragmentation and the performance drop it causes. However, the FS driver, the program that actually writes the files in an organised way, can be more or less smart. There's nothing stopping MS from improving and tuning the NTFS driver. It could join fragments in heavily fragmented files on the fly as it's writing data, for example.
 
Exactly. NTFS is a P'o'S file system that always produce errors. Whenever I do disk check, it ALWAYS finds errors to be repaired despite not having any unsafe shutdowns.

You may have another problem if you always get errors, the only time I have seen chkdsk report errors is when I had a underlying problem on the system.

Even when I used to disable disk optimisation years ago, it wouldnt trigger errors, although I did notice lag opening documents which no longer occurs now I let Windows defrag my SSD's.
 
I don't see how any filesystem by itself could be resistant to fragmentation and the performance drop it causes. However, the FS driver, the program that actually writes the files in an organised way, can be more or less smart. There's nothing stopping MS from improving and tuning the NTFS driver. It could join fragments in heavily fragmented files on the fly as it's writing data, for example.
Yes, and no. Some filesystems dictate in the format spec how files must be written, and at what pattern they must be written in. I think NTFS is one of those (it actually derives a lot of that from it's ancestor, HPFS (of OS/2 and really early NT vintage), from an age when we were very concerned with filesystem fragmentation). IIRC, directory listings for example, are always dictated to be written IN THE FILE SYSTEM as alphabetized, not just any random pattern. It goes deeper than that, of course. There are fragmentation patterns the filesystem spec itself is dictated to avoid.

NTFS is far from the most performant, it hasn't been for years. That said it's reliable generally, and has passed as "good enough for most purposes" just fine. It is far from a dinosaur (that'd be HPFS, or worse, FAT), but it is showing it's age a bit and some spec loosening and indeed, driver updates could possibly help this, as a lot of it comes from the age of HDD-exclusive filesystems.
 
You may have another problem if you always get errors, the only time I have seen chkdsk report errors is when I had a underlying problem on the system.

Even when I used to disable disk optimisation years ago, it wouldnt trigger errors, although I did notice lag opening documents which no longer occurs now I let Windows defrag my SSD's.
The only way I found out there were errors was through disk check. System runs perfectly fine, stable, no lags. I run disk check once a while, but it always reports something to be corrected.

From my experience with Windows-equipped computers, this is nothing special. At work, lot of computers tend to have the same issue. They operate 24/7, run always same program and use network. And still, with each-month's regular restart errors are found during disk check. Some computers have HDDs, some SSDs, but there's no significant difference in terms of errors.
 
Back
Top