2.3 Defragmenting Disks
Any time you add files
to or remove files from a drive, the data on the drive can become
fragmented. When a drive is fragmented, large files can’t be written to
a single continuous area on the disk. As a result, the operating system
must write the file to several smaller areas on the disk, which means
more time is required to read the file from the disk. To reduce
fragmentation, Windows 8 automatically defragments disks as part of
automated maintenance. As with error checking, the process of calling
and managing disk optimization is handled by a separate task. In Task
Scheduler, you’ll find the Scheduled Defrag task in the scheduler
library under Microsoft\Windows\Defrag, and you can get detailed run
details by reviewing the information provided on the task’s History tab.
Automatic analysis and optimization of disks can occur while the
disks are online, so long as the computer is on AC power and the
operating system is running but otherwise idle. By default, disk
optimization is a weekly task rather than a daily task–and there’s a
good reason for this. Normally, you need to optimize your computer’s
disks only periodically, and optimization once a week should be
sufficient in most cases. Note, however, that although non-system disks
can be rapidly analyzed and optimized, it can take significantly longer
to optimize system disks
online. As a result, very large system volumes may not get fully
analyzed and optimized on some computers, especially if the computer is
powered off during schedule maintenance and then actively used while
plugged into AC power.
You can manually defragment a disk by following these steps:
-
In Computer Management, select the Storage node and then the Disk
Management node. Press and hold or right-click a drive, and then tap or
click Properties.
-
On the Tools tab, tap or click Optimize. In the Optimize Drives
dialog box, tap or click the drive you want to check, and then tap or
click Analyze. Optimize Drives analyzes the disk to determine whether
the disk needs to be defragmented. If so, it recommends that you
optimize the drive.
-
The Current Status column shows the status of each drive and the
percentage of fragmentation when last checked. You can optimize a drive
by tapping or clicking it and then tapping or clicking Optimize.
Note
Depending on the size of the disk, defragmentation can take several
hours. You can tap or click Stop at any time to stop defragmentation.
Although you previously could set a specific run day and time,
Windows now handles the run schedule as part of automated maintenance.
By default, analysis (and optimization if necessary) occur
approximately once a week, and you can control the approximate start
time by changing the automated maintenance start time. Windows also
will notify you if three consecutive runs are missed. All internal
drives and certain external drives are optimized automatically as part
of the regular schedule, as are new drives that you connect to the
computer.
You can configure and manage automated defragmentation by following these steps:
-
In Computer Management, select the Storage node and then the Disk
Management node. Press and hold or right-click a drive, and then tap or
click Properties.
-
On the Tools tab, tap or click Optimize. This displays the Optimize Drives dialog box, shown in Figure 2.
-
If you want to change how optimization works, tap or click Change Settings. This displays the dialog box shown in Figure 3. To cancel automated defragmentation, clear Run On A Schedule. To enable automated defragmentation, select Run On A Schedule.
-
The default run frequency is set as shown. In the Frequency list,
you can choose Daily, Weekly, or Monthly as the run schedule. If you
don’t want to be notified about missed runs, clear the Notify Me check
box.
-
If you want to manage which disks
are defragmented, tap or click Choose and then select the volumes to
defragment. By default, all disks installed within or connected to the
computer are defragmented, and any new disks are defragmented
automatically as well. Select the check boxes for disks that should be
defragmented automatically and clear the check boxes for disks that
should not be defragmented automatically. Tap or click OK to save your
settings.
-
Tap or click OK, and then tap or click Close.
Note
Windows automatically performs cyclic pickup defragmentation. With
this feature, when a scheduled defragmentation pass is stopped and
rerun, the computer automatically picks up the next unfinished volume
in line to be defragmented.
2.4 Resynchronizing and Repairing a Mirrored Set
Windows 8 automatically synchronizes mirrored volumes on drives. However, data on mirrored
drives can become out of sync. For example, if one of the drives goes
offline, data is written only to the drive that’s online.
You can resynchronize and repair mirrored sets, but you must rebuild
the set using disks with the same partition style—either MBR or GPT.
You need to get both drives in the mirrored set online. Because a disk
in the set has failed, the mirrored set’s status should read Failed
Redundancy. The corrective action you take depends on the failed
volume’s status:
-
If the status is Missing or Offline, make sure that the drive has
power and is connected properly. Then start Disk Management, press and
hold or right-click the failed volume, and then tap or click Reactivate
Volume. The drive status should change to Regenerating and then to
Healthy. If the volume doesn’t return to Healthy status, press and hold
or right-click the volume, and then tap or click Resynchronize Mirror.
-
If the status is Online (Errors), press and hold or right-click the
failed volume, and then tap or click Reactivate Volume. The drive
status should change to Regenerating and then to Healthy. If the volume
doesn’t return to Healthy status, press and hold or right-click the
volume, and then tap or click Resynchronize Mirror.
-
If one of the drives shows a status of Unreadable, you might need to
rescan the drives on the system by choosing Rescan Disks from Disk
Management’s Action menu. If the drive status doesn’t change, you might
need to reboot the computer.
-
If one of the drives still won’t come back online, press and hold or
right-click the failed volume, and then tap or click Remove Mirror.
Next, press and hold or right-click the remaining volume in the
original mirror, and then tap or click Add Mirror. You now need to
mirror the volume on an unallocated area of a different drive. If you
don’t have unallocated space on another drive, you need to create space
by deleting other volumes or replacing the failed drive.
2.5 Repairing a Mirrored System Volume to Enable Boot
The failure of a mirrored drive might prevent your system from
booting. Typically, this happens when you’re mirroring the system or
boot volume, or both, and the primary mirror drive has failed.
When you mirror a system volume, the operating system should add an
entry to the system’s boot manager that allows you to boot to the
secondary mirror. Resolving a primary mirror failure is much easier
with this entry in the boot manager file than without it because all
you need to do is select the entry to boot to the secondary mirror. If
you mirror the boot volume and a secondary mirror entry is not created
for you (as verified when you enter bcdedit
at an elevated command prompt), you can modify the boot entries in the
boot manager to create one using the BCD Editor (Bcdedit.exe).
If a system fails to boot to the primary system
volume, restart the system and select the Boot Mirror – Secondary Plex
option for the operating system you want to start. The system should
start normally. After you successfully boot the system to the secondary
drive, you can schedule the maintenance necessary to rebuild the mirror
if you want to. You’ll need to follow these steps:
-
Shut down the system, replace the failed volume or add a hard disk drive, and then restart the system.
-
Break the mirror set, and then re-create the mirror on the drive you
replaced, which is usually Drive 0. Press and hold or right-click the
remaining volume that was part of the original mirror, and then tap or
click Add Mirror. This displays the Add Mirror dialog box.
-
In the Disks list, select a location for the mirror, and then tap or
click Add Mirror. Windows 8 begins the mirror creation process. In Disk
Management, you’ll see a status of Resynching on both volumes. The disk
on which the mirrored volume is being created has a warning icon.
-
If you want the primary mirror to be on the drive that you added or
replaced (the original system volume), use Disk Management to break the
mirror again. Make sure that the primary drive in the original mirror
set has the drive letter that was previously assigned to the complete
mirror. If it doesn’t, assign the appropriate drive letter.
-
Press and hold or right-click the drive that you added or replaced, and then tap or click Add Mirror. Now re-create the mirror.
-
Check the boot configuration and be sure that the drive
that you added or replaced is used during startup. You may need to
modify the boot configuration to ensure this.