Disk performance is a very important factor for Desktops and Servers. Desktops and Servers use disks very busy way to write and read data. While buying disk we should prefer a faster disk according to our budget. There is a way to make a disk faster without paying any money. We can defrag disks in Windows operating system. Keep in mind that this won’t work for SSD. We can use
defragcommand to make our disk tidy for a file system.
GUI or Command Line
defrag can be done in two ways. The first one is the GUI way Windows operating systems provide a GUI tool called Disk Defragmenter. Another way is using the command-line tool
We can find Disk Defragmenter GUI tool in Program files -> Accessories or simply writing down to the
The current status of partitions is listed with related drive letters. Also, last run information is given. Prevent defragmenting System Reserved partitions. We can select a partition and click the Defragment disk button to start the defragmentation. This may take some time. Also, we can click
Configure schedule button to configure defragmentation for future times to start automatically.
defrag is an MS-DOS or Powershell command. In order to run defrag we need Administrator privileges which means we should start the command line as Administrator.
We can list detailed help information about the
defrag command like below.
> defrag /?
Perform Defrag To A Volume
The most popular usage form of
defrag is operating only a single volume. We need to specify the volume or partition name to the command. In this example, we will defrag
> defrag E:
After defragmentation following information is provided.
- Volume Size
- Free Space
- Total Fragmented Space
- Largest Free Space Size
Perform Defrag In All Volumes
If we want to defrag in all volumes we can use
/C option. This will start the defragmentation process in all volumes in a sequential manner.
> defrag /C
Show Defrag Progress In Screen
Defragmentation operation generally takes sometimes. We can list the current situation of defragmentation in the command line with
/V option. In this example, we will list defragmentation progress of volume
> defrag E: /V