+3 votes
306 views
How to optimize and defragment SSD or HDD disk Windows 10

in Windows 10 by (551k points)
reopened | 306 views

1 Answer

+4 votes
Best answer

1. How to optimize an HDD or SDD hard drive in Windows 10
2. How to defragment a drive using Windows PowerShell or the command prompt in Windows 10

The use of hard drives in a Windows 10 operating system is a basic necessity, since without them it would be impossible to install the operating system, applications and programs to use and host all our information with which we work every day..

We currently have two types of hard drives , the traditional HDD and solid state drives SDD; which have better security and speed features, but less storage capacity than an HDD.

Regardless of the type of hard disk that is connected to our computer, the hard disk is used daily and internally executes thousands of reading and writing tasks to allow our files to open and that both the Windows 10 system and the programs can be accessed and used correctly and little by little this causes an impact of disk wear, but beyond we must know a little the internal process of the hard disk..

Each file that is stored on the computer is not a complete piece as such. Regardless of the type that this object is, it is composed of small fragments that are stored on the hard disk, and Windows 10 knows its location and how to access them; so, as we use the hard disk with the tasks of writing and deleting files , we usually do not manage to order them all correctly in areas close to the hard disk to optimize not only the space but the speed of access to them.

When a hard disk-level hosting disorder occurs, the default system must work much harder in order to detect file fragments, which can slow down the normal operation of the hard disk. This process is known as fragmentation and it is natural for HDD hard drives, since due to the structure and design of the SDD it is not normal for this phenomenon to occur, but it is worth reviewing it in a time range greater than an HDD ..

By defragmenting, or rearranging the space on the hard drive, we will have advantages such as
  • We will allow the response speed of the equipment to be improved since the fragments of the files have been sorted and it is not necessary to search them extensively.
  • We can recover more storage space on the hard drive once it has been defragmented.
  • We cause a positive impact on the life of the hard disk since we avoid superior wear by analyzing more sectors of it.
Note
Defragmentation tasks in Windows 10 only support NTFS, FAT and FAT32 file systems, so if any drive has a different file system, it cannot be optimized and something to consider is that removable drives and network cannot be optimized.

1. How to optimize an HDD or SDD hard drive in Windows 10


Step 1

To start this process we can enter the term defragment in the Windows 10 search box and we will see the following. There we select the utility "Defragment and optimize units".

image

Step 2

The following window will be displayed. There we find all the units available in the system and their current status. In the case of having HDD hard drives installed it will be possible to see what part of the drive is fragmented in the Current Status column and if we use SSD hard drives, the Current Status column will indicate if the drive requires optimization since, as we have said , these types of units do not require defragmentation. To optimize a unit, simply select it and click on the "Optimize" button.

image

Step 3

We will see that the analysis process of this unit begins:

image

Step 4

In the case of HDD hard drives, we can click on the "Analyze" button to verify what percentage of the drive is fragmented in real time and then click on the "Optimize" button to defragment the selected drive:

image

Note
This process may take several hours based on the size and state of the selected disk drive.
Step 5

By default Windows 10 executes this task on a weekly basis, but we may want to modify these values, to do this, click on the "Change settings" button and we will see the following. In the "Frequency" field we can select options such as Daily, Weekly or Monthly.

image

Step 6

By clicking on the option "Choose in the Units field", we can define which active units have to be optimized and it is possible to activate the box "Automatically optimize new units" so that this task is executed when connecting a new hard disk in Windows 10. Once this is defined, click on the "Accept to apply changes" button and the system will automatically perform these tasks based on the selected configuration.

image


2. How to defragment a drive using Windows PowerShell or the command prompt in Windows 10


Step 1

This process applies to both consoles and the basic way to defragment an HDD or SDD drive is by running the following syntax:
 defrag C: / O 
Note
We can replace drive C with the letter of the disk to be analyzed.

Pressing "Enter" will start the fragmentation process:

image
Step 2

Now, the general syntax, with usage parameters is as follows:
 defrag <volumes> | / C | / E <volume> [<tasks (s)>] [/ H] [/ M [n] | [/ U] [/ V]] [/ I n] 
The available arguments are
  • /TO; Run an analysis on the specified volumes.
  • / C: Performs the operation on all volumes.
  • / D: Performs normal defragmentation (this is the default).
  • / E: Execute the operation on all volumes except those specified.
  • / G: Optimizes storage levels on specified volumes.
  • / H: Execute the operation with normal priority (the default is low).
  • / I n: In this case the level optimization would be executed for a maximum of n seconds in each volume.
  • / K: Performs slab consolidation on specified volumes.
  • / L: Execute the retrim command on the specified volumes.
  • / M [n]: Execute the operation on each volume in parallel in the background.
  • / O: Performs the appropriate optimization for each type of medium.
  • / T: Allows you to track an operation in progress on the specified volume.
  • / U: Print the operation progress on the screen.
  • / V: Print the detailed output containing the fragmentation statistics.
  • / X: Performs the consolidation of free space in the specified volumes.

In addition to this, Windows PowerShell allows us to use cmdlets to optimize the desired units, for this we can run the following line to optimize, in this case, the D drive:

 Optimize-Volume -DriveLetter D -Verbose 
image
Step 3

Once this process is finished we will see the following: image

In the case of SDD hard drives we must execute the following:

 Optimize-Volume -DriveLetter "Drive letter" -ReTrim -Verbose 
With these methods, we can perform the defragmentation task on the SDD and HDD disk drives and in this way optimize the capacity and functionality of each of them to the maximum, remember that this process is ideal to be performed frequently on HDD disk drives .

by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Jan 24, 2020 in Windows 10 by backtothefuture (551k points) | 262 views
+5 votes
1 answer
+3 votes
1 answer
asked Jun 10, 2020 in Windows 10 by backtothefuture (551k points) | 256 views
+3 votes
1 answer
asked Sep 29, 2019 in Windows 10 by backtothefuture (551k points) | 334 views
+4 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback
10,632 questions
10,764 answers
510 comments
3 users