Why Defragmenter Says SSD Optimization Failed and How to Reschedule It
🔍 WiseChecker

Why Defragmenter Says SSD Optimization Failed and How to Reschedule It

Quick fix: Open Defragment and Optimize Drives (search Start). If your SSD shows “Optimization failed”, run Optimize manually. If it still fails, check that the drive has at least 15% free space, then run Optimize-Volume -DriveLetter C -ReTrim -Verbose from elevated PowerShell. This forces a TRIM operation directly.

Windows’s Optimize Drives says “Optimization failed” for your SSD. SSDs need TRIM (not defragmentation) — TRIM tells the SSD which blocks are no longer used so it can erase them. If TRIM is failing, the SSD may slow down over time. The fix is to identify the cause and either retry or schedule differently.

Symptom: Defragment and Optimize Drives shows “Optimization failed” or “Optimization not available” for SSD.
Affects: Windows 11 (and Windows 10) with NVMe or SATA SSDs.
Fix time: ~10 minutes.

ADVERTISEMENT

What causes this

Windows automatically detects whether a drive is an SSD or HDD and applies the right optimization: TRIM for SSDs, defragmentation for HDDs. TRIM failures happen when: the drive is full (no room to safely consolidate), TRIM was disabled at the OS level, the SSD doesn’t support TRIM (rare on modern drives), or the scheduled task lacks permissions.

The fix is to manually run optimization with explicit TRIM command, then schedule it correctly.

Method 1: Manually retry optimization with verbose output

The diagnostic step.

  1. Open Defragment and Optimize Drives: search Start → Defragment and Optimize Drives.
  2. Select your SSD. Click Optimize.
  3. If it fails again: open Terminal (Admin) and run:
    Optimize-Volume -DriveLetter C -ReTrim -Verbose

    The verbose output shows exactly what TRIM is doing and where it fails.

  4. If TRIM succeeds (no errors): the original failure was transient. The Defragmenter dialog should now show “Optimization complete.”
  5. If TRIM fails with specific errors:
    • “The device is not configured properly” — driver issue, see Method 2.
    • “Insufficient space” — free up space, see Method 3.
    • “The volume does not support trim” — older SSD or wrong volume type.
  6. For verbose data including how much TRIM affected: add -Analyze: Optimize-Volume -DriveLetter C -Analyze -Verbose.

The verbose output is the key diagnostic.

ADVERTISEMENT

Method 2: Verify TRIM is enabled at OS level

For when verbose output suggests TRIM is disabled.

  1. Open Terminal (Admin).
  2. Check TRIM status:
    fsutil behavior query DisableDeleteNotify

    Output shows:

    • NTFS DisableDeleteNotify = 0 — TRIM enabled (correct).
    • NTFS DisableDeleteNotify = 1 — TRIM disabled.
  3. If disabled, enable: fsutil behavior set DisableDeleteNotify NTFS 0. Reboot.
  4. Also for ReFS: fsutil behavior set DisableDeleteNotify ReFS 0.
  5. Verify SSD driver: Device Manager → Disk drives → right-click your SSD → Properties → Driver tab. Update to manufacturer-provided NVMe driver if available (Samsung Magician, Crucial Storage Executive, Western Digital Dashboard).
  6. For SSDs that report as HDD to Windows (rare, USB enclosures, RAID configs): Windows applies defragmentation instead of TRIM. In Defragment and Optimize Drives, the Media type column shows the detection. If “Hard disk drive” despite being SSD: usually a driver/controller issue.

TRIM must be on for optimization to succeed.

Method 3: Free space and retry

For when the drive is too full.

  1. Check free space: Settings → System → Storage. Aim for at least 15% free for TRIM to work effectively.
  2. If less, clean up: Disk Cleanup (cleanmgr) + DISM /Cleanup-Image (see “Why Disk Cleanup Misses GBs” article).
  3. For very full SSDs: move large files to external storage or delete large unused files. Use WizTree (free) to find what’s using space.
  4. After freeing space, retry optimization.
  5. For scheduled optimization that keeps failing: open Task Scheduler → Microsoft → Windows → Defrag. Find ScheduledDefrag. Right-click → Run. If it succeeds manually, scheduled run may have failed due to power state or user context. Edit the task — switch Run with highest privileges on, and adjust Conditions tab (untick “Start the task only if the computer is on AC power” if laptop).
  6. For external SSDs: USB-connected SSDs sometimes don’t support TRIM through USB-SATA bridges. Connect directly via SATA or PCIe instead.

Free space and proper scheduling resolve most chronic failures.

How to verify the fix worked

  • Open Defragment and Optimize Drives. Drive shows Status: OK (X% optimized) with recent date.
  • Run Optimize-Volume -DriveLetter C -ReTrim -Verbose. No errors; shows TRIM count.
  • Run fsutil behavior query DisableDeleteNotify. NTFS = 0.

If none of these work

If TRIM still fails despite all software fixes, the SSD or its controller is failing. Check SMART data: download CrystalDiskInfo (free). Health Status: Good is fine; Caution or Bad means drive is degrading. For very old SSDs (5+ years, heavy use): the controller may have entered “safe mode” that disables TRIM to prevent further data loss. Back up data and replace the drive. For USB-connected SSDs: some USB-SATA bridge chips don’t support TRIM. Connect via SATA directly if possible. For RAID arrays: TRIM in RAID is complex. Modern Intel RST, AMD RAID, and HBA controllers support TRIM through software RAID, but hardware RAID controllers (most server-grade) typically don’t. Check controller documentation. Last resort: replace the SSD. ~$60 for 500 GB. Cheap insurance against further degradation.

Bottom line: Manually retry optimization. Check TRIM is enabled via fsutil. Free disk space if <15%. PowerShell’s Optimize-Volume with -Verbose shows the real error.

ADVERTISEMENT