• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

SSD Defragging: The safe way

Joined
Oct 5, 2024
Messages
159 (1.49/day)
Location
United States of America
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.
 
Joined
May 14, 2021
Messages
14 (0.01/day)
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.
 
Joined
Oct 24, 2020
Messages
467 (0.30/day)
Location
Belgium
System Name MSi Coffee Lake
Processor i7-8700k
Motherboard MSI Z370 GAMING PRO CARBON AC
Cooling NZXT something AIO loop
Memory 16GB Kingston HyperX 2133 C14 Fury Black
Video Card(s) TITAN Xp Jedi Order Edition
Storage Samsung 960 Evo NVMe
Display(s) Medion 23'
Case Cooler Master Stryker
Audio Device(s) onboard
Power Supply BeQuiet 600W
Mouse Logitech Trackman T-BB18
Keyboard Generic hp
Software Windows 10
Joined
May 14, 2021
Messages
14 (0.01/day)
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:
Joined
Dec 23, 2018
Messages
365 (0.16/day)
System Name Asus TUF Gaming FA506IU Laptop
Processor AMD Ryzen 7 4800H with Radeon Graphics
Motherboard AMD K17.6 FCH, AMD K17.6 IMC
Cooling Dual Fans Design with Self-Cleaning Cooling
Memory Samsung DRR4 - 3200Mhz 16GB(8GBx2)
Video Card(s) GeForce GTX 1660 Ti (6 GB)
Storage WDC PC SN530 SDBPNPZ-256G-1002 + SHGP31-500GM-2 + ST1000LM035-1RK172
Display(s) LM156LF-2F03 144HZ Adaptive SYNC
Audio Device(s) Realtek ALC256 @ AMD K17.6
Power Supply ASUS Power Brick 180W
Mouse ROG SICA Gaming Mouse
Benchmark Scores CineBench R23 Single core:- 1290 points CineBench R23 Multi core:- 11111 points
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:
 
Joined
Feb 1, 2019
Messages
3,724 (1.71/day)
Location
UK, Midlands
System Name Main PC
Processor 13700k
Motherboard Asrock Z690 Steel Legend D4 - Bios 13.02
Cooling Noctua NH-D15S
Memory 32 Gig 3200CL14
Video Card(s) 4080 RTX SUPER FE 16G
Storage 1TB 980 PRO, 2TB SN850X, 2TB DC P4600, 1TB 860 EVO, 2x 3TB WD Red, 2x 4TB WD Red
Display(s) LG 27GL850
Case Fractal Define R4
Audio Device(s) Soundblaster AE-9
Power Supply Antec HCG 750 Gold
Software Windows 10 21H2 LTSC
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.
 
Joined
Jul 24, 2024
Messages
350 (1.93/day)
System Name AM4_TimeKiller
Processor AMD Ryzen 5 5600X @ all-core 4.7 GHz
Motherboard ASUS ROG Strix B550-E Gaming
Cooling Arctic Freezer II 420 rev.7 (push-pull)
Memory G.Skill TridentZ RGB, 2x16 GB DDR4, B-Die, 3800 MHz @ CL14-15-14-29-43 1T, 53.2 ns
Video Card(s) ASRock Radeon RX 7800 XT Phantom Gaming
Storage Samsung 990 PRO 1 TB, Kingston KC3000 1 TB, Kingston KC3000 2 TB
Case Corsair 7000D Airflow
Audio Device(s) Creative Sound Blaster X-Fi Titanium
Power Supply Seasonic Prime TX-850
Mouse Logitech wireless mouse
Keyboard Logitech wireless keyboard
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.

 
Joined
Oct 5, 2024
Messages
159 (1.49/day)
Location
United States of America
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).
 
Joined
Jul 30, 2019
Messages
3,380 (1.69/day)
System Name Still not a thread ripper but pretty good.
Processor Ryzen 9 7950x, Thermal Grizzly AM5 Offset Mounting Kit, Thermal Grizzly Extreme Paste
Motherboard ASRock B650 LiveMixer (BIOS/UEFI version P3.08, AGESA 1.2.0.2)
Cooling EK-Quantum Velocity, EK-Quantum Reflection PC-O11, D5 PWM, EK-CoolStream PE 360, XSPC TX360
Memory Micron DDR5-5600 ECC Unbuffered Memory (2 sticks, 64GB, MTC20C2085S1EC56BD1) + JONSBO NF-1
Video Card(s) XFX Radeon RX 5700 & EK-Quantum Vector Radeon RX 5700 +XT & Backplate
Storage Samsung 4TB 980 PRO, 2 x Optane 905p 1.5TB (striped), AMD Radeon RAMDisk
Display(s) 2 x 4K LG 27UL600-W (and HUANUO Dual Monitor Mount)
Case Lian Li PC-O11 Dynamic Black (original model)
Audio Device(s) Corsair Commander Pro for Fans, RGB, & Temp Sensors (x4)
Power Supply Corsair RM750x
Mouse Logitech M575
Keyboard Corsair Strafe RGB MK.2
Software Windows 10 Professional (64bit)
Benchmark Scores RIP Ryzen 9 5950x, ASRock X570 Taichi (v1.06), 128GB Micron DDR4-3200 ECC UDIMM (18ASF4G72AZ-3G2F1)
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.
 
Joined
Jan 3, 2021
Messages
3,717 (2.51/day)
Location
Slovenia
Processor i5-6600K
Motherboard Asus Z170A
Cooling some cheap Cooler Master Hyper 103 or similar
Memory 16GB DDR4-2400
Video Card(s) IGP
Storage Samsung 850 EVO 250GB
Display(s) 2x Oldell 24" 1920x1200
Case Bitfenix Nova white windowless non-mesh
Audio Device(s) E-mu 1212m PCI
Power Supply Seasonic G-360
Mouse Logitech Marble trackball, never had a mouse
Keyboard Key Tronic KT2000, no Win key because 1994
Software Oldwin
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.
 
Joined
Feb 1, 2019
Messages
3,724 (1.71/day)
Location
UK, Midlands
System Name Main PC
Processor 13700k
Motherboard Asrock Z690 Steel Legend D4 - Bios 13.02
Cooling Noctua NH-D15S
Memory 32 Gig 3200CL14
Video Card(s) 4080 RTX SUPER FE 16G
Storage 1TB 980 PRO, 2TB SN850X, 2TB DC P4600, 1TB 860 EVO, 2x 3TB WD Red, 2x 4TB WD Red
Display(s) LG 27GL850
Case Fractal Define R4
Audio Device(s) Soundblaster AE-9
Power Supply Antec HCG 750 Gold
Software Windows 10 21H2 LTSC
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.
 
Joined
Aug 20, 2007
Messages
21,630 (3.40/day)
Location
Olympia, WA
System Name Pioneer
Processor Ryzen R9 9950X
Motherboard GIGABYTE Aorus Elite X670 AX
Cooling Noctua NH-D15 + A whole lotta Sunon, Phanteks and Corsair Maglev blower fans...
Memory 64GB (2x 32GB) G.Skill Flare X5 @ DDR5-6000 CL30
Video Card(s) XFX RX 7900 XTX Speedster Merc 310
Storage Intel 5800X Optane 800GB boot, +2x Crucial P5 Plus 2TB PCIe 4.0 NVMe SSDs
Display(s) 55" LG 55" B9 OLED 4K Display
Case Thermaltake Core X31
Audio Device(s) TOSLINK->Schiit Modi MB->Asgard 2 DAC Amp->AKG Pro K712 Headphones or HDMI->B9 OLED
Power Supply FSP Hydro Ti Pro 850W
Mouse Logitech G305 Lightspeed Wireless
Keyboard WASD Code v3 with Cherry Green keyswitches + PBT DS keycaps
Software Gentoo Linux x64 / Windows 11 Enterprise IoT 2024
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.
 
Joined
Jul 24, 2024
Messages
350 (1.93/day)
System Name AM4_TimeKiller
Processor AMD Ryzen 5 5600X @ all-core 4.7 GHz
Motherboard ASUS ROG Strix B550-E Gaming
Cooling Arctic Freezer II 420 rev.7 (push-pull)
Memory G.Skill TridentZ RGB, 2x16 GB DDR4, B-Die, 3800 MHz @ CL14-15-14-29-43 1T, 53.2 ns
Video Card(s) ASRock Radeon RX 7800 XT Phantom Gaming
Storage Samsung 990 PRO 1 TB, Kingston KC3000 1 TB, Kingston KC3000 2 TB
Case Corsair 7000D Airflow
Audio Device(s) Creative Sound Blaster X-Fi Titanium
Power Supply Seasonic Prime TX-850
Mouse Logitech wireless mouse
Keyboard Logitech wireless keyboard
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.
 
Top