# How to defrag partitions Windows disk defragmenter rearranges fragmented data, reducing the size of partitions and improving disk and drive performance. It is recommended to defrag the disk before shrinking to further reduce the partition size. Defragmentation can be done in three ways. ## Using Endpoint Central Disk Defragmenter tool **Note:** This is only applicable for OS Deployment as an add-on in Endpoint Central. You can defrag partitions using the Defrag configuration in Endpoint Central: 1. Define the **Scope of Management** to include the computers that you wish to manage using Endpoint Central. 2. Select **Tools → System Tools → Add Task**. 3. Provide a name and description of the task. 4. Select the **Disk Defragmenter tool** and click **Next**. 5. Select the options for defragmentation of the disk and click **Next**. 6. Choose the computers on which you wish to perform disk defragmentation and click **Next**. 7. Specify the username and password for the account under which this process will run, and the interval at which it should be performed. 8. Click **Finish**. ## Using Windows Command line Verify if the partition is fragmented. To check this, execute the following command with administrative privileges: - To check for a single partition - `defrag.exe C: /A /V /U` - To check for all partitions - `defrag.exe /C /V /U` If fragmented space is detected, you can defrag the partition by executing the following command with administrative privileges: **Note:** The defragmentation process duration depends on your disk size and fragmentation percentage. - To defrag a single partition - `defrag.exe C: /V /U` - To defrag all partitions - `defrag.exe /C /V /U` ## Using Windows GUI 1. Go to **Control Panel → System and Security → Administrative Tools**. 2. Select **Defragment and Optimize Drives**. 3. Select the drives that you want to defragment and click **Analyze**. 4. Once the drives are analyzed, click **Defragment**. **Note:** In the above two methods, you can stop the defragmentation process if needed.