FireCubeStudios / Rebound

Windows 11 done right.
https://ivirius.vercel.app
MIT License
387 stars 9 forks source link

Bug: Defragment and Optimize Drives - Uses defrag operation instead of trim on SSDs #61

Closed infyProductions closed 2 weeks ago

infyProductions commented 2 weeks ago

🪟 What OS build is this issue present?

Windows Insider Release Preview 26100.1882

🔢 What version are you on?

Rebound Hub: ALPHA v.0.0.3 Rebound 11: ALPHA v.0.0.3 Optimize Drives: Beta v.0.1.0

📄 Description

I use a M.2 SATA SSD as my boot drive (model: TEAM TM8PS7256G). When I clicked Optimize, after the Analyzing status, it performed a Defrag instead of expected Trim like it does on the legacy app.

Example in its legacy app: image

🪜 Steps To Reproduce

  1. Open "Defragment and Optimized Drives" (by searching it in the Start Menu) image
  2. Select an SSD volume (e.g. Drive C:) image
  3. Click "Optimize" (with the shield icon) image
  4. Grant the UAC by clicking "Yes" image
  5. Click "Optimize" again image
  6. Wait until after the "Analysis" is completed image
  7. The result image

🤔 Expected behavior

When operating with SSDs, it should do a Trim instead of Defrag: image

Affected platforms

🪟 Windows

⚒️ Did you find any workaround?

The only workaround for it (and to stop the defrag), is launching the legacy app (Optimize Drives) and quickly stop the defrag operation.

📸 Assets

While doing defrag on an SSD instead of trim: image

Lamparter commented 2 weeks ago

Wow that's dangerous. I didn't create the API the app uses myself, @IviriusMain do you know whether this is just a bad reporting or the app is actually defragmenting the drive?

IviriusMain commented 2 weeks ago

Honestly I don't know, I just use defrag.exe /O prefix for the backend

Lamparter commented 2 weeks ago

Ah that's how it works; then it would perform a trim on an SSD rather than a defrag. We should change the string based on whether it's an SSD or not in this case.

IviriusMain commented 2 weeks ago

Ok will do, hopefully I can do it today so we can close this issue.

IviriusMain commented 2 weeks ago

Using PowerShell I managed to make it only do retrim on SSDs and defrag on HDDs. Will mark this as closed.