Windows 8 and 8.1 Forums


Optimize Drives - Defrag HDD and TRIM SSD in Windows 8

  1. #1
    Optimize Drives - Defrag HDD and TRIM SSD in Windows 8

    Optimize Drives - Defrag HDD and TRIM SSD in Windows 8
    How to Use "Optimize Drives" to Defrag HDD and TRIM SSD in Windows 8 and 8.1
    Published by Brink is online now
    23 Aug 2012
    Default Optimize Drives - Defrag HDD and TRIM SSD in Windows 8

    Published by


    Brink's Avatar
    Administrator

    Join Date: Jul 2009
    Posts: 20,591

    How to Use "Optimize Drives" to Defrag HDD and TRIM SSD in Windows 8 and 8.1

    information   Information
    Optimize Drives, previously called Disk Defragmenter, helps to optimize the different types of drives that PCs use today. No matter which type of drive your PC uses, Windows automatically chooses the optimization that's right for your drive.

    By default, Optimize Drives runs automatically on a weekly schedule during the time you have set for automatic maintenance. You can also optimize drives on your PC manually any time you like.

    This tutorial will show you how to open and use Optimize Drives or a command prompt to defrag hard disk drives and TRIM solid state drives in Windows 8, Windows RT, Windows 8.1, and Windows RT 8.1.

    You must be signed in as an administrator to be able to do the steps in this tutorial.

    Note   Note

    • If the drive is being used by another program, or is formatted using a file system other than NTFS, FAT, or FAT32, it can't be optimized.
    • Network drives can't be optimized.
    • If a drive isn't appearing in Optimize Drives, it might be because it contains an error. Try to repair the drive with chkdsk first, then return to Optimize Drives to try again.






    OPTION ONE
    To Use "Optimize Drives" to Manually Defragment and Optimize Drives

    1.
    In File Explorer, click/tap on Computer (Windows 8) or This PC (Windows 8.1), do step 1A or 1B below, then go to step 2 below.

    A) Select a HDD or SSD, click/tap on Manage (Drive Tools) tab, and click/tap on the Optimize button in the ribbon. (see screenshot below)

    Click image for larger version

    B) Right click or press and hold on a HDD or SSD, click/tap on Properties, click/tap on Tools tab, Optimize button, and on OK. (see screenshot below)

    Name:  Properties.jpg
Views: 56623
Size:  44.9 KB

    2. Under Status, click/tap on the drive you want to optimize. (see screenshot below)
    NOTE: The Media type column tells you what type (HDD or SSD) of drive you're optimizing.

    Click image for larger version

    3. To determine if a HDD needs to be optimized, click/tap on Analyze. If prompted by UAC, then click/tap on Yes. (see screenshot below)
    NOTE: This is not available for a SSD.

    Click image for larger version

    4.
    Check the Current status column to see whether you need to optimize the drive (SSD or HDD). If the drive is more than 10% fragmented, then you should optimize the drive now.

    Click image for larger version

    5.
    To optimize the selected drive, click/tap on Optimize. If prompted by UAC, then click/tap on Yes. (see screenshot above and below)
    NOTE: Optimizing a drive might take anywhere from several minutes to a few hours to finish, depending on the size of the drive and degree of optimization needed. You can still use your PC during the optimization process.

    Click image for larger version

    6. When finished, you can close the Optimize Drives window.






    OPTION TWO
    To Use Command Prompt to Manually Defragment and Optimize Drives

    1.
    Do step 2 or 3 below for how you would like to run the defrag command.

    2. To Use an Elevated Command Prompt in Windows 8

    A) Open an elevated command prompt, and go to step 4 below.

    3. To Use a Command Prompt at Boot

    A) Open a command prompt at startup.

    B) In the command prompt, type diskpart and press Enter.

    C) In the command prompt, type list volume and press Enter.
    NOTE: Make note of the drive letter that you want to optimize. The drive letter for the drive will not always be the same at boot as it is in Windows 8.

    D) In the command prompt, type exit and press Enter.

    E) Continue on to step 4 below.


    4. In the command prompt, type in the following command below followed by one or more switches (flags) that you would like to use below with a space between each switch and press Enter.

    Syntax:

    defrag <volumes> | /C | /E <volumes> [<task(s)>] [/H] [/M | [/U] [/V]]

    Where <task(s)> is omitted (traditional defrag), or as follows: /A | [/D] [/K] [/L] | /O | /X

    Or, to track an operation already in progress on a volume: defrag <volume> /T


    Commonly Used Commands:
    defrag C: /O
    NOTE: Substitute C: in the command with the drive letter you want instead.

    defrag /C /O
    NOTE:
    For all HDDs and SSDs.


    Parameters:

    NOTE: Switches in red below are new to Windows 8.

    Switch (value) Description
    /A Perform analysis on the specified volumes.
    /B Perform boot optimization to defrags the boot sector of the boot volume. This will not work on a SSD.
    /C Perform the operation on all volumes.
    /D Perform traditional defrag (this is the default).
    /E Perform the operation on all volumes except those specified.
    /H Run the operation at normal priority (default is low).
    /K Perform slab consolidation on the specified volumes.
    /L Perform retrim on the specified volumes. Only for a SSD.
    /M Run the operation on each volume in parallel in the background.
    /O Perform the proper optimization for each media type.
    /T Track an operation already in progress on the specified volume.
    /U Print the progress of the operation on the screen.
    /V Print verbose output containing the fragmentation statistics.
    /X Perform free space consolidation on the specified volumes.

    Click image for larger version



    That's it,
    Shawn


  2. #1


    Just outside the box you call 'reality'.
    Posts : 7
    Win 10 x64 Pro x64 / Ubuntu 15.10 x64


    Out of curiosity, I've seen many notes online that discourage defragmenting a SSD.. From the above tutorial, I see the CLI option still launches an executable called "defrag", so does this "Optimise" perform different actions specifically for SSDs?

    On the other hand, am I completely misled by the assumption that running defrag on a SSD is a bad idea?

      My System SpecsSystem Spec

  3. #2


    Posts : 20,591
    64-bit Windows 10 build 10166


    Hello Andre,

    It does get a bit confusing when it's called "Optimize" now even though it uses the defrag.exe process.

    It is correct that you do not want to defrag a SSD, and only defrag a HDD. Instead, you would want to TRIM a SSD.

    The included "Optimize Drive" feature in Windows 8/10 will automatically only defrag a HDD and TRIM a SSD.

    Using the /O switch with the defrag command will also automatically only defrag a HDD and TRIM a SSD.
      My System SpecsSystem Spec

  4. #3


    Just outside the box you call 'reality'.
    Posts : 7
    Win 10 x64 Pro x64 / Ubuntu 15.10 x64


    Awesome, thanks for the clarification Shawn.. Makes me feel a tad bit better about letting Microsoft do what they think is best for my rig.
      My System SpecsSystem Spec


  5. #4


    Posts : 20,591
    64-bit Windows 10 build 10166


    You're most welcome.
      My System SpecsSystem Spec

  6. #5


    Posts : 457
    W8.1 x64 and W8.1 Enterprise x86


    A couple of things I've wondered over in the past. When you add switches, does it matter in what order you enter them to the program line ?

    I use a click to run batch file that runs the command defrag C: /H /U /V and it seems to work well showing the progress of each 'pass' with sometimes up to 11 or so passes being made in a particular run. Each pass consists of 'Free space consolidation', 'Defrag' and 'Eviction'.

    What actually is 'Eviction', what's it doing there ?

    Last question I spotted in your list a Boot Files optimise command of /B and that made me wonder if 8.1 optimises boot files automatically. I think Vista did that every three days or so. If so, does that still happen even if scheduled defrag is turned off ? Could I safely add that to my line above or should something like that be run separately ?
      My System SpecsSystem Spec

  7. #6


    Posts : 20,591
    64-bit Windows 10 build 10166


    Hello Mooly,

    Nar, it doesn't matter what order you have the switches in.

    Eviction is the act of removing data from the cluster when additional storage space is required.

    If I remember correctly, optimizing the boot files is also part of the scheduled automatic maintenance by default.
      My System SpecsSystem Spec

  8. #7


    Posts : 457
    W8.1 x64 and W8.1 Enterprise x86


    That's great, thanks once again for the info Shawn.
      My System SpecsSystem Spec

  9. #8


    Posts : 20,591
    64-bit Windows 10 build 10166


    Anytime.
      My System SpecsSystem Spec

  10. #9


    Posts : 18
    Win7x64 Ult + Win 8.1 Pro


    So I have a Win 8.1 that I cloned from an SSD to a HDD. Despite trying to change status on the HDD, it wont allow me to Defrag. In fact, DevMngr shows the drive as HDD, but Defrag Opt still is stuck to the OLD SSD as if underlying hardware has not changed.

    Suggestions? Thoughts? So that I can enable that
      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
Optimize Drives - Defrag HDD and TRIM SSD in Windows 8

Similar Threads
Tutorial Forum
Does Windows 8.1 Automatic Maintenance activate TRIM?
I need to know this, as I hear Defragmentation can damage an SSD if it is performed on it. Now we know Windows 8 and Windows 8.1 possess the Automatic Maintenance routine, where it starts to run some maintenance tasks when the computer is idle (apparently after 4 minutes of not detecting user...
Performance & Maintenance
Optimize Drives vs Third Party Defrag
Do you use the built-in Windows Optimize Drivers (Disk Defrag) or do you use a third party product? If third party product, which product and why?
Performance & Maintenance
Optimize Drives Schedule - Change in Windows 8
How to Change "Optimize Drives" Schedule Settings in Windows 8 and 8.1 Optimize Drives, previously called Disk Defragmenter, helps to optimize the different types of drives that PCs use today. No matter which type of drive your PC uses, Windows automatically chooses the optimization that's right...
Tutorials
Windows 8.1 One of my hard drives wont defrag
I was currently trying to defrag my drives, out of four one was at 17% frag, and it defragged just fine however the other drive is currently 25% frag but when i click optimize it seems to start but then immediately stops and goes back to saying it is 25% frag ideas?
Performance & Maintenance
Optimize drives doesn't open
I am trying to access the Optimize Drives application - but nothing happens when I start it from the start screen or from the Drive Tools tab in Explorer. Your assistance is appreciated :) Pilau
Performance & Maintenance
optimize defrag
I notice I have the C: in the desktop and have reserved besides the C: in the laptop. Does this mean that when I try to recover an image to the desktop containing only the C; I won't be able to? I only have one partition or drive in each.
Performance & Maintenance
windows 8 defrag and ssd drives
I keep reading different interpretations on whether W8 does a trim command or defrag using the new "optimization" utility (formally defrag). Is there a DEFINITE answer on this ? Thanks
General Support

Eight Forums Android App Eight Forums IOS App Follow us on Facebook