Optimize and Defrag Drives in Windows 10  

Page 12 of 16 FirstFirst ... 21011121314 ... LastLast

  1. Posts : 26
    Windows 10 Education
       #110

    Brink said:
    Hello DJ,

    Since this is for a hybrid Optane (SSD) + HDD drive, it will most likely have its own built-in hardware based optimization instead, and why it's not available in this tool.
    Hmm, I had that thought as well. But then that brings me to question why windows WAS optimizing it before and then suddenly not? It's my understanding that optane is just for page filing and makes your HDD function similarly to a SSD but it's not an SSD. I can't imagine why Windows thinks that it is now though...

    I wish I had a screenshot to show but I swear it was defragging on a regular basis. However, now it's somehow magically turned into an SSD according to windows and it's never been ran before.
      My Computer


  2. Posts : 13,301
    Windows 10 Pro (x64) 21H2 19044.1526
       #111

    DJ Lune44 said:
    Hmm, I had that thought as well. But then that brings me to question why windows WAS optimizing it before and then suddenly not? It's my understanding that optane is just for page filing and makes your HDD function similarly to a SSD but it's not an SSD. I can't imagine why Windows thinks that it is now though...

    I wish I had a screenshot to show but I swear it was defragging on a regular basis. However, now it's somehow magically turned into an SSD according to windows and it's never been ran before.
    It is a ssd and Hdd in Raid formation (computer sees them as One drive) , one trims the other defrags this combination confuses Defrag so it ignores it.
      My Computers


  3. Posts : 26
    Windows 10 Education
       #112

    I see, so that makes sense I suppose. Still bewildered by the fact that it didn't get "confused" before. It's not like I just installed optane, it came with my PC and optimized just fine until recently.
      My Computer


  4. Posts : 13,301
    Windows 10 Pro (x64) 21H2 19044.1526
       #113

    DJ Lune44 said:
    I see, so that makes sense I suppose. Still bewildered by the fact that it didn't get "confused" before. It's not like I just installed optane, it came with my PC and optimized just fine until recently.
    Maybe that there was a script to your optimizer so that when defrag was engaged the optimizer actually
    took over. Just a guess.
    Yours is a high end motherboard so it may have been possible.
      My Computers


  5. Posts : 211
    Windows10 21H2 x64 Home, Single language, build 19044.1706
       #114

    Brink said:
    Hello rdwray, :)

    $ = Tells defrag.exe that it is being called from the task scheduler. It's not a new parameter for the command prompt.
    Hello Shawn, do you know what the other 3 arguments stand for:
    <Command>%windir%\system32\defrag.exe</Command>
    <Arguments>-c -h -o -$</Arguments>

    I have the same SATA setup as @DJ Lune44 RST-Optane (RAID) although I don't have a SSD (just 1 HDD) this is Acer's default BIOS setting as most of the higher laptops have SSD+HDD. When I defrag manually or when Maintenance runs on schedule I get that RE-TRIM error although the optimizing completes successfully, so I would like to disable the TRIM argument in the defrag.exe command if this is possible?

    Alternatively I could change SATA mode to AHCI (also Intel) as Acer now provides a new AHCI driver for my model laptop but I played with AHCI before and that resulted in "No Bootable Device found": Acer service had to reformat my HDD (free of charge) and advised me to stick with RST-Optane Sata mode for this MB (Bios tends to flip back to default settings after a crash and there is no Legacy option with this UEFI-Bios).

    I don't consider the Re-trim error as a bug as I had this ever since version19042 so probably Windows considers my storage a a RAID configuration (like you stated in this thread). I could try to eliminate --c -h -o arguments one by one till the trim error stops after running the task, but I thought to ask here first.......
    Frank
      My Computer


  6. Posts : 68,994
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #115

    FrankW said:
    Hello Shawn, do you know what the other 3 arguments stand for:
    <Command>%windir%\system32\defrag.exe</Command>
    <Arguments>-c -h -o -$</Arguments>

    Frank
    Hello Frank,

    Here you go for the arguments:

    Value Description
    /C Perform the operation on all volumes.
    /H Run the operation at normal priority (default is low).
    /O Perform the proper optimization for each media type. To Trim or not.
      My Computers


  7. Posts : 211
    Windows10 21H2 x64 Home, Single language, build 19044.1706
       #116

    Trim error


    Brink said:
    Hello Frank,

    Here you go for the arguments:

    Value Description
    /C Perform the operation on all volumes.
    /H Run the operation at normal priority (default is low).
    /O Perform the proper optimization for each media type. To Trim or not.
    Thanks Shawn, I will delete that -O argument in my task to see if that will stop the trim error with my HDD. I exported the defrag task so easy to import it again if things go awry. I will let you know the result.

    Update:
    No luck, I ran the task minus O and defrag still produces the Trim error with HDD only:
    Log Name: Application
    Source: Microsoft-Windows-Defrag
    Date: 19/02/2021 7:32:03 am
    Event ID: 264
    Task Category: None
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: LAPTOP-9TQHFTKI
    Description:
    The storage optimizer couldn't complete retrim on Acer (C:) because: The operation requested is not supported by the hardware backing the volume. (0x8900002A)
    MS suggested in June 2020 that this is a bug:
    "if this is a classic platter-type hard drive, then TRIM is not supported. Of course, Windows should not be running TRIM against HHDs but a bug has has been reported with 2004 regarding this (see here for details: Windows 10 2004: Bug defragments SSDs too often | Born's Tech and Windows World...). Note what it is saying near the end - Windows 10 2004 is optimizing SSDs after each restart so disable automatic maintenance."
    For now I will disable the task.
    Last edited by FrankW; 18 Feb 2021 at 18:58. Reason: Update
      My Computer


  8. Posts : 1,871
    W10 pro x64 20H2 Build 19042.610
       #117

    Just an observation rather than a problem, but it is something I have no answer to as to 'why'.

    If I run the optimise routine manually it appears to work, you get the 'optimising' percentage bar that progresses very quickly to 100%. All seems good and you assume it does what it is supposed to do. All good.

    When the routine runs automatically I assume it simply does the same thing but this time just running to its own schedule.

    Why then do my incremental backups show no statistical change in file size when I run the routine manually and yet when the routine runs automatically the next incremental is HUGE signifying that a lot has changed with the file structure.

    It is as though the manually run option either does something different or does nothing at all compared to the scheduled run.
      My Computer


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

    Hello @Brink ,

    I maybe mistaken, but should Option 2 - Number 4 [ Commonly Used Commands ], be O [ Letter ] instead of Zero?



    On my Desktop Computer I have a SSD. I have the OS [ C: ] + TWO other Partitions [ D: & S: ] on the SSD.

    I also have THREE other Drives [ E: & F: & G: ] attached which are ALL HDDs.

    Using PowerShell, the Command you have in Option 3 - Part 4. To Automatically TRIM or Defrag Drive for what is Proper is Optimize-Volume -DriveLetter <drive letter> -Verbose.

    Is there a SINGLE Command that I can use to Defrag & TRIM the above ALL at ONCE, or will I have to use one Command for each please. The reason I ask is because I intend to Script this to run as part of my weekly cleanup regime and just want to get it right. The first THREE are SSD, and the second THREE are HDD.

    Code:
    
    Optimize-Volume -DriveLetter C -Verbose
    Optimize-Volume -DriveLetter D -Verbose
    Optimize-Volume -DriveLetter S -Verbose
    
    Optimize-Volume -DriveLetter E -Verbose
    Optimize-Volume -DriveLetter F -Verbose
    Optimize-Volume -DriveLetter G -Verbose



    Thanks.

      My Computer


  10. Posts : 68,994
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #119

    Paul Black said:
    Hello @Brink ,

    I maybe mistaken, but should Option 2 - Number 4 [ Commonly Used Commands ], be O [ Letter ] instead of Zero?



    On my Desktop Computer I have a SSD. I have the OS [ C: ] + TWO other Partitions [ D: & S: ] on the SSD.

    I also have THREE other Drives [ E: & F: & G: ] attached which are ALL HDDs.

    Using PowerShell, the Command you have in Option 3 - Part 4. To Automatically TRIM or Defrag Drive for what is Proper is Optimize-Volume -DriveLetter <drive letter> -Verbose.

    Is there a SINGLE Command that I can use to Defrag & TRIM the above ALL at ONCE, or will I have to use one Command for each please. The reason I ask is because I intend to Script this to run as part of my weekly cleanup regime and just want to get it right. The first THREE are SSD, and the second THREE are HDD.

    Code:
    
    Optimize-Volume -DriveLetter C -Verbose
    Optimize-Volume -DriveLetter D -Verbose
    Optimize-Volume -DriveLetter S -Verbose
    
    Optimize-Volume -DriveLetter E -Verbose
    Optimize-Volume -DriveLetter F -Verbose
    Optimize-Volume -DriveLetter G -Verbose



    Thanks.

    Hello Paul,

    I had to do a double look at option 2 step 4, but they are indeed the letter "O". For some reason, it does look more like the number "0" in the command box.

    Letter: O

    Number: 0


    I haven't tested this, but you might see if using the asterisk "*" symbol instead of a drive letter to see if it may apply to all.
      My Computers


 

Tutorial Categories

Optimize and Defrag Drives in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 11:52.
Find Us




Windows 10 Forums