Hello,
your observations are correct and align with how Windows Automatic Maintenance evaluates idle state. For HDDs, scheduled defragmentation requires a sustained idle period because the operation is resource‑intensive: it generates continuous disk I/O and CPU usage. If Trellix Endpoint Security is actively scanning or intercepting file operations on the system volume, the OS will not consider the machine fully idle. In that case, Automatic Maintenance will postpone or skip the defrag task, which explains why you see it failing to trigger overnight. This is expected behavior rather than a malfunction.
For SSDs, the optimization task is fundamentally different. Retrim is a lightweight command that informs the SSD controller which blocks can be erased. It completes in milliseconds and does not require the same long idle window. Windows treats it as a quick maintenance action that can run even when background activity exists, so endpoint protection software does not prevent it from executing. That is why you consistently see SSD optimization succeed even with Trellix active.
To clarify your specific questions: yes, continuous background I/O from Trellix or similar endpoint security agents can prevent HDDs from reaching the idle threshold required for scheduled defrag. And yes, Windows applies a shorter idle requirement for SSDs because Retrim passes are so fast compared to mechanical defragmentation. This distinction is documented in Microsoft’s Automatic Maintenance framework: tasks are classified by resource intensity, and disk defragmentation is one of the few that requires strict idle detection.
If you need to guarantee HDD defragmentation in environments with heavy endpoint activity, the recommended approach is to schedule it explicitly outside of peak scanning windows using defrag.exe /C /H or PowerShell Optimize-Volume. This bypasses idle detection and ensures the task runs. Event Viewer under Applications and Services Logs → Microsoft → Windows → TaskScheduler → Maintenance will confirm whether tasks were skipped due to idle state.
I hope you've found something useful here. If it helps you get more insight into the issue, it's appreciated to accept the answer. Should you have more questions, feel free to leave a message. Have a nice day!
Domic Vo.