Question Windows 10 2004 optimization/defrag bug

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535
Hi all

I've just completed the Windows 10 2004 upgrade and I have noticed 2 issues.

1. When I manually trim my SSD in the drive defrag/optimize tool in windows and I reboot it says 'never optimized' when I go back. I heard this was a bug in insider preview which they obviously didn't fix.

2. I happened to have the defrag/optimize tool open at the same time as Control Panel\All Control Panel Items\Security and Maintenance, I initiated a manual maintenance and I caught windows defragging my SSD and then it trimmed it straight afterwards. If i click the optimize button in defrag/optimize tool it only trims it and not defrag.

This seem to only happen when Control Panel\All Control Panel Items\Security and Maintenance initiates its automatic maintenance or if I select start maintenance.

This is concerning as it should never attempt to defrag an SSD.

My laptop is only a few months old and came with a PCIe SSD and Windows 10 1909 so there is no compatibility or lack of trim support issues obviously.

I have disabled scheduled weekly optimizations in the defrag/optimize tool which prevents it from attempting to defrag when the control penal maintenance attempts its maintenance when the computer is idle.
I want to let everyone know that this is happening so others are aware. My other computers that have the latest update are also doing it.
I can't upload a screen shot on Tom's hardwware however here is the link for the question I posted on Microsoft forum which has a screenshot uploaded and you'll see what i mean.
https://answers.microsoft.com/en-us...-04fe-41c9-8535-ed10313b6f33?tm=1590748300087
 
  • Like
Reactions: kenzy9

Colif

Win 11 Master
Moderator
Storage Optimizer will defrag an SSD once a month if volume snapshots are enabled. This is by design and necessary due to slow volsnap copy on write performance on fragmented SSD volumes. It’s also somewhat of a misconception that fragmentation is not a problem on SSDs. If an SSD gets too fragmented you can hit maximum file fragmentation (when the metadata can’t represent any more file fragments) which will result in errors when you try to write/extend a file. Furthermore, more file fragments means more metadata to process while reading/writing a file, which can lead to slower performance.

As far as Retrim is concerned, this command should run on the schedule specified in the dfrgui UI. Retrim is necessary because of the way TRIM is processed in the file systems. Due to the varying performance of hardware responding to TRIM, TRIM is processed asynchronously by the file system. When a file is deleted or space is otherwise freed, the file system queues the trim request to be processed. To limit the peek resource usage this queue may only grow to a maximum number of trim requests. If the queue is of max size, incoming TRIM requests may be dropped. This is okay because we will periodically come through and do a Retrim with Storage Optimizer. The Retrim is done at a granularity that should avoid hitting the maximum TRIM request queue size where TRIMs are dropped.
https://superuser.com/questions/1150641/should-i-defragment-my-ssd

https://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

if system restore is on, your pc will defrag ssd once a month. This isn't something new with 2004. as its done it for years. But other than that, Yes, Windows doesn't defrag ssd.
 
Last edited:

Colif

Win 11 Master
Moderator
you just did a version update, if there is going to be anytime the system needs to run a clean up of ssd it would be just after a version update.

Could be it also ran a volsnap operation at same time as defrag. The defrag app also runs trim. They not the basic old defrag from win 7, its more intelligent and knows what not to do.
 

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535
you just did a version update, if there is going to be anytime the system needs to run a clean up of ssd it would be just after a version update.

Could be it also ran a volsnap operation at same time as defrag. The defrag app also runs trim. They not the basic old defrag from win 7, its more intelligent and knows what not to do.
So I should just leave storage optimizer settings to normal and let windows do its thing instead of disabling them? Do I have a lack of knowledge and understanding of this process? Am I still stuck with the thoughts of the days of windows 7 and defrag of SSD?
 

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535
https://superuser.com/questions/1150641/should-i-defragment-my-ssd

https://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

if system restore is on, your pc will defrag ssd once a month. This isn't something new with 2004. as its done it for years. But other than that, Yes, Windows doesn't defrag ssd.
So I should just leave storage optimizer settings to normal and let windows do its thing instead of disabling them? Do I have a lack of knowledge and understanding of this process? Am I still stuck with the thoughts of the days of windows 7 and defrag of SSD?
 

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535
"This is concerning as it should never attempt to defrag an SSD. "

Windows knows the difference between HDD and SSD.
Even though it may say "defrag"..it is NOT doing the same thing as it would with an HDD.
So I should just leave storage optimizer settings to normal and let windows do its thing instead of disabling them? Do I have a lack of knowledge and understanding of this process? Am I still stuck with the thoughts of the days of windows 7 and defrag of SSD?
 

Colif

Win 11 Master
Moderator
So I should just leave storage optimizer settings to normal and let windows do its thing instead of disabling them? Do I have a lack of knowledge and understanding of this process? Am I still stuck with the thoughts of the days of windows 7 and defrag of SSD?
Yes. I would leave it as is.

Its not your fault, its just that the number of articles written about it being bad just out number the newer ones that show there are exceptions. And it takes time for new truths to replace the old ones.

Windows Storage Management evolves with the storage methods available, soon enough no one will have hdd but defrag will still do something else, like run trim

But in general terms, you yourself doesn't need to run defrag on ssd or even drives themselves as it should all be done at idle.

The one thing I noticed after installing 2004 was the search indexer went nuts as they have updated it so it uses less resources on systems with hdd, and needed to set itself up.

I use defraggler for defrag anyway. It doesn't even list the ssd.
 

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535
Yes. I would leave it as is.

Its not your fault, its just that the number of articles written about it being bad just out number the newer ones that show there are exceptions. And it takes time for new truths to replace the old ones.

Windows Storage Management evolves with the storage methods available, soon enough no one will have hdd but defrag will still do something else, like run trim

But in general terms, you yourself doesn't need to run defrag on ssd or even drives themselves as it should all be done at idle.

The one thing I noticed after installing 2004 was the search indexer went nuts as they have updated it so it uses less resources on systems with hdd, and needed to set itself up.

I use defraggler for defrag anyway. It doesn't even list the ssd.
I've just had someone respond on the Microsoft support forum talking about the same issue. Windows defragging when manual maintenance is done.

https://answers.microsoft.com/en-us...essageId=c31511c2-4038-4a63-b671-7db1699d86cd

he states

"I have the same issue with defrag. It's a bug that many insiders reported to Microsoft, even before 2004 was rolled out to the general public.
There is not much you can do at the moment, just hope that they will fix it soon. Do not carry out a manual maintenance, because, as you noticed, your SSD will be defragged, which is bad for SSDs."
 

Colif

Win 11 Master
Moderator
just another thing they need to fix in 2004 before making it available on Windows Update. The people who install it via ISO or Update assistant are essentially on the really slow ring of the Insiders program, we get all the errors MS was ignoring while it wasn't live. More people that get it, more incentive for them to fix the problems.

I don't know how many people ever think to run maintenance on their drives... I used to enjoy watching defrag and actually downloaded defraggler so i could watch the sectors being removed. I am old enough to remember when running a screensaver would restart Defrag. That was a long time ago now. Now its just a background task windows runs if you leave PC alone long enough.
 
D

Deleted member 14196

Guest
I've just had someone respond on the Microsoft support forum talking about the same issue. Windows defragging when manual maintenance is done.

https://answers.microsoft.com/en-us...essageId=c31511c2-4038-4a63-b671-7db1699d86cd

he states

"I have the same issue with defrag. It's a bug that many insiders reported to Microsoft, even before 2004 was rolled out to the general public.
There is not much you can do at the moment, just hope that they will fix it soon. Do not carry out a manual maintenance, because, as you noticed, your SSD will be defragged, which is bad for SSDs."
There is no Bug don’t do manual maintenance let windows handle the trim you don’t have to do anything You should know that you don’t defrag SSD’s. There is no bug if you just leave it alone
 
  • Like
Reactions: gkdofaus

Colif

Win 11 Master
Moderator
Microsoft trying to stop you doing things
Don't run maintenance or we will defrag your ssd
Don't manually update Win 10 via running windows update or we give you trial versions of updates that normal users won't get by not running updates.
Secret pitfalls designed to stop you?
 

gkdofaus

Distinguished
Oct 10, 2012
33
1
18,535

Math Geek

Titan
Ambassador
as far as i know you're not supposed to defrag ssd's anyway. so "too often" should be "should not do it at all"

it's possible i missed the change in suggested use, but i don't usually miss such things. feel free to link me to the change is suggestions from somewhere reputable :)

i'd make sure it does not do it at all, but i know win 10 does not like you to do anything to MS's pc so it will likely block your attempts or just put it back the way they want it at the next update like they do for every other thing you change. your pc is not your pc anymore, so if MS feels like doing this, they will and you are not supposed to question it in any way.
 

Colif

Win 11 Master
Moderator
So since i don't use fast startup, I guess I better disable the maintenance on my ssd until they fix it...

lol at it trying to run TRIM on hdd. What were they thinking.

@Math Geek Defrag also runs TRIM now so that would be why it runs "defrag" on ssd, it really isn't running the old processes, its just running trim.
 

Diceman_2037

Distinguished
Dec 19, 2011
53
3
18,535
@Math Geek Defrag also runs TRIM now so that would be why it runs "defrag" on ssd, it really isn't running the old processes, its just running trim.

it also runs a defrag pass on ntfs metadata to prevent a case where new files can't be written or modified on the volume.

The bleepingcomputer article is also misinformed about the Trim events failing on HDD's.
This capability has been added intentionally to add compatibility for SMR HDD's implementing a NAND cache and because the Shingling is also handled via FSTRIM.