Disk Defrag Parameters.


  1. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1

    Disk Defrag Parameters.


    Good evening,

    Code:
    C:\Windows\system32>defrag.exe /?
    Microsoft Drive Optimizer
    Copyright (c) Microsoft Corp.
    
    Description:
    
            Optimizes and defragments files on local volumes to
            improve system performance.
    
    Syntax:
    
            defrag <volumes> | /C | /E <volumes> [<task(s)>] [/H] [/M [n] | [/U] [/V]] [/I n]
    
            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
    
    Parameters:
    
            Value   Description
            /A      Perform analysis on the specified volumes.
            /C      Perform the operation on all volumes.
            /D      Perform traditional defrag (this is the default).  On a tiered volume
                    though, traditional defrag is performed only on the Capacity tier.
            /E      Perform the operation on all volumes except those specified.
            /G      Optimize the storage tiers on the specified volumes.
            /H      Run the operation at normal priority (default is low).
            /I n    Tier optimization would run for at most n seconds on each volume.
            /K      Perform slab consolidation on the specified volumes.
            /L      Perform retrim on the specified volumes.
            /M [n]  Run the operation on each volume in parallel in the background.
                    At most n threads optimize the storage tiers in parallel.
            /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.
    
    Examples:
    
            defrag C: /U /V
            defrag C: D: /M
            defrag C:\mountpoint /A /U
            defrag /C /H /V
    
    C:\Windows\system32>

    I am curious as to what Disk Defrag Parameters you use on a HDD [ NOT SSD ].

    I have my HDD setup with the OS on C:\, Data on D:\, and System Images on S:\. Obviously they are ALL Backed Up else where using AOMEI.

    I have Shortcuts in a Folder in my Toolbar for each of the above.

    OS Drive:
    Code:
    
    %ComSpec% /k defrag.exe %SystemDrive% -u -v
    

    Data Drive:
    Code:
    
    %ComSpec% /k defrag.exe D: -u -v
    

    System Image Drive:
    Code:
    
    %ComSpec% /k defrag.exe S: -u -v
    

    ALL Drives:
    Code:
    
    %ComSpec% /k defrag.exe /C -u -v
    

      My Computer


  2. Posts : 5,324
    Windows 11 Pro 64-bit
       #2

    /B Optimizes boot files and applications but does not defragment the rest of the volume.
      My Computer


  3. Posts : 5,451
    Windows 11 Home
       #3

    It is best to defrag OS disk outside of Windows.
    Code:
    Boot Windows USB - Repair - Troubleshoot - CMD - type/enter
    c:
    cd windows
    cd system32
    defrag c: /u
      My Computer


  4. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #4

    Thanks @TairikuOkami,

    TairikuOkami said:
    It is best to defrag OS disk outside of Windows.
    Code:
    Boot Windows USB - Repair - Troubleshoot - CMD - type/enter
    c:
    cd windows
    cd system32
    defrag c: /u

    This is very odd. I initially used shutdown /r /o /f /t 00 to Boot into the Advanced Options and continued from there. The CMD Prompt was obviously X:\>. For some reason I could NOT get to the C:\Windows\System32 Prompt, with it saying that it was Unrecognisable.

    I then Booted into the Installation USB, with the SAME results.
      My Computer


  5. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #5

    Thanks @FreeBooter,

    FreeBooter said:
    /B Optimizes boot files and applications but does not defragment the rest of the volume.

    I do actually have that one [ /BootOptimize ] included, although it is NOT documented by MS as such. Technically, I assume that should also defrag the MFT and Boot Record files.
      My Computer


  6. Posts : 5,451
    Windows 11 Home
       #6

    Paul Black said:
    For some reason I could NOT get to the C:\Windows\System32 [/C].
    During boot, partitions might be assigned different letters, so it might be D, E, etc.
    Code:
    diskpart
    list volume
      My Computer


  7. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #7

    Thanks @TairikuOkami,

    TairikuOkami said:
    During boot, partitions might be assigned different letters, so it might be D, E, etc.
    Code:
    diskpart
    list volume
    Disk Defrag Parameters.-dp.png
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:38.
Find Us




Windows 10 Forums