Blog Post

Storage at Microsoft
4 MIN READ

Windows 7 Disk Defragmenter User Interface Overview

Jose_Barreto's avatar
Jose_Barreto
Icon for Microsoft rankMicrosoft
Apr 10, 2019
First published on TECHNET on Nov 25, 2009

Introduction



The Vista and Windows Server 2008 Defragmentation UI was limited to essential information and controls.   Based on user feedback it was found that the UI was too minimal.   In Win7 the UI intends to make the defrag operations more transparent and match the task demands of the user.


List of features provided through Windows 7 Disk Defragmenter UI


1.       Analyze and defragment each volume to improve disk performance


2.       Monitor defragmentation progress and state for each volume


3.       Schedule a job for regular defragmentation


In Windows, defrag is scheduled on an entire volume. The volume can be formatted with the standard windows file systems: NTFS, FAT and FAT32. The volume can be a basic partition or any of the dynamic types: Simple, Stripped, Mirror, RAID-5. The type of disks that host a volume have an impact on automatic scheduling of defrag on the volume. Besides normal rotating hard drives, interesting types of disks in the context of defrag are: Expandable Virtual Hard Disks (VHD) and Solid State Drives (SSD). Defrag cannot be automatically scheduled on volumes hosted by SSD disks and running defrag on volumes hosted by SSD disks is not recommended.


This article explains the different parts of the defrag UI and presents in details the criteria used to determine if the disk hosting the volume is suitable for defrag.


Disk Defragmenter Main UI



This is the primary dialog (Figure 1)  that comes up when the defrag UI is started.  The UI can be started from the start menu shortcut (All Programs->Accessories->System Tools), from the control panel (Control Panel->System and Security->Administrative Tools-> Defragment Your Harddrive) or from the “Tools” tab in the volume’s properties dialog.





Figure 1



Schedule


The “Schedule” section in this dialog (figure 1) displays volumes that are scheduled for automatic defragmentation. It is recommended to have the schedule turn on. The new Windows 7 Disk Defragmenter will exclude the volumes that are not recommended to run defrag regularly . [ Note even if the system only has SSD disks and expandable VHDs, the schedule would still be turned on; to verify if the volumes are scheduled for defrag click  Configure Schedule.]



Current Status


The list shows all the volumes that can be defragmented. This includes volumes on the solid state drives. Note that volumes on SSDs and dynamic VHDs can be defragmented but are not scheduled to run regularly; this gives users the options to defrag SSD volumes if they feel the need to do so.


To analyze disk or Defragment Disk: select the volume from the list, and then click on Analyze disk or Defragment disk.



Configure Schedule


This dialog (figure 2) allows modification of the defrag schedule. Click on Select disks to see the volumes that are included in the defrag schedule.





Figure 2



Select Disks/Volumes


Select or unselect the Checkboxes to include or exclude the volumes for regular defragmentation respectively.  Selecting “Automatically defragment new disks” will automatically add new volumes to the defrag schedule





Figure 3



The screenshot below (figure 4) shows there are no volumes scheduled for defragmenter. No volumes are listed because all the volumes in the system are not suitable for regular defrag (because they could all be on SSDs or expandable VHDs). However, the user can go to the main defrag UI to defragment the volume manually.





Figure 4



What volumes are excluded from defrag schedule?



As mentioned earlier, regular defragmentation of volumes on certain disk types like SSD disks and expandable VHDs are not recommended. Defrag UI excludes volumes from being scheduled based on the following:


·         Volumes on disks whose driver reports “no seek penalty”.  [ more details … ]


·         Volumes on ATA/SATA disks that report a nominal media rotation rate of 1. [ more details …]


·         Volumes on critical disks with high very random read disc rates. [ more details …]


·         Volumes on expandable VHDs.


The high level overview of the detection algorithm as follow:


If (no_seek_penalty) {


exclude from schedule


} else if (is_expandable_VHD || is_differential _VHD) {


exclude from schedule


} else if (is_ATA_nominal_disc_rate) {


exclude from schedule


} else if (is this boot disk) && (high_random_read_rate) {


exclude from schedule


}else{


include in the schedule


}


Note that volumes on any VHD which in turn is hosted on a SSD is also excluded from defrag.



How does disk defragmenter get the “no seek penalty” from device?



Disk port driver needs to send a valid response to IOCTL_STORAGE_QUERY_PROPERTY call. Disk Defragmenter issues IOCTL_STORAGE_QUERY_PROPERTY request with QueryType = PropertyStandardQuery and PropertyId = StorageDeviceSeekPenaltyProperty.


A valid response involves populating a DEVICE_SEEK_PENALTY_DESCRIPTOR structure with accurate version and size data. If the IncursSeekPenalty member is set to false, the disk is considered a SSD.



How does disk defragmenter get the “nominal media rotation rate” from device?




If the port driver does not return valid data for StorageDeviceSeekPenaltyProperty, Disk Defragmenter looks at the result of directly querying the device through the ATA IDENTIFY DEVICE command. Defragmenter issues IOCTL_ATA_PASS_THROUGH request and checks IDENTIFY_DEVICE_DATA structure. If the NomimalMediaRotationRate is set to 1, this disk is considered a SSD.


The latest SSDs will respond to the command by setting word 217 (which is used for reporting the nominal media rotation rate to 1).  The word 217 was introduced in 2007 in the ATA8-ACS specification .


How does disk defragmenter get the “random read disc score” from the device?



Disk Defragmenter uses the Windows System Assessment Tool (WinSAT) to evaluate the performance of the device. The performance threshold was determined by some I/O heuristics through WinSAT to best distinguish SSD from rotating hard disks.


------


Post by Eva Liu

Updated Apr 10, 2019
Version 2.0
No CommentsBe the first to comment