Fix TRIM Schedule Not Running on a Secondary SATA SSD on Windows 11
🔍 WiseChecker

Fix TRIM Schedule Not Running on a Secondary SATA SSD on Windows 11

You have a secondary SATA SSD installed in your Windows 11 PC, but the automatic TRIM schedule is not running for that drive. This can happen even when TRIM works correctly on the primary system drive. The root cause is often a missing or misconfigured scheduled task or a drive optimization profile that does not include the secondary SSD. This article explains why the TRIM schedule fails for secondary SATA SSDs and provides clear steps to restore automatic TRIM on all drives.

Key Takeaways: Restoring TRIM on a Secondary SATA SSD

  • Settings > System > Storage > Advanced storage settings > Drive optimization > Optimize: Check the current TRIM status for each drive and manually trigger TRIM to verify functionality.
  • Task Scheduler > Microsoft > Windows > Defrag > ScheduledDefrag: Inspect and repair the scheduled task that controls automatic TRIM execution for all SSDs.
  • fsutil behavior set DisableDeleteNotify 0: Run this command in an elevated Command Prompt to ensure the TRIM command is enabled at the system level.

ADVERTISEMENT

Why TRIM Does Not Run on a Secondary SATA SSD

TRIM is an ATA command that informs an SSD which data blocks are no longer in use. This allows the drive to perform internal garbage collection, maintaining write speed and prolonging lifespan. Windows 11 schedules TRIM through the Optimize Drives feature, which runs a weekly maintenance task. The task is managed by the Task Scheduler entry ScheduledDefrag under Microsoft > Windows > Defrag.

When TRIM does not run on a secondary SATA SSD, one of these conditions is typically present:

  • The drive is marked as a removable device in the registry, causing the scheduler to skip it.
  • The scheduled task ScheduledDefrag is disabled or corrupted.
  • The system-wide TRIM flag DisableDeleteNotify is set to 1, which disables TRIM for all drives.
  • The drive optimization schedule is set to manual or is not applied to the secondary drive.

The fix involves verifying each of these areas and correcting any misconfiguration.

Steps to Restore Automatic TRIM on a Secondary SATA SSD

Follow these steps in order. Each step addresses one possible cause. After completing all steps, the automatic TRIM schedule should run for the secondary SSD.

Step 1: Verify TRIM Is Enabled at the System Level

  1. Open Command Prompt as administrator
    Press the Windows key, type cmd, right-click Command Prompt, and select Run as administrator.
  2. Check the current TRIM state
    Type the following command and press Enter:
    fsutil behavior query DisableDeleteNotify
    If the output shows DisableDeleteNotify = 1, TRIM is disabled. If it shows 0, TRIM is enabled.
  3. Enable TRIM if disabled
    If the value is 1, type this command and press Enter:
    fsutil behavior set DisableDeleteNotify 0
    This enables TRIM at the system level for all drives.

Step 2: Verify the Drive Is Not Marked as Removable

  1. Open Registry Editor
    Press Windows key + R, type regedit, and press Enter.
  2. Navigate to the storage policy key
    Go to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device
    If the key does not exist, create it by right-clicking stornvme, selecting New > Key, and naming it Parameters. Then create a subkey named Device.
  3. Create or modify the TreatAsInternalPort value
    Right-click in the right pane, select New > DWORD (32-bit) Value, and name it TreatAsInternalPort. Double-click it and set the value data to 1. Click OK.
  4. Restart your PC
    This change forces the system to treat the SATA SSD as an internal drive, allowing the scheduler to run TRIM on it.

Step 3: Check and Repair the ScheduledDefrag Task

  1. Open Task Scheduler
    Press Windows key + R, type taskschd.msc, and press Enter.
  2. Navigate to the Defrag task
    In the left pane, expand Task Scheduler Library > Microsoft > Windows > Defrag. Select the Defrag folder.
  3. Inspect the ScheduledDefrag task
    In the middle pane, double-click ScheduledDefrag. Verify that the task status is Enabled. If it is disabled, right-click the task and select Enable.
  4. Verify the task triggers and actions
    Click the Triggers tab. Ensure there is a trigger set to run weekly. Click the Actions tab. The action should be Start a program with the program %windir%\system32\defrag.exe and arguments -c -o -g.
  5. Run the task manually to test
    Right-click ScheduledDefrag and select Run. Wait for the task to complete. Then proceed to Step 4 to verify TRIM ran.

Step 4: Manually Optimize the Secondary SSD and Confirm TRIM

  1. Open Optimize Drives
    Press Windows key + S, type Defragment and Optimize Drives, and press Enter.
  2. Select the secondary SSD
    In the list of drives, locate your secondary SATA SSD. The Media type column should show Solid state drive. If it shows Hard disk drive, the drive is misidentified and TRIM will not run.
  3. Manually optimize the drive
    Select the secondary SSD and click Optimize. The Current status column will update. For an SSD, the status should show OK (TRIM supported) after optimization.
  4. Check the schedule
    Click Change settings. Ensure Run on a schedule (recommended) is checked. Under Drives, click Choose and confirm that the secondary SSD is selected. Click OK twice to save.

ADVERTISEMENT

If TRIM Still Does Not Run on the Secondary SSD

If the steps above do not resolve the issue, check these additional scenarios.

The Drive Is Reported as a Hard Disk Drive in Optimize Drives

Windows 11 may misidentify a SATA SSD as an HDD. When this happens, the Optimize Drives tool runs a defragmentation instead of TRIM. To fix this, run the following command in an elevated Command Prompt:
wmic diskdrive get model,index,interfacetype
Note the index number of your secondary SSD. Then run:
wmic path Win32_LogicalDisk where DeviceID="X:" get Size,DriveType
Replace X with the drive letter. If the drive type is 3 (local disk), the identification should be correct. If it shows as removable, use the registry fix in Step 2 again.

TRIM Runs on the Primary Drive but Not the Secondary Drive

This points to a drive-specific configuration. Open an elevated PowerShell and run:
Optimize-Volume -DriveLetter X -ReTrim -Verbose
Replace X with the drive letter of the secondary SSD. If this command succeeds, the issue is with the scheduled task. Revisit Step 3 and confirm the task is enabled and contains the correct arguments.

Third-Party SSD Tools Interfere with the Windows TRIM Schedule

Some SSD management software, such as Samsung Magician or Crucial Storage Executive, can disable the Windows TRIM schedule to use their own. Check the settings in your SSD tool. If it has an option to disable Windows TRIM, enable it or uninstall the tool and let Windows manage TRIM.

Manual TRIM vs Automatic Scheduled TRIM

Item Manual TRIM Automatic Scheduled TRIM
Execution method Run Optimize Drives or PowerShell command manually Task Scheduler runs defrag.exe weekly
Frequency User-initiated Default weekly, configurable
Coverage Selected drive only All drives included in the schedule
Reliability Depends on user remembering Runs automatically in the background
Best for Troubleshooting or testing Ongoing maintenance without user intervention

After completing the steps in this article, your secondary SATA SSD will receive automatic TRIM maintenance. Open Optimize Drives and verify that the Last run column updates after the scheduled task executes. For advanced monitoring, use the PowerShell command Get-ScheduledTask -TaskName ScheduledDefrag | Get-ScheduledTaskInfo to confirm the task ran successfully. If you ever need to force TRIM immediately, use Optimize-Volume -DriveLetter X -ReTrim -Verbose in an elevated PowerShell session.

ADVERTISEMENT