Solved Defrag on SSD

jeffrys

Power User
Power User
Messages
503
Location
BELGIUM
hi guys,

installed 8.1 some 2 weeks ago (give or take).

Now today i wanted to look to my 2 external spindle drives if defrag had run and it did run......BUT also on my Samsung SSD's which i never do myself.

So has anyone else has this problem too because i do not find this funny.

thanks

Jeff

Note   Note
Windows 8 erroneously defrags SSDs, indeed. Doesn't look like it's been fixed in Windows 8.1.

My blog's got only one article in English, but it's about this issue :)

Why Windows 8 defragments your SSD and how you can avoid this

 
Last edited by a moderator:

My Computer

System One

  • OS
    WINDOWS 8.1 x64
    Computer type
    PC/Desktop
    CPU
    INTEL CORE I--3770K LGA1155
    Motherboard
    ASUS P8Z77-V
    Memory
    KINGSTON 2400 MHZ KHX24C11K4 16GB
    Graphics Card(s)
    INTEL HD GRAFICS 4000
    Monitor(s) Displays
    Philip BDL3245€ 32 inch
    Screen Resolution
    1920 x 1080
    Hard Drives
    2 SAMSUNG 840 PRO RAID 0 ON BOARD 2 x 128 GB
    Keyboard
    LOGITEC MX™ 5500
    Mouse
    LOGITEC MX 5500
    Internet Speed
    120 Mbps
Never defrag a SSD! They use TRIM instead. Defragging a SSD shortens its life due to all the writes that occur when defragging.
 

My Computer

System One

  • OS
    Windows 8 Pro
Last edited:

My Computer

System One

  • OS
    64-bit Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom self built
    CPU
    Intel i7-8700K OC'd to 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    OCZ Series Gold OCZZ1000M 1000W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Browser
    Internet Explorer 11
    Antivirus
    Malwarebyte Anti-Malware Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
Never defrag a SSD! They use TRIM instead. Defragging a SSD shortens its life due to all the writes that occur when defragging.

He's aware of that.

His complaint was that windows 8 had defragged his SSD automatically.
 

My Computer

System One

  • OS
    Windows 8 x64
    Computer type
    Laptop
    System Manufacturer/Model
    Toshiba Qosmio X70
    CPU
    i7-4700MQ
    Memory
    12 GB Samsung DDR3L @ 1600 mhz
    Graphics Card(s)
    Intel HD 4600 + NVIDIA GTX 770M
    Screen Resolution
    1920x1080
    Hard Drives
    256 GB Samsung 840 Pro SSD
    750 GB Seagate 5400 RPM HDD
    Mouse
    Razer Orochi Blade
    Internet Speed
    15 mbps/1 mbps
    Browser
    Chrome
    Antivirus
    Avast
Never defrag a SSD! They use TRIM instead. Defragging a SSD shortens its life due to all the writes that occur when defragging.

He's aware of that.

His complaint was that windows 8 had defragged his SSD automatically.
He probably read it wrong thinking that it defragged the HDD and SSD when actually it trimmed the SSD. . .
 

My Computer

System One

  • OS
    Win 8, (VM win7, XP, Vista)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    HP Pavilion p1423w
    CPU
    Intel Core i5 3330 Ivy Bridge
    Motherboard
    Foxconn - 2ADA Ivy Brige
    Memory
    16 GB 1066MHz DDR3
    Graphics Card(s)
    ATI Radeon HD 5450
    Sound Card
    HD Realteck (Onboard)
    Monitor(s) Displays
    Mitsubishi LED TV/Montior HD, Dell 23 HD, Hanspree 25" HD
    Screen Resolution
    Mit. 1980-1080, Dell 2048-115, Hanspree 1920-10802
    Hard Drives
    1 SanDisk 240Gig SSD, 2 Samsung 512Gig SSDs
    Case
    Tower
    Cooling
    Original (Fans)
    Keyboard
    Microsoft Keyboard 2000
    Mouse
    Microsoft Optical Mouse 5000
    Internet Speed
    1.3 (350 to 1024 if lucky)
    Browser
    Firefox 19.1
    Antivirus
    MSE-Defender
Hi there
Windows 8 and 8.1 DO NOT defrag SSD's. - Don't even THINK about it. In any case I often wonder if it's ever worth defragging a normal HDD anyway. If you've moved your OS + programs to an SSD your HDD's will contain essentially USER DATA which probably doesn't change hugely anyway. I really think the time spent in defragging a classical spinner isn't worth while.

(Virtual Machine disks are a different argument - but the Virtual machine software will have its own routines for defragging Virtual Disks - you don't need to use the standard windows software for this).

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)
hi guys,

included my prtscrn that made me worry, saying that C:drive and S:drive (together 2 SSD's in Raid0) where optimized on july 20th.

Can well be this is nothing, on the other hand, it is Windows 8.1, so BETA and one never knows if bugs are in or not.....

So i disabled optimization.


Jeff


Jimbo,

i am convinced thtat HHD's need defrag, certainly when the OS is on it. In time computer will slow down, will also slow down when

there is not enough free space. Just a thought.

Jeff defrag.png
 

My Computer

System One

  • OS
    WINDOWS 8.1 x64
    Computer type
    PC/Desktop
    CPU
    INTEL CORE I--3770K LGA1155
    Motherboard
    ASUS P8Z77-V
    Memory
    KINGSTON 2400 MHZ KHX24C11K4 16GB
    Graphics Card(s)
    INTEL HD GRAFICS 4000
    Monitor(s) Displays
    Philip BDL3245€ 32 inch
    Screen Resolution
    1920 x 1080
    Hard Drives
    2 SAMSUNG 840 PRO RAID 0 ON BOARD 2 x 128 GB
    Keyboard
    LOGITEC MX™ 5500
    Mouse
    LOGITEC MX 5500
    Internet Speed
    120 Mbps
Windows 8/8.1 does not defrag SSDs. Only HDDs are defragged. Windows 8/8.1 uses TRIM on SSDs instead. TRIM does not harm a SSD at all. In fact, using TRIM on your SSD every so often as needed actually helps improve your SSD's performance and life span just like defragging a HDD does. :)

http://en.wikipedia.org/wiki/TRIM_(SSD_command)

Perhaps that issue in the article Vadim linked to above was with old first generation SSDs. If I use either command below, my SSD gets trimmed and not defragged.

defrag C: /O /U /V

defrag C: /O /L /U /V


SSD.jpg
 
Last edited:

My Computer

System One

  • OS
    64-bit Windows 10
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Custom self built
    CPU
    Intel i7-8700K OC'd to 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G7 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    OCZ Series Gold OCZZ1000M 1000W
    Case
    Thermaltake Core P3
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gb/s Download and 35 Mb/s Upload
    Browser
    Internet Explorer 11
    Antivirus
    Malwarebyte Anti-Malware Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone

My Computer

System One

  • OS
    Win 8.1
    Computer type
    Laptop
    System Manufacturer/Model
    Acer Aspire E1-571
    CPU
    i5-3230m
    Motherboard
    Acer Type-2
    Memory
    8GB DDR3 1333MHz
    Graphics Card(s)
    Intel HD 4000
    Sound Card
    High Definiton Audio Device
    Monitor(s) Displays
    Generic
    Screen Resolution
    1366x768
    Hard Drives
    Samsung 850 Pro 256GB
    PSU
    Generic
    Keyboard
    QWERTY
    Mouse
    ELANTECH Touchpad
    Internet Speed
    12.68Mbps
    Browser
    IE11
    Antivirus
    Windows Defender
Shawn,

What you're saying is correct... in theory :)

1. I've researched this issue long enough to be certain that the bug exists and reproduces on all Windows 8 machines with default defrag and maintenance settings.

2. My blog readers provided me with enough data to support this point, and modern SSDs are affected as well. I've got a lot of logs posted by my readers from different machines. Feel free to dig thru them, looking for Windows 8 PCs and finding proof (SSD models are easy to figure out from the logs).

3. Please read my blog post carefully to see how the issue occurs (the commands you've posted are irrelevant to the issue). Then check the logged events on all machines available to you. The OS has to be installed for at least a month for the defrag to occur with reasonable probability and be reflected in the event log. But I assure you it will occur sooner or later ;)

I can see if I can translate my CheckBootSpeed utility to English, so we can get more logs from EF readers. Or I can throw a quick PS script. But 8.1 Preview is too recent, so the logs are not likely to show the issue. But that doesn't mean the issue will not occur.


brummyfan,
The service start type is manual, so it starts only for defrag/optimization.
 
Last edited:

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Pavilion dv7t (17.3'', i7-2630QM, HD 6770M 1Gb, 8Gb RAM, 2 SSD@120Gb + 1 HDD@750Gb)
I have found two instances of defrag on the 26th July ( see the snip), I have excluded my SSD drive from Automatic maintenance but I couldn't find "ScheduledDefrag" in my Task schedule Library.
Capture.JPG
Capture1.JPG
 

My Computer

System One

  • OS
    Win 8.1
    Computer type
    Laptop
    System Manufacturer/Model
    Acer Aspire E1-571
    CPU
    i5-3230m
    Motherboard
    Acer Type-2
    Memory
    8GB DDR3 1333MHz
    Graphics Card(s)
    Intel HD 4000
    Sound Card
    High Definiton Audio Device
    Monitor(s) Displays
    Generic
    Screen Resolution
    1366x768
    Hard Drives
    Samsung 850 Pro 256GB
    PSU
    Generic
    Keyboard
    QWERTY
    Mouse
    ELANTECH Touchpad
    Internet Speed
    12.68Mbps
    Browser
    IE11
    Antivirus
    Windows Defender
brummyfan, the screenshot is inconclusive. Please post the text results of the PS command (copy/paste from the window):
Code:
Get-EventLog -LogName Application -Source "microsoft-windows-defrag" | sort timegenerated -desc | fl timegenerated, message

ScheduledDefrag is in the Task Scheduler: Library - Microsoft - Windows - Defrag. I see it in 8.1.
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Pavilion dv7t (17.3'', i7-2630QM, HD 6770M 1Gb, 8Gb RAM, 2 SSD@120Gb + 1 HDD@750Gb)
Thanks, I found the "ScheduledDefrag", text results attached.
Untitled.jpg
 

My Computer

System One

  • OS
    Win 8.1
    Computer type
    Laptop
    System Manufacturer/Model
    Acer Aspire E1-571
    CPU
    i5-3230m
    Motherboard
    Acer Type-2
    Memory
    8GB DDR3 1333MHz
    Graphics Card(s)
    Intel HD 4000
    Sound Card
    High Definiton Audio Device
    Monitor(s) Displays
    Generic
    Screen Resolution
    1366x768
    Hard Drives
    Samsung 850 Pro 256GB
    PSU
    Generic
    Keyboard
    QWERTY
    Mouse
    ELANTECH Touchpad
    Internet Speed
    12.68Mbps
    Browser
    IE11
    Antivirus
    Windows Defender
Thanks for the screenshot. I see that the C drive gets re-trimmed and defragged on 26/07/2013 along with System Reserved. If C is SSD, then there you go.
 

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Pavilion dv7t (17.3'', i7-2630QM, HD 6770M 1Gb, 8Gb RAM, 2 SSD@120Gb + 1 HDD@750Gb)
I see that as well...
defrag.png
C: and recovery are the SSD here.

There are a few lines that mention a defragmentation.

Do we really have proof it really defragged? Or the bug consists in just displaying the message of a defragmentation after the trim just happened?

Just in case, I've disabled the automatic optimization for C: and recovery until I find out more about this.
 

My Computer

System One

  • OS
    Windows 10 x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Envy DV6 7250
    CPU
    Intel i7-3630QM
    Motherboard
    HP, Intel HM77 Express Chipset
    Memory
    16GB
    Graphics Card(s)
    Intel HD4000 + Nvidia Geforce 630M
    Sound Card
    IDT HD Audio
    Monitor(s) Displays
    15.6' built-in + Samsung S22D300 + 17.3' LG Phillips
    Screen Resolution
    multiple resolutions
    Hard Drives
    Samsung SSD 250GB + Hitachi HDD 750GB
    PSU
    120W adapter
    Case
    small
    Cooling
    laptop cooling pad
    Keyboard
    Backlit built-in + big one in USB
    Mouse
    SteelSeries Sensei
    Internet Speed
    slow and steady
    Browser
    Chromium, Pale Moon, Firefox Developer Edition
    Antivirus
    Windows Defender
    Other Info
    That's basically it.
Well, we can narrow it down at least.

After manually "defragging" C: with a command as described in Shawn's post, the event report shows that C: was successfully trimmed.
There is nothing mentioned about a defragmentation.
All well...

The messages of defragmentation on SSD's seem to be noted after an automatic optimization and not a manual triggered one.
 

My Computer

System One

  • OS
    Windows 10 x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Envy DV6 7250
    CPU
    Intel i7-3630QM
    Motherboard
    HP, Intel HM77 Express Chipset
    Memory
    16GB
    Graphics Card(s)
    Intel HD4000 + Nvidia Geforce 630M
    Sound Card
    IDT HD Audio
    Monitor(s) Displays
    15.6' built-in + Samsung S22D300 + 17.3' LG Phillips
    Screen Resolution
    multiple resolutions
    Hard Drives
    Samsung SSD 250GB + Hitachi HDD 750GB
    PSU
    120W adapter
    Case
    small
    Cooling
    laptop cooling pad
    Keyboard
    Backlit built-in + big one in USB
    Mouse
    SteelSeries Sensei
    Internet Speed
    slow and steady
    Browser
    Chromium, Pale Moon, Firefox Developer Edition
    Antivirus
    Windows Defender
    Other Info
    That's basically it.
Hi there
Well after using SSD's for around TWO YEARS now - I've never bothered -- and I certainly haven't notice any degradation of SSD performance -- and even if there is it's so minute that I haven't noticed it.

Also is worrying about eventually having to replace an 85 USD device worth many HOURS of your time in what is certainly an issue that you doesn't have a definitive solution -- The firmware in the SSD these days will stop it being damaged in any case so the OS itself might be issuing commands but it doesn't mean that the actual SSD is carrying out the commands in the same way that a Spinner would do. Without taking the SSD apart , mounting it on to an Engineering Test Bench and putting a "Datascope" on it to see what the device is physically doing we can't prove what's happening internally to the device one way or another.

Certainly people haven't been reporting failures of SSD's (OF THE LATEST GENERATION) in any large volumes --and there are enough of them out there now for these to be considered as mainstream devices.

The latest generation of SSD's are more reliable than spinners -- these days the probable MBTF (Mean time before Failure) is likely to be about as long as the projected life of the SUN. !!

Early generations of SSD's are totally another matter - the hardware was not designed as it is now and you cannot extrapolate any results from those early SSD's to the new ones.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)
Hi Hopachi,

Do we really have proof it really defragged? Or the bug consists in just displaying the message of a defragmentation after the trim just happened?
Certainly, these are the first questions that come to any skeptical mind. Well, you can't get inside the drive to see what actually happens :) But I think that the proof I've established is pretty conclusive:

1. Event log entries. When it says defrag, it means defrag. Especially, since re-trim is recorded separately.

2. Defrag.exe reports. It shows 10% or more defrag before and 0% after. TRIM doesn't cause that.

3. Visual observation. If you're patient enough to reproduce the issue, you'll see five defrag passes in dfrgui. TRIM doesn't take that long, and displays different messages.

4. Faulty behavior under maintenance mode only. You can't make defrag.exe or dfrgui.exe defragment SSD. Only the ScheduledDefrag task can when launched during maintenance, whether manual or automatic. This task doesn't run otherwise under normal conditions. You can launch it manually, and it'll cause the issue under the conditions described in my post.

When I was reproducing it for MS Connect, I've enabled Task Scheduled logs and clearly established that the issue occurs during automatic maintenance (in addition to manual task start).

It's hard to believe, but it is defrag :) The workaround provided works just fine for those who want to be on the safe side. Even if MSFT releases a patch, the workaround still stands.


Hi Jimbo,

I don't understand your points. First, you CapsLock-stated that Windows 8 does not defrag SSD. This turns out wrong.

Now you're saying that you haven't noticed any performance impact. Yeah, but I'm not saying that a monthly defrag causes serious problems. It's just unnecessary, and should be avoided.


All,

As promised, check out http://www.eightforums.com/free-developer-programs-projects/29236-checkbootspeed-2-0-en-beta.html. The pack makes it easier to collect all diagnostics info.

Vadim
 
Last edited:

My Computer

System One

  • OS
    Windows 8 Pro x64
    Computer type
    Laptop
    System Manufacturer/Model
    HP Pavilion dv7t (17.3'', i7-2630QM, HD 6770M 1Gb, 8Gb RAM, 2 SSD@120Gb + 1 HDD@750Gb)
Hi there
What I'm saying is that even IF the OS issues a defrag command what does the SSD actually do -- there aren't any "Classical sectors" etc to physically jig around so my point is still that to actually SEE what the SSD does is to open it up and put a datascope on it when Windows issues the command. There's quite a lot of intelligence built into the SSD controller itself so it will just ignore HDD commands that can't be executed because of the physical hardware design. You need to see what the HARDWARE is actually doing here -- All windows can do is issue the I/O and wait for the device to signal it's done it.

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)
Back
Top