If the Defragment and Optimize Drives tool in Windows 10 fails to start, hangs at a percentage, or reports an error, the fix usually involves restarting the Optimize Drives service, running the tool as an administrator, or repairing system files with the built-in System File Checker. This article walks through the most common causes and step-by-step solutions, plus what to do when the tool simply won’t open.
Why Defrag Might Stop Working
The defragmentation tool in Windows 10 relies on several background services and system files. When any of these are corrupted, disabled, or blocked by another program, the tool can fail in different ways:
- The tool won’t open – clicking the icon does nothing or an error dialog appears.
- It hangs at 0% or a low percentage – often caused by a drive that is nearly full or a service that has stopped.
- It reports “Optimization failed” – usually due to file system errors or a third-party defrag tool conflicting.
- It skips certain drives – some drives (like SSDs) are not shown by default, or the drive is not “optimizable” in the current state.
Most of these issues can be resolved without advanced technical knowledge, but a few require running commands in an elevated Command Prompt.
First: Restart the Optimize Drives Service
The defrag tool depends on a Windows service called Optimize drives (its internal name is defragsvc). If that service is stopped or disabled, the tool will not work. Here’s how to check and restart it:
- Press Win + R, type
services.msc, and press Enter. - Scroll down to Optimize drives.
- If the status is not “Running”, right-click it and select Start.
- Right-click again and choose Properties. Set the Startup type to Automatic (not Manual or Disabled).
- Click Apply and OK.
If the service fails to start, you may need to run the System File Checker (see next section).
Run System File Checker and DISM
Corrupted system files can break the defrag tool. Windows includes two command-line tools to repair them:
- Open Command Prompt as administrator: right-click the Start button and select Command Prompt (Admin) or Windows PowerShell (Admin).
- Type
sfc /scannowand press Enter. This scans protected system files and replaces corrupted ones. It can take 10–20 minutes. - If SFC finds issues but cannot fix them, run
DISM /Online /Cleanup-Image /RestoreHealthand press Enter. This repairs the Windows image that SFC relies on. - Restart your PC and try defrag again.
These commands work on Windows 10 version 1803 and later. If you are on an older version, the DISM command may still work but the exact syntax is the same.
Check for Disk Errors First
A failing or corrupted drive can cause defrag to stop partway through. Run the built-in error checker before optimizing:
- Open This PC in File Explorer.
- Right-click the drive you want to defrag and select Properties.
- Go to the Tools tab and click Check under Error checking.
- If Windows says you don’t need to scan, you can still click Scan drive to force it.
If errors are found, let Windows fix them. After that, restart and try defrag again.
Make Sure the Drive Is Actually Optimizable
Not all drives appear in the defrag tool, and some are intentionally excluded:
- SSDs – Windows 10 automatically uses TRIM for SSDs, not defragmentation. The tool still shows them, but the “Optimize” button runs TRIM. If your SSD is not listed, it may be a removable drive or an older SSD that doesn’t support TRIM.
- Network drives – Defrag only works on local drives.
- USB flash drives – They are often excluded because they wear out quickly. The tool may not show them at all.
- System reserved partition – Sometimes hidden; you can see it in the tool if you click “All drives” in the drive list.
If a drive is missing, check if it is a removable drive or whether it is formatted with a file system that Windows can optimize (NTFS, FAT32, exFAT). The tool works on NTFS and FAT32, but not on exFAT.
Third-Party Defrag Tools and Conflicts
If you have installed a third-party defragmentation utility (like Defraggler, Auslogics, or Smart Defrag), it can conflict with the built-in tool. The third-party tool may disable the Windows service or replace the built-in scheduler. To fix this:
- Uninstall the third-party defrag tool from Settings > Apps.
- Restart your PC.
- Re-enable the Optimize drives service if it was disabled (see first section).
- Run the built-in defrag again.
If you want to keep the third-party tool, make sure it is up to date and check its settings for an option to “let Windows manage optimization” – but the safest route is to uninstall it and rely on the built-in tool.
When Defrag Runs but Never Finishes
If the tool starts but stays at a low percentage for hours, try these steps:
- Free up disk space – Defrag needs at least 10–15% free space to work efficiently. Delete temp files or move large files to an external drive.
- Close other programs – Antivirus scans, backups, or file transfers can interfere. Run defrag in Safe Mode if needed.
- Run it from an elevated command prompt – Type
defrag C: /U /Vto see verbose output. This may give more information than the GUI. - Check the drive for bad sectors – Use
chkdsk C: /R(requires admin and a restart). This is more thorough than the GUI check.
If the drive is an SSD, defragmentation is not needed and can actually reduce its lifespan. Windows 10 automatically disables traditional defrag for SSDs and uses TRIM instead. If you see “Optimize” on an SSD, it is running TRIM, not defrag.
Frequently Asked Questions
Why does defrag say “Optimization failed” on my SSD?
On an SSD, the tool runs TRIM, and a failure usually means the drive’s firmware or the storage driver is not responding correctly. Update your SSD’s firmware and your chipset drivers. Also check if the drive is healthy with the error-checking tool. If it persists, run defrag /L for a manual TRIM.
Can I defrag an external USB drive in Windows 10?
Yes, but only if the drive is connected via USB and is a traditional hard disk. The tool may not show it by default; click “All drives” to see it. However, defragging over USB is slow and can cause the drive to disconnect. It’s better to connect it via SATA if possible.
Is it safe to force-stop defrag if it’s stuck?
Yes, it is generally safe. The tool is designed to be interrupted, and Windows will resume from where it left off next time. However, if the drive has hardware issues, stopping the process won’t fix them. Always check for errors after a forced stop.
How often should I defrag my hard drive?
Windows 10 automatically schedules defragmentation once a week by default. If you manually defrag, once a month is usually enough for a typical user. If you work with very large files (like video editing), you might do it weekly. SSDs do not need defragmentation at all.
Why does defrag not show my second hard drive?
Check if the drive is mounted and has a letter. Open Disk Management (right-click Start > Disk Management) and see if the drive is online. If it’s a new drive, it may need to be initialized. Also, the defrag tool only shows drives that are ready and have a file system it can optimize.
What is the difference between defrag and TRIM?
Defragmentation rearranges data on a spinning hard disk so files are stored in contiguous blocks, reducing read/write time. TRIM tells an SSD which blocks are no longer in use, so the drive can clean them up in the background. Windows 10 automatically uses TRIM for SSDs and defrag for HDDs.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Create App Shortcuts in Windows 10 Start Menu
- How to Rename a SQL Server Database
- Fix Administrator Blocked You From Running This App Error
- Fix Google Calendar Not Syncing on iPhone
- Fix Skype Microphone Not Working on Windows
- Google Docs Landscape: Change Page Orientation