What you will achieve
Understand when Windows defragments spinning HDDs versus when it sends TRIM commands to SSDs — and verify the schedule is correct for your drives.
1) How Windows treats each drive type
- HDD: Windows runs defragmentation to consolidate fragmented files — beneficial on mechanical drives.
- SSD: Windows sends Retrim (TRIM) commands instead of traditional defrag — do not force full defrag on SSDs.
- Windows detects drive type via SMART and filesystem — trust automatic scheduling unless you have a unusual RAID setup.
2) Check optimise schedule
- Open Settings → System → Storage → Advanced storage settings → Drive optimization (or search "Defragment" in Start).
- View Media type column — SSD vs HDD.
- Confirm Scheduled optimization is On (default: weekly).
3) Run manually if needed
- Select a drive → Optimize. SSDs show "OK" or run Retrim; HDDs show fragmentation percentage before/after.
- Do not run third-party defrag tools on SSDs with aggressive rewrite passes.
4) Command-line status
defrag C: /A
Get-PhysicalDisk | Select-Object FriendlyName, MediaType, HealthStatus
/A analyses only — shows whether optimisation is recommended without changing data.
5) SSD lifespan concern
- Windows Retrim is low impact — do not run nightly manual defrag on SSDs with third-party tools marketed as "boosters".
- Check wear with vendor tool (Samsung Magician, Crucial Storage Executive) if health is in question.
6) RAID and Storage Spaces
- Optimise tool may not TRIM all RAID volumes — follow array vendor guidance.
7) Scheduled task name
- Task Scheduler → Microsoft → Windows → Defrag — ScheduledDefrag task runs optimisation on idle schedule.
8) HDD fragmentation threshold
- Windows optimises HDDs above ~10% fragmentation by default — manual defrag rarely needed on weekly schedule.
- External USB HDDs benefit most — include them in Optimise drives list explicitly.
Verification checklist
Note MediaType in Optimise drives — confirm SSD shows OK status weekly. HDD fragmentation percent should drop after Optimise on heavily used spinning disks.
- Reboot once after changes that affect services, drivers, or firmware.
- Confirm the original problem is resolved under normal daily use, not only immediately after the fix.
- Note date, Windows version (Settings → System → About), and what changed in your personal runbook for next time.
Quick reference paths
- dfrgui.exe
- taskschd.msc → Defrag
- Get-PhysicalDisk
- Admin tools: press Win + X for Terminal (Admin), Device Manager, and Computer Management.
NVMe drives on Windows 10 1709+ receive Retrim automatically; only intervene manually if Optimise reports Needs optimization for weeks unchanged. Check the task history in Task Scheduler if scheduled runs are failing silently.