Geeks in Phoenix

Geek Blog


How to defragment and optimize your drive in Windows 11

When it comes to the performance of your Windows 11 computer, the faster your drive can read and write files, the better. So keeping your drive in tip-top shape is essential. So here is how to defragment and optimize your drive in Windows 11.

How to defragment and optimize your drive in Windows 11

Imagine opening a filing cabinet and finding someone mixed up all the files. It would take you more time to find the files you were looking right? The same thing holds true for your computer.

When I started working with computers, there were only a couple of storage options: Hard Disk Drives (HDD) and Floppy Disk Drives (FDD). And DOS and early versions of Windows were notorious for not writing files back to exactly where they were found, and this a how a drive gets fragmented.

So HDDs required regular defragmentation to maintain their performance. On the other hand, Solid State Drives (SSD) write files back to the same place they found them. The only maintenance SSDs require is free space consolidation.

And the built-in defragment/optimization program in Windows 11 can handle both HDDs and SSDs. In fact, there are two (2) versions of the defrag program. One has a GUI (Graphic User Interface), The other uses a Command Line Interface (CLI).

I like to refer to the different versions as Standard (GUI) and Advanced (CLI). The Standard version is simple to use but has limited features, and the Advanced version is a little harder to use but has more features.

The Standard way to defrag/optimize your drives in Windows 11

Using the GUI version of Defrag in Windows 11

To perform Standard defragment/optimization, you will need to open the Defragment and Optimize Drives program. Here are a couple of ways of opening the app.

  1. Left-click on the Start button Windows logo to bring up the Start menu.
  2. In the upper right-hand corner of the Start menu, left-click on All apps.
  3. Scroll down the list of programs and left-click on Windows Tools.
  4. Left-click on Defragment and Optimize Drives.

or

  1. Open File Explorer using one of the following:
    • Left-click on the File Explorer icon (manilla folder) on the Taskbar.
    • Press the Windows logo key Windows logo + E at the same time.
    • Use the Power User menu by right-clicking on the Start Windows logo button and selecting File Explorer.
  2. In the left-side column, left-click on This PC.
  3. In the right-side column, right-click on the drive you want to optimize and select Properties.
  4. Left-click on the Tools tab.
  5. Under Optimize and defragment drive, left-click on Optimize.

Once you have the Optimize Drives program open, just highlight the drive you want to optimize and select either Analyze or Optimize. You can also change the schedule that Windows 11 uses for scheduled optimization.

The Advanced way to defrag/optimize your drives in Windows 11

Using the CLI version of Defrag in Windows 11

To perform Advanced defragment/optimization, you will need to run command-line syntax(s) and parameter(s) in an Administrative Command Prompt. The link below opens in a new window.

How to open a Command Prompt with Administrator privileges in Windows 11

The name of the program you want to run is Defrag. There are multiple syntaxes and parameters you can use with Defrag. The complete list and a few examples are listed below. The correct usage of syntaxes and parameters are as follows:

Defrag <Volumes> <Operations> [<Options>]

Examples:

  • Defrag C: /U /V
  • Defrag C: D: /TierOptimize /MultiThread
  • Defrag C:\mountpoint /Analyze /U
  • Defrag /C /H /V
Volumes
/C | /AllVolumes On each volume run only the preferred operations from the given list of operations.
/E | /VolumesExcept <volume paths> Perform all the given operations on each volume except those specified. If the exception list is empty, this behaves as /AllVolumes.
volume paths Specifies the drive letter followed by a colon, mount point, or volume name. More than one volume can be specified. Run all the given operations on each specified volume.
Operations
/A | /Analyze Perform analysis.
/B | /BootOptimize Perform boot optimization to increase boot performance.
/D | /Defrag Perform traditional defrag (this is the default). On a tiered volume, traditional defrag is performed only on the Capacity tier.
/G | /TierOptimize On tiered volumes, optimize files to reside on the appropriate storage tier.
/K | /SlabConsolidate On thinly provisioned volumes, perform slab consolidation to increase slab usage efficiency.
/L | /Retrim On thinly provisioned volumes, perform retrim to release free slabs. On SSDs perform retrim to improve write performance.
/O | /Optimize Perform the proper optimization for each media type.
/T | /TrackProgress Track progress of a running operation for a given volume. An instance can show progress only for a single volume. To see progress for another volume launch another instance.
/U | /PrintProgress Print the progress of the operation on the screen.
/V | /Verbose Print verbose output containing the fragmentation statistics.
/X | /FreespaceConsolidate Perform free space consolidation, moves free space towards the end of the volume (even on thin provisioned volumes). On tiered volumes consolidation is performed only on the Capacity tier.
Options
/H | /NormalPriority Run the operation at normal priority (default is low).
/I | /MaxRuntime n Available only with TierOptimize. Tier optimization would run for at most n seconds on each volume.
/LayoutFile <file path> Available only with BootOptimize. This file contains the list of files to be optimized. The default location is %windir%\Prefetch\layout.ini.
/M | /MultiThread [n] Run the operation on each volume in parallel in the background. For TierOptimize, at most n threads optimize the storage tiers in parallel. Default value of n is 8. All other optimizations ignore n.
/OnlyPreferred When volumes are specified explicitly, defrag performs all the given operations on each specified volume. This switch lets defrag run only the preferred operations, from the given list of operations, on each specified volume.

How to defragment and optimize your drive in Windows 10

Updated December 12, 2021

Have you ever tried to find a file in a disorganized filing cabinet? It can take some time. The same thing can happen when your computer's drive becomes fragmented. But you can keep all of the folders and files on your computer organized with regular defragmentation. Here's how to defragment and optimize your drive in Windows 10.

How to defragment and optimize your drive in Windows 10

There are two (2) types of drives used in computers, Hard Disk Drive (HDD) and Solid State Drive (SSD). The kind of drive you have determines whether you need (or want) to defragment and optimize it. To find out what type of drive(s) you have, follow the standard instructions below. The Optimize Drives screen will tell you what kind of drive(s) you currently have in your computer.

The issue of drive fragmentation stemmed from the early '80s when Microsoft needed an OS, and they bought Quick and Dirty Operating System (QDOS) and renamed it MS-DOS. At that time, HDDs were the only type of drive available, and they are still the de facto standard in the industry. And they do need to be defragmented and optimized regularly.

Now SSD's are different in that there are no moving parts inside, just memory chips. So when your computer reads and writes to it, the data is going back to the same location on the drive. You can defrag and optimize an SSD, but it is not recommended since SSDs have limited read/write cycles, and any program that intensively accesses the SSD could shorten the life span of the drive. Microsoft started adding support for SSDs in Windows 7 / Windows Server 2008 with the Trim command. Since the low-level operation of SSDs differs from HDDs, the Trim command handles deletes/format requests.

You can verify Trim is enabled by typing the following into an Administrative Command Prompt:

fsutil behavior query DisableDeleteNotify

If the command returns a 0, then Trim is enabled. If it returns a 1, then it is not. To enable Trim, type the following into the Administrative Command Prompt:

fsutil behavior set DisableDeleteNotify 0

Standard drive defragment and optimization in Windows 10

standard drive defragment and optimization in Windows 10

    1. Bring up the Defragment and Optimize Drives application by:
      1. Left-click on the Start Windows logo button.
      2. Scroll down to Windows Administrative Tools and left-click to expand.
      3. Left-click on Defragment and Optimize Drives.

or

      1. Open File Explorer by left-clicking the File Explorer icon (the manilla folder) on the Taskbar.
      2. In the left-side column, left-click on This PC.
      3. In the right-side column right-click on the drive you want to check and select Properties.
      4. Left-click on the Tools tab.
      5. Under Optimize and defragment drive left-click on Optimize.

then

  1. Left-click on the drive(s) you want to optimize.
  2. Left-click on Analyze (Analyze all) or Optimize (Optimize all)

Advanced drive defragment and optimization in Windows 10

advanced drive defragment and optimization in Windows 10

  1. Open a Command Prompt with Administrative privileges (click here for instructions)
  2. Use the following command line syntax(s) and parameter(s) to run DEFRAG:

Defrag <Volumes> <Operations> [<Options>]

Examples:

  • Defrag C: /U /V
  • Defrag C: D: /TierOptimize /MultiThread
  • Defrag C:\mountpoint /Analysis /U
  • Defrag /C /H /V
Volumes
/C | /AllVolumes On each volume run only the preferred operations from the given list of operations.
/E | /VolumesExcept <volume paths> Perform all the given operations on each volume except those specified. If the exception list is empty, this behaves as /AllVolumes.
volume paths Specifies the drive letter followed by a colon, mount point, or volume name. More than one volume can be specified. Run all the given operations on each specified volume.
Operations
/A | /Analyze Perform analysis.
/B | /BootOptimize Perform boot optimization to increase boot performance.
/D | /Defrag Perform traditional defrag (this is the default). On a tiered volume, traditional defrag is performed only on the Capacity tier.
/G | /TierOptimize On tiered volumes, optimize files to reside on the appropriate storage tier.
/K | /SlabConsolidate On thinly provisioned volumes, perform slab consolidation to increase slab usage efficiency.
/L | /Retrim On thinly provisioned volumes, perform retrim to release free slabs. On SSDs perform retrim to improve write performance.
/O | /Optimize Perform the proper optimization for each media type.
/T | /TrackProgress Track progress of a running operation for a given volume. An instance can show progress only for a single volume. To see progress for another volume launch another instance.
/U | /PrintProgress Print the progress of the operation on the screen.
/V | /Verbose Print verbose output containing the fragmentation statistics.
/X | /FreespaceConsolidate Perform free space consolidation, moves free space towards the end of the volume (even on thin provisioned volumes). On tiered volumes consolidation is performed only on the Capacity tier.
Options
/H | /NormalPriority Run the operation at normal priority (default is low).
/I | /MaxRuntime n Available only with TierOptimize. Tier optimization would run for at most n seconds on each volume.
/LayoutFile <file path> Available only with BootOptimize. This file contains the list of files to be optimized. The default location is %windir%\Prefetch\layout.ini.
/M | /MultiThread [n] Run the operation on each volume in parallel in the background. For TierOptimize, at most n threads optimize the storage tiers in parallel. Default value of n is 8. All other optimizations ignore n.
/OnlyPreferred When volumes are specified explicitly, defrag performs all the given operations on each specified volume. This switch lets defrag run only the preferred operations, from the given list of operations, on each specified volume.

How to speed up the boot time of your computer

Updated January 3, 2023

Does it seem like your computer takes forever to boot up? Waiting for your Windows-based computer to boot can be quite frustrating. But there are a few things you can do. Here is how to speed up the boot time of your computer.

How to speed up the boot time of your computer

Check the drive for errors

If your computer has a Hard Disk Drive (HDD), this is the first thing you want to do. HDD's are notorious for not writing data back to the exact place where the data was read. Little known fact, but Microsoft didn't invent the Disk Operating System (DOS). It bought Quick and Dirty Operating System (QDOS) in the early '80s and renamed it MS-DOS. If you have a Solid State Drive (SSD), you can bypass this step, as SSD's don't have moving parts.

Check for hardware issues first with the software provided by the manufacturer of your HDD. The Ultimate Boot CD (UBCD) has all of the significant drive manufacturer's diagnostics software built-in, so this is always the right place to start.

Diagnose computer hardware issues with the Ultimate Boot CD

Then check for software issues with Windows built-in CHKDSK.

Check your hard disk for errors in Windows Vista / Windows 7

Check your hard drive for errors in Windows 8

Check your hard drive for errors in Windows 10

How to check your drive for errors in Windows 11

Uninstall any unwanted programs

This one is a no-brainer. Allot of adware/junkware will load itself up at boot, causing an increase in boot time. It also takes away resources that could be used by programs you want to run. The first thing to do is to go to the Control Panel > Programs > Programs and Features. Then go through the list of programs to see which ones can be uninstalled. Remember that you can change the way the programs are listed just by clicking on the column name. I like to know when a program was installed because you can find many unwanted clutter installations that way.

Remove unwanted items from startup

MSCONFIG inside of Windows 11
MSCONFIG inside of Windows 11

You can temporarily disable programs and services that start up with Windows using MSCONFIG. MSCONFIG is a diagnostic tool built into Windows that allows you to troubleshoot boot issues. You can enable and disable various boot settings, including programs and services that startup with Windows. Just open an Administrator Command Prompt and type MSCONFIG.

How to open a Command Prompt with Administrator privileges in Windows Vista and Windows 7

How to open a Command Prompt with Administrator privileges in Windows 8

How to open a Command Prompt with Administrator privileges in Windows 10

How to open a Command Prompt with Administrator privileges in Windows 11

Once you have your system fine-tuned with MSCONFIG, you could leave your system running in diagnostic mode by having MSCONFIG not displayed at startup. That's one of the first things I check for on systems I work on. It just too easy to let it go. But if you want to permanently remove the items you have disabled in MSCONFIG, here's how to do it.

The Autoruns Everything tab inside of Windows 11
The Everything tab inside of Autoruns

  1. Download and extract the latest version of Autoruns from Microsoft.
  2. Open MSCONFIG and make a note of each item you have disabled.
  3. On the General tab of MSCONFIG, select Normal startup, then left-click Apply and OK. When prompted, close MSCONFIG and do not restart the computer. Yes, this will enable all of the items you have disabled, but we will delete them next.
  4. Open the folder where you saved Autoruns.exe, right-click on it and select Run as Administrator.
  5. Once it is done scanning, you need to find the items you had disabled with MSCONFIG. Check the Services and the Logon tabs first. Remember that you can check the logon items for each user with the User pull-down menu. Once you find your things, you can 1) disable it with the checkbox on the left or 2) you can right-click on it and select Delete.

Clean up the drive

It's time to clean up some of the clutter that seems to pile up. Using Windows built-in Disk Cleanup tool (cleanmgr.exe) will quickly clean out all sorts of crap, like user temp files and temporary Internet files. If you want to go a little further with cleaning your drive, download a copy of CCleaner.

Free up more disk space with Windows Vista / Windows 7 Disk Cleanup

Clean up your hard drive in Windows 8 with Disk Cleanup

Clean up Windows 10 with Disk Cleanup

Clean up your Windows 10 computer using the Storage feature

Clean up Windows 11 with Storage Sense and Disk Cleanup

Clean up and optimize your computer for free with CCleaner

Defragment your HDD

This is another step that only pertains to HDD's since SSD's don't get fragmented. If your HDD is fragmented, it takes it longer to find and load files. Optimizing the HDD structure will always give you a little more speed. You can use Windows built-in Optimize and Defragment drive tool or another disk utility like Defraggler from Piriform.

Geek Tip: If you use run the Disk Defragmenter from an Admin Command Prompt, you can use the /B switch to optimize the boot performance. For example, if you want to optimize booting on the C: drive, you would use the following:

Defrag C: /B

Using Disk Defragmenter in Windows Vista

Using Disk Defragmenter in Windows 7

Defragment and Optimize your hard drive in Windows 8

How to defragment and optimize your drive in Windows 10

How to defragment and optimize your drive in Windows 11

Perform advanced disk defragmentation with Defraggler from Piriform

If you want to go the extra mile with optimizing your HDD, remove the swap file before you defrag and restore it after you're done. And when you restore it, go ahead and use the following calculations.

The minimum pagefile size is one and a half (1.5) x the amount of memory. The maximum pagefile size is three (3) x the minimum pagefile size. Let's say you have 2 Gb (2,048 Mb) of memory. The minimum pagefile size would be 1.5 x 2,048 = 3,072 Mb and the maximum pagefile size would be 3 x 3,072 = 9,216 Mb.

Perform advanced disk defragmentation with Defraggler from Piriform

Have you ever opened a filing cabinet just to find the folders just scattered around? The files are all over the place, and you cannot find what you're looking for. The same thing can happen to the folders/files on your Windows based computer. Windows does come with a disk defrag program, but its options are minimal. If you're looking for something more in a disk defrag program, check out Defraggler by Piriform.

Drive view inside of Defraggler
Drive view inside of Defraggler

With Defraggler, you can do much more than just defragment your hard drive. You can do a quick or full defrag, defrag only free space, and my favorite, boot-time defrag. And it uses the same technology as Windows built-in defragmenter to read and write files. You can even have the option to replace the Windows built-in defrag program with Defraggler.

Block detail view inside of Defraggler
Block detail view inside of Defraggler

Defraggler also has something that has been missing from Windows built-in defragmenter for years, a drive map showing the status of files on your hard drive. And what is cool is that you can left-click on a block, and Defraggler will tell you what file(s) are located in it. And best of all, it's free. Here's a quote from the Piriform website:

Defragment exactly what you want
Most defrag tools only allow you to defrag an entire drive. Defraggler lets you specify one or more files, folders, or the whole drive to defragment.

Safe and Secure
When Defraggler reads or writes a file, it uses the exact same techniques that Windows uses. Using Defraggler is just as safe for your files as using Windows.

Compact and portable
Defraggler's tough on your files – and light on your system.

Interactive drive map
At a glance, you can see how fragmented your hard drive is. Defraggler's drive map shows you blocks that are empty, not fragmented, or needing defragmentation.

Quick Defrag
Give your hard drive a quick touch-up with Quick Defrag.

Defragment free space
Organizes empty disk space to further prevent fragmentation.

Scheduled defragmentation
Defragment while you sleep - and wake up with a faster PC. Set Defraggler to run daily, weekly or monthly.

Multi-lingual support
No matter what your native tongue is, Defraggler speaks your language. It currently supports 37 languages.

For more information on Defraggler, just follow the link below:

Defraggler - File and Disk Defragmentation

Defragment and Optimize your hard drive in Windows 8

Have you ever opened a filing cabinet and couldn't find the file or folder you were looking for? The same thing can happen to your computer when your hard drive becomes fragmented. To keep all of your files in the right place, optimizing your hard drive regularly is highly recommended. You can do this with Windows 8 built-in hard drive optimizing utility, Defragment and Optimize Drives.

Standard hard drive optimization in Windows 8

  1. Go to the Start menu.
  2. Right-click the Start menu background to bring up the app commands.
  3. Select 'All apps'.
  4. Scroll to the 'File Explorer' tile and left-click on it.
  5. Left-click on 'Computer'.
  6. Right-click the hard drive that you want to optimize, and then click 'Properties'.
  7. Click the 'Tools' tab, and then, under 'Optimize and defragment drive', click 'Optimize'.
  8. Select the drive you want to defrag and click on 'Optimize'.

Or

  1. Go to the Start menu.
  2. Right-click the Start menu background to bring up the app commands.
  3. Select 'All apps'.
  4. Scroll to the 'Control Panel' tile and left-click on it.
  5. On the upper right side of the Control Panel, there is a 'View by:' pull-down menu (the default is Category). Left-click on the arrow to the right and select either 'Large icons' or 'Small icons'.
  6. Left-click on 'Administrative Tools'.
  7. Double left-click 'Defragment and Optimize Drives'.
  8. Select the drive you want to optimize and click on 'Optimize'.

Advanced hard drive optimization in Windows 8

  1. Open a Command Prompt with Administrative privileges (click here for instructions)
  2. Use the following command-line syntax(s) and parameter(s) to run DEFRAG:

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

Value Description
/A Perform analysis on the specified volumes.
/C Perform the operation on all volumes.
/D Perform traditional defrag (this is the default).
/E Perform the operation on all volumes except those specified.
/H Run the operation at normal priority (default is low).
/K Perform slab consolidation on the specified volumes.
/L Perform retrim on the specified volumes.
/M Run the operation on each volume in parallel in the background.
/O Perform the proper optimization for each media type.
/T Track an operation already in progress on the specified volume.
/U Print the progress of the operation on the screen.
/V Print verbose output containing the fragmentation statistics.
/X Perform free space consolidation on the specified volumes.

Free computer diagnostics

Repairing a PC can sometimes be expensive, and that is why we offer free basic in-shop diagnostics. Give one of our professional and experienced technicians a call at (602) 795-1111, and let's see what we can do for you.

Check out our reviews

Geeks In Phoenix LLC, BBB Business Review

Customer service is #1

Here at Geeks in Phoenix, we take pride in providing excellent customer service. We aim to give the highest quality of service  from computer repair, virus removal, and data recovery.

Bring your computer to us and save

Repairing a computer can be time-consuming. That is why we base our in-shop service on the time we work on your computer, not the time it takes for your computer to work! From running memory checking software to scanning for viruses, these are processes that can take some time.

Contact us

If you have any questions, please feel free to give us a call at (602) 795-1111  and talk with one of our Geeks. Or you can send us a message from our contact page contact page , and one of our Geeks will get back to you as soon as possible. Or you can stop by and see us. Here are our hours and location.

Like Geeks in Phoenix on Facebook

Follow Geeks in Phoenix on Twitter

Watch Geeks in Phoenix on YouTube