Fix "Optimization Not Available" in Optimize Drives in Windows

Martin Brinkmann
Apr 1, 2019
Windows, Windows tips
|
23

Microsoft's Windows operating system runs maintenance tasks including disk analysis and defragmention regularly on its own.

Most Windows users and administrators don't need to run these manually anymore, but there are cases where you'd like to do so.

I checked Optimize Drives recently and discovered that Windows refused to run on two of the hard drives. Windows displayed "Optimization not available" as the status, "unknown" as the media type, and "never run" as the last run date and time.

You can access the Optimize Drives tool by right-clicking on a drive in Explorer, selecting Properties from the context menu, and opening Tools > Optimize.

optimization not available

The analyze and optimize buttons could not be used in the window as they were not active. My first assumption was that this might have something to do with encryption, as both volumes were encrypted and only mounted when I needed to access data on them.

Two solutions came to my mind: try the command line version of defrag to see if it would work, or use third-party defragmentation software like Smart Defrag, Vopt, Defraggler or Live Defrag. I decided to try the command line tool defrag first as it is a first-party solution.

Fixing the "Optimization not available" issue

defrag optimize drives

You need to launch an elevated command prompt to get started. If you are on Windows 10, use the shortcut Windows-X to display the "hidden" menu and select Command Prompt (Admin). You may also open Start on any version of Windows, type cmd.exe, right-click on the result, and select run as administrator to launch an elevated command prompt window.

The core command is defrag and you may want to start running defrag /? to display all command options. Microsoft has a handy reference on the company's Docs website that explains each of the parameters and gives some examples.

You may want to run an analysis first. The analysis returns the fragmentation status of the drive and gives a recommendation.

defrag p: /A

The command analysis the fragmentation status of the drive P on the device. You need to change the drive letter if it is not drive P that you want to analyze. The command defrag c: /A would analyze the C drive instead.

You may defragment the drive if the drive is fragmented, e.g. when Windows recommends that you should defragment the drive.

defrag p: /U /V

The command runs the defragmentation operation on drive P. The parameters U and V echo progress and information on the screen while the operation takes place.

You will notice that defrag runs fine on the drives even though Windows' "Optimize Drives" tool refused to run these operations.

Tip: If you want to defrag SSDs, use the parameters /L and /O as well. It instructs defrag to run a trim command after the operation completes and to run the proper optimization for the media type.

Other parameters of interest are:

  • E -- To perform the operation on all drives except those that you specify.
  • C -- To perform the defrag operation on all drives.
  • X -- To consolidate free disk space on the volumes you specify.

Closing Words

If Windows refuses to run defragmentation operations on a drive in "Optimize Drives", use the command line version of defrag instead to run the commands.

Summary
Fix
Article Name
Fix "Optimization Not Available" in Optimize Drives in Windows
Description
Find out what you can do if the Windows "Optimize Drives" tool blocks defragmentation operations on selected hard drives.
Author
Publisher
Ghacks Technology News
Logo
Advertisement

Tutorials & Tips


Previous Post: «
Next Post: «

Comments

  1. Jordan said on April 29, 2022 at 3:55 am
    Reply

    I can’t seem to fix this :(

    I tried this method. It did give me the option to optimize aka trim but, once I clicked optimize on the GUI it said optimization not available. So, this method didn’t work.

    1. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\Statistics
    2. Delete all subkeys under Statistics

    I also tried another method running this is admin powershell – Optimize-Volume -DriveLetter e -ReTrim -Verbose and it didn’t work either gives me this error below.

    Optimize-Volume : The volume optimization operation requested is not supported by the hardware backing the volume.

  2. Werner said on June 2, 2021 at 2:46 pm
    Reply

    I had the same problem “Optimisation not available” and realised after numerous fixes and attempts that the problem was that the SSD was formatted as a Dynamic Disk, and by converting it to a basic one fixed the problem

  3. Frank Wimmer said on February 25, 2021 at 6:53 pm
    Reply

    I can defrag, but when I try to optimize, it says only Administrator can optimize!

  4. JB said on May 4, 2020 at 11:08 pm
    Reply

    Hi,
    for my part, a simple Powershell command fixed 2 SSD drives that were blocked for disk optimization.

    I ran this command with Powershell as Administrator:

    Optimize-Volume -DriveLetter c -ReTrim -Verbose

  5. Randy said on February 13, 2020 at 11:45 pm
    Reply

    Thanks Ryan; a solution that works.

  6. Ryan said on December 17, 2019 at 8:43 pm
    Reply

    As a tech, I’ve resolved this problem by removing the IDE/ATAPI controllers driver in Safe Mode then restarting the computer back to Safe Mode. Restarting the computer and booting regularly resolves this issue.

  7. Vasudev said on October 27, 2019 at 11:19 am
    Reply

    If anyone still gets Optimisation not available after an OS upgrade or driver update. Try this:

    1. Open regedit
    2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\Statistics
    3. Delete all subkeys under Statistics
    4. Reboot your PC and open defrag GUI and you’ll see Optimize/Optimise button.

    1. Sheri said on April 25, 2021 at 7:15 am
      Reply

      No shit thanks so much for the advice. I followed your directions and it worked perfectly. I greatly appreciate your help. Now if I could fix my dead AUSU m32 computer I would be a happy camper. It froze so I powered it off and it never came back on. I replace the power cord, replaced the battery on the mother board, and replaced the power supply. Still no life in the computer. Not really sure what to do. I wrote a book that I have on the computers hard drive. Maybe one day I will figure it out.

  8. Mauricio JP said on September 5, 2019 at 11:18 pm
    Reply

    There is a bug between W10 and Driver
    Several years ago I found this:
    “Microsoft Drive Optimizer mistakenly lists SATA hard disk drive as SSD and will not defragment the drive
    I found a fix to the mistaken SSD issue:
    Windows relies on a registry value as an indicator that the drive is a normal hard drive or an SSD.
    In Regedit, have a look at the key of:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinSAT
    The Defragmenter will think the device is a SSD when the value is of RandomReadDiskScore is above a specific value.

    Running “CMD” the Command line of “winsat formal” will recalculate the value for the drive and in my case, the new value became RandomReadDiskScore = hex 65c (1628).
    The Defragmenter now runs on the drive which is no longer identified as an SSD !
    Dave”

    Be patient and wait to run the command. It doesn’t take long.
    Conflict solved.

  9. Luan said on August 8, 2019 at 4:26 am
    Reply

    That fixed the issue! THanks!

  10. Rick A. said on April 10, 2019 at 3:38 pm
    Reply

    There was a glitch where Windows 10 would think you have an SSD when you actually have a Hard Drive or would think you have a Hard Drive when you actually have an SSD. This happened a lot when upgrading from Windows whatever to Windows 10.

    This issue is probably in the same glitch neighborhood…..

  11. Randy said on April 2, 2019 at 6:19 pm
    Reply

    Are you using Vera Crypt?
    Did not work for SSD in VeraCrypt container. The regular defrag will work (as if it was a non-SSD, which is bad), but commands /L and /O won’t do anything.

  12. stefann said on April 2, 2019 at 12:29 am
    Reply

    If You use a Samsung SSD You just have to use Samsung Magician’s ‘advanced optimization’ once: when installation of Windows + install of updates and other softwares are installed. A SSD doesn’t get fragmented as a mechanical drive.

    My computer with XP x64 and 7 x64 in dual boot is as fast today as it was three years ago (here i mean XP x64 – 7 x64 was re-installed earlier this year – i don’t let them see each other, therefor the optimization in Windows 7 didn’t affect the XP x64 partition).

    I use a third party SSD tool (SSD Tool 0.9.5 works in XP/XP x64) once a month to get rid of left clutter from deleted files.

    As i once stated some Windows services/tools that are used on mechanical drives should never be used on a SSD (even if todays SSD’s are better than they once were, each cell on a SSD still has a limited life). Heavy writings, saves and temp-files are on an external mechanical drive (USB 3.0) in my system. Hopefully this will make the SSD live longer than the computer itself.

  13. Sebas said on April 1, 2019 at 8:37 pm
    Reply

    Excellent. My brand new desktop with Windows 10 sees my conventional harddisk as a SSD and refuses to defrag. When googling you see occur this problem sometimes. This is just what I need.

    One caveat: you must write your drive letter in capital. So it is C, not c.

    1. Yuliya said on April 1, 2019 at 9:21 pm
      Reply

      Sebas, you can go to Device manager > Disk drives and uninstall the driver for that drive. Restart your computer and now Windows should reinstall its driver. Whoever configured that PC probably used an image they created for a PC with a SSD and Windows decided not to adjust it to the newly discovered hardware.

      1. Sebas said on April 3, 2019 at 1:46 pm
        Reply

        Yulia I reinstalled the drive, but to no avail. So for the time being I will use this solution.

      2. Yuliya said on April 3, 2019 at 8:29 pm
        Reply

        Make sure you don’t have any device showing a warning sign (it will show up in Device manager under a separate category, expanded by default), mainly the chipset driver. Other than that I don’t know.. well, other than Windows being Windows I guess. I encountered this once (stated above) and could not figure it out myself either.

      3. Sebas said on April 2, 2019 at 8:12 am
        Reply

        Thanks Yulia, appreciated. I will do that, when googling someone already mentioned to reinstall the driver.

    2. Martin Brinkmann said on April 1, 2019 at 9:04 pm
      Reply

      Hm, lower case drive letters work just fine on my W10 test machine.

  14. ilev said on April 1, 2019 at 5:14 pm
    Reply

    Another Microsoft’s baked “Utility” that isn’t worth the disk space and CPU it uses.
    Just check the latest status of my Windows 10 Optimize Drives :
    I have 3 drives : C – SSD, D – 1TB HDD Internal, G – 3TB USB External.

    Optimize Drives run on C drive on Mar. 15 (17 days ago)
    Optimize Drives run on D drive on Mar. 29 (status OK, 0 fragmented)
    Optimize Drives run on G drive on Mar. 29 (status OK, 0 fragmented).

    My laptop in on 24/7 and G drive is in usage read/write 24/7 and is very much fragmented (11%).

    Just use 3rd party defrag app once in a while.

  15. anon said on April 1, 2019 at 1:37 pm
    Reply

    This isn’t the solution. “Optimization not available” refers to an hardware configuration issue. Make sure the drive is connected to the correct port and port type, check the BIOS or UEFI, and update the storage device drivers if necessary.

    1. Yuliya said on April 1, 2019 at 3:46 pm
      Reply

      Sometimes Windows simply doesn’t know what to do with the drive. I encountered this problem once, on the same hardware with no changes to the system, not even in BIOS, within a few hours:
      Windows 7 – defrag would defragment the system drive, an SSD
      Windows 8.1 – defrag would fail, telling me optimisation was not available for that drive
      Windows 1607 LTSB – defrag would retrim the same SSD
      All operating systems were up to date and configured in the same way (trim enabled, WinSAT ran, same driver versions, etc..).

  16. John Doe 101 said on April 1, 2019 at 12:47 pm
    Reply

    Simply use Defraggler from Piriform, always works like charm. ^^

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.