Optimize Drives - Defrag HDD and TRIM SSD in Windows 8

How to Use "Optimize Drives" to Defrag HDD and TRIM SSD in Windows 8 and 8.1

information   Information
Optimize Drives, previously called Disk Defragmenter, helps to optimize the different types of drives that PCs use today. No matter which type of drive your PC uses, Windows automatically chooses the optimization that's right for your drive.

By default, Optimize Drives runs automatically on a weekly schedule during the time you have set for automatic maintenance. You can also optimize drives on your PC manually any time you like.

This tutorial will show you how to open and use Optimize Drives or a command prompt to defrag hard disk drives and TRIM solid state drives in Windows 8, Windows RT, Windows 8.1, and Windows RT 8.1.

You must be signed in as an administrator to be able to do the steps in this tutorial.

Note   Note

  • If the drive is being used by another program, or is formatted using a file system other than NTFS, FAT, or FAT32, it can't be optimized.
  • Network drives can't be optimized.
  • If a drive isn't appearing in Optimize Drives, it might be because it contains an error. Try to repair the drive with chkdsk first, then return to Optimize Drives to try again.





OPTION ONE

To Use "Optimize Drives" to Manually Defragment and Optimize Drives


1. In File Explorer, click/tap on Computer (Windows 8) or This PC (Windows 8.1), do step 1A or 1B below, then go to step 2 below.​
A) Select a HDD or SSD, click/tap on Manage (Drive Tools) tab, and click/tap on the Optimize button in the ribbon. (see screenshot below)​
Computer.jpg
B) Right click or press and hold on a HDD or SSD, click/tap on Properties, click/tap on Tools tab, Optimize button, and on OK. (see screenshot below)​
Properties.jpg
2. Under Status, click/tap on the drive you want to optimize. (see screenshot below)​
NOTE: The Media type column tells you what type (HDD or SSD) of drive you're optimizing.​
HDD.jpg
3. To determine if a HDD needs to be optimized, click/tap on Analyze. If prompted by UAC, then click/tap on Yes. (see screenshot below)​
NOTE: This is not available for a SSD.​
Analyze.jpg
4. Check the Current status column to see whether you need to optimize the drive (SSD or HDD). If the drive is more than 10% fragmented, then you should optimize the drive now.​
TRIM-2.jpg
5. To optimize the selected drive, click/tap on Optimize. If prompted by UAC, then click/tap on Yes. (see screenshot above and below)​
NOTE: Optimizing a drive might take anywhere from several minutes to a few hours to finish, depending on the size of the drive and degree of optimization needed. You can still use your PC during the optimization process.​
SSD.jpg
6. When finished, you can close the Optimize Drives window.​






OPTION TWO

To Use Command Prompt to Manually Defragment and Optimize Drives


1. Do step 2 or 3 below for how you would like to run the defrag command.​
2. To Use an Elevated Command Prompt in Windows 8
A) Open an elevated command prompt, and go to step 4 below.​
3. To Use a Command Prompt at Boot
B) In the command prompt, type diskpart and press Enter.​
C) In the command prompt, type list volume and press Enter.​
NOTE: Make note of the drive letter that you want to optimize. The drive letter for the drive will not always be the same at boot as it is in Windows 8.​
D) In the command prompt, type exit and press Enter.​
E) Continue on to step 4 below.​
4. In the command prompt, type in the following command below followed by one or more switches (flags) that you would like to use below with a space between each switch and press Enter.​
Syntax:
defrag <volumes> | /C | /E <volumes> [<task(s)>] [/H] [/M | [/U] [/V]]​
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​
Commonly Used Commands:
defrag C: /O
NOTE: Substitute C: in the command with the drive letter you want instead.​
defrag /C /O
NOTE: For all HDDs and SSDs.​
Parameters:
NOTE: Switches in red below are new to Windows 8.​
[TABLE=class:-grid,-width:-500][TR][TD]
Switch (value)
[/TD]
[TD]
Description
[/TD][/TR]
[TR][TD]
/A
[/TD]
[TD]
Perform analysis on the specified volumes.
[/TD][/TR]
[TR][TD]
/B
[/TD]
[TD]
Perform boot optimization to defrags the boot sector of the boot volume. This will not work on a SSD.
[/TD][/TR]
[TR][TD]
/C
[/TD]
[TD]
Perform the operation on all volumes.
[/TD][/TR]
[TR][TD]
/D
[/TD]
[TD]
Perform traditional defrag (this is the default).
[/TD][/TR]
[TR][TD]
/E
[/TD]
[TD]
Perform the operation on all volumes except those specified.
[/TD][/TR]
[TR][TD]
/H
[/TD]
[TD]
Run the operation at normal priority (default is low).
[/TD][/TR]
[TR][TD]
/K
[/TD]
[TD]
Perform slab consolidation on the specified volumes.
[/TD][/TR]
[TR][TD]
/L
[/TD]
[TD]
Perform retrim on the specified volumes. Only for a SSD.
[/TD][/TR]
[TR][TD]
/M
[/TD]
[TD]
Run the operation on each volume in parallel in the background.
[/TD][/TR]
[TR][TD]
/O
[/TD]
[TD]
Perform the proper optimization for each media type.
[/TD][/TR]
[TR][TD]
/T
[/TD]
[TD]
Track an operation already in progress on the specified volume.
[/TD][/TR]
[TR][TD]
/U
[/TD]
[TD]
Print the progress of the operation on the screen.
[/TD][/TR]
[TR][TD]
/V
[/TD]
[TD]
Print verbose output containing the fragmentation statistics.
[/TD][/TR]
[TR][TD]
/X
[/TD]
[TD]
Perform free space consolidation on the specified volumes.
[/TD][/TR][/TABLE]

CMD.jpg




That's it,
Shawn


 

Attachments

  • Configuration_File.png
    Configuration_File.png
    13.1 KB · Views: 424
Last edited by a moderator:
I usually set all my maintenance schedules to run when I know I'll be on the computer in the morning when I'm just doing my routine stuff before getting busy.
 
That sounds like a plan :) I tend to leave mine on while having breakfast and that's when it always seems to run automatically. As soon as its left alone (no keys pressed, no cursor movement) is when it starts.

OK, so from all you've mentioned on this I think that it probably knows what its doing and so I'll sit it out for some time and see what develops. And thanks for the info on it all.
 
Well I'm now over two weeks in and I relented and ran optimise manually as nothing was reported as having happened.

I don't really think there is a problem as such, but it is difficult to know just what is going on. Running optimise on all the partitions was completed in around 1 second for each. Does that sound right ? I could see a progress count of 'Trim 20%, 30%, 60% etc' but it really was all over in a second or so. The C drive was actually the quickest to do, the others that in reality see little change were the slowest, slowest being a relative term though.

I also observed a rather strange effect a few days ago that makes me think that the drive is doing 'something' on its own as regards maintenance, and it was this... I moved 6 files totalling around 120mb from a USB stick to my documents folder, and I found the free space on C had suddenly jumped up by around 0.7Gb

Capture1.JPG
 
Hello Mooly, :)

SSDs today have a built-in garbage collection feature that helps keep them optimized, so it usually doesn't take long at all to TRIM a SSD in Windows.
 
Thanks Shawn. I guess at the end of the day its all working fine despite Windows not doing what I would expect and updating the schedule.
 
I just discovered that the built-in defrag does not work very well, whether I let it defrag on schedule or manually. Sometimes, the system still slows down, and does better only when I use a third-party defrag program, and do a boot defrag.

Interestingly enough, similar takes place even for HDs containing data. For example, I am currently using an SSD for the boot drive, so there are no more problems with a system slowdown, but I use an internal HD to burn large videos to DVDs. I routinely copy videos to the HD, burn them, delete them, then clear the recycle bin. At some point, verification errors begin to pop up after burning a DVD. It happens with the second and third disks, using disks from another tumbler, and other video files selected. It doesn't matter if I optimize the HD using the built-in Windows defrag and boot the system several times.

It's only when I defrag the HD using another program does the problem disappear.
 
Back
Top