A Tutorial On Disk Defragmentation For Windows: Raxco Software White Paper
A Tutorial On Disk Defragmentation For Windows: Raxco Software White Paper
-based operating
systems like Windows Server
.
Windows APIs
Safety is a primary concern when you are moving files around a
disk. Protection against data loss or corruption must be
absolute. Microsoft offers a special Application Program Interface
(API) that affords this protection to defragmentation software
vendors. The APIs also guarantee plug-and-play compatibility
with version changes and service packs. The vendors, through
the APIs, implement defragmentation strategies/algorithms that
determine where and when to move files or free space.
PerfectDisk uses the Microsoft developed APIs to perform its
defragmentation.
Diskeeper also uses the APIs for its defragmentation.
Free Space Consolidation
The file system is more efficient if it can find contiguous free
10 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
The file system is more efficient
if it can find contiguous free
space from which it can
allocate space to create files
contiguously.
space from which it can allocate space to create files
contiguously. Free space fragmentation causes file
fragmentation and necessitates running defragmentation
software more often.
PerfectDisks defragmentation algorithms favor consolidating all
the free space into as large a piece as possible. This approach
was taken because the Microsoft APIs under Windows offered
different levels of granularity for a file move. By consolidating
the free space, PerfectDisk can move larger files and get better
file packing. Free space consolidation also reduces the amount
of free space required to completely defragment a disk in a
single pass. The system performance benefit is that if the file
system can find consolidated free space, new files will be
created contiguously, and re-fragmentation will occur at a slower
rate. In 2008, Balder Technology Group performed an
independent study on free space consolidation (Impact of Free
Space Consolidation On Windows File System Performance).
Balder Technology Group stated that free space consolidation is
a critical aspect of disk defragmentation and is as important as
defragmentation of files for a disk defragmenter.
Diskeepers algorithms appear to favor file defragmentation over
free space consolidation in its default mode and in its Quick
Defragmentation mode. While this approach seems to provide a
slight speed advantage, it fragments the free space. Depending
on the version of the APIs in use, many of these free space
fragments are not usable by the API, so eventually Diskeeper
runs out of usable free space and the only alternative is to quit
and start over, or manually create additional free space by
removing files. This is the idea behind the multi-pass
defragmentation approach.
Alternatively, Diskeeper offers a comprehensive defragmentation
mode, which performs additional free space consolidation, but it
can only be run in the scheduled mode and it incrementally
consolidates a few clusters of free space with each run. It
appears that the slow rate of free space consolidation will never
overcome the rate of new fragmentation on the partition. In any
case, single pass free space consolidation is not available.
Single Pass Defragmentation
Many sites have a limited window of time for system
maintenance. Running a defragmenter several times to get an
acceptable result is not an option. The Microsoft APIs support
the ability to complete defragmentation of files and free space in
a single pass.
PerfectDisk defragments 99-100% of the data files on a partition
in a single pass, even in low free space conditions.
Diskeeper will defragment in a single pass provided the files or
the free space are not too fragmented, and there is ample free
11 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
space (>20%). If the files or free space are too fragmented,
Diskeeper will employ a multi-pass approach. If the file or free
space fragmentation are very severe, or the free space too
limited, Diskeeper may never completely defragment the
partition.
The time PerfectDisk requires to do a single pass
defragmentation and consolidate the free space is less than the
aggregate time Diskeeper requires to perform a similar quality
job.
Enterprise Manageability
As more organizations move the entire enterprise to Windows
2008, Windows Server 2008, or Windows Vista, the
manageability of applications across hundreds or thousands of
machines is increasingly a problem. PerfectDisk eases
manageability and offers flexibility to the system administrator
through the PerfectDisk Enterprise Console. The PerfectDisk
Enterprise Console provides full deployment, scheduling,
configuration, management, and reporting capabilities.
PerfectDisk also integrates fully with Active Directory and its
Group Policies. PerfectDisk can be deployed and launched from
within Active Directory. Through Group Policy integration, new
users to a group can automatically inherit PerfectDisk schedules,
and system administrators can toggle almost every PerfectDisk
feature at the group or user level.
Free Space Requirements
All defragmentation software requires some free space to
operate. With todays large partitions, a small percentage of free
space can be a significant amount of storage. While it is not
advisable to fill disks to capacity, defragmentation can be
performed on very full partitions. In fact, these are likely to be
the partitions that need defragmentation the most.
PerfectDisk will defragment a partition with as little as 5% free
space outside the Master File Table reserved zone (prior to XP,
defrag software could not use the MFT reserved space).
Diskeeper recommends a minimum 20% free space (outside the
reserved zone) to run. If there is less than 20%, Diskeeper
issues a message suggesting you remove files from the disk to
free up space, and then run Diskeeper again.
Optimization
Where files are located on a disk can make a difference in
performance. A Microsoft white paper addresses how
performance is affected by where the Master File Table is on a
partition. This is referenced later in this section.
PerfectDisk employs a patented disk optimization strategy that
intelligently positions files according to their usage. The strategy
suggests that if files that are not changing are defragmented
and grouped together, they do not need to be moved on
12 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
subsequent defragmentation runs. This means subsequent
defragmentation passes take less time and resources. Free space
consolidation is also part of the optimization scheme.
Diskeeper file placement is purely random and the free space is
fragmented all over the disk. The random placement means a lot
of files must be moved to defragment the files that changed
since the last defragmentation pass.
PerfectDisk defragments files, consolidates free space, and
optimizes the disk in less time than Diskeeper only defragments.
Master File Table and System Files
Under Windows, the MFT, its associated metadata files, and
certain system files need to be defragmented offline by a boot
time defragmentation. If these files are not defragmented, data
files may need to be split around them making a complete
online defragmentation impossible. With Windows XP, a boot
time defragmentation is only needed to handle the page file,
hibernate file, non-MFT metadata files, and directories on FATxx
partitions.
PerfectDisk completely defragments the MFT, all the metadata
files, and the system files. It also reports accurate status of
these files in its statistics.
Diskeeper does not defragment all the metadata files and it does
not report on their status. If metadata files are fragmented,
Diskeeper does not report it. In some cases, Diskeeper does not
completely defragment the MFT.
Scheduling
An administrator will want a wide-range of scheduling options,
as flexible as possible to meet any changing requirements. The
administrator should be able to control all scheduling options
and see all of them from a central location. The ability to quickly
access this information gives the administrator a quick response
mechanism to changing requirements and the ability to balance
resources.
PerfectDisk provides scheduling flexibility through its AutoPilot
Scheduling and StealthPatrol. AutoPilot Scheduling lets
administrators control all aspects of scheduling for the enterprise
from the PerfectDisk Enterprise Console. Schedules can be
established daily, weekly, or on particular days of the week.
StealthPatrol performs automatic, unattended background
defragmentation. PerfectDisks intelligent Screen Saver Mode
allows an administrator to determine the number of days from
the previous defrag before initiating a defrag run when the
systems screen saver is on.
Diskeeper requires that network schedules be viewed or
cancelled only from the machine on which the original schedule
was set.
An administrator will want a
wide-range of scheduling
options, as flexible as possible
to meet any changing
requirements.
13 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
Boot Time Defragmentation
As we noted above, a boot time defragmentation is required
under Windows to defragment the MFT, metadata, and system
files. Enterprise defragmentation should support the ability to
perform boot time defragmentation on remote machines from
one or more schedules.
PerfectDisk can schedule a boot time defragmentation pass on
multiple systems at the same time. Under Windows, PerfectDisk
uses the boot time option to explicitly position the MFT
according to Microsofts recommendation. On data partitions,
PerfectDisk does not require a reboot if it can get an exclusive
lock on the partition. System partitions always require a reboot.
Diskeepers boot time defragmentation can only be scheduled on
a single system at a time. Diskeeper requires a boot time
defragmentation on both system and data partitions.
NTFS and FAT Directory Consolidation
Directory defragmentation and consolidation moves these files
and their fragments out of the way so the online
defragmentation engine can do the best possible job of
defragmenting the partition and avoid splitting data files.
PerfectDisk defragments and consolidates directories on NTFS
and FAT partitions.
Diskeeper does not consolidate directories on NTFS.
Page File Defragmentation
PerfectDisk can defragment the page file regardless of the
amount of free space on the partition.
Diskeeper requires free space equal to the size of the page file.
Command Line Interface
A Command Line Interface (CLI) eases the integration of the
defragmentation process and scheduling with other system
maintenance job streams like backup.
PerfectDisk has a full-featured Command Line Interface
supporting the integration of both local and network
defragmentation commands in your own scripts. PerfectDisk can
run the CLI and the GUI at the same time.
Diskeeper provides a limited CLI with only local defragmentation
support. If you are running the Diskeeper CLI, you cannot run
the GUI, and vice versa.
Exchange Data Store Defragmentation
Microsoft recommends the periodic offline compaction/
defragmentation of Exchange data stores. This activity improves
Exchange performance by re-indexing the data stores and
A Command Line Interface
(CLI) eases the integration of
the defragmentation process
and scheduling with other
system maintenance job
streams like backup.
14 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
reclaiming disk space. Exchange defragmentation is generally a
manual, time-consuming, and cumbersome task.
PerfectDisk has an additional module that automates the offline
compaction/defragmentation of Exchange data stores on
Exchange 2007, Exchange 2003, Exchange 2000, and Exchange
5.5.
Diskeeper has no Exchange compaction/defragmentation
support.
Very Large, Very Fragmented Partitions
Defragmenting very large, very fragmented partitions is a
special problem and one particularly related to enterprise
configurations. The primary issue is performing the task with a
minimal impact on resources and within an acceptable
timeframe. The number of files, number of fragments, and the
amount of free space can all impact the time it takes to
defragment a large partition.
While defragmenting large partitions is a challenge,
defragmenting large files also poses a challenge. With an
increase in multi-media presentations, animation, and the
built-in digital video editing capabilities in Windows XP, files over
1GB will not be uncommon. The viewing of digital video or
multi-media presentations can be adversely affected if
fragmentation interrupts the streaming of the file to the
processor.
PerfectDisk has been specifically designed to efficiently
defragment partitions of up to several terabytes. The design
delivers quick file movement, low memory footprint, and less
CPU usage than other products. While single pass
defragmentation is still the preferred approach, some sites may
have specific situations where a large partition cannot be
defragmented in the time allotted. PerfectDisk provides better
stop/restart capability that lets defragmentation benefits accrue,
even when the defragmentation task is interrupted.
During the development of PerfectDisk, we ran a stress test on
an IDE controlled 300GB partition with 1,000,000 files,
4,500,000 fragments, and 12% available free space. The
machine had a 1 Ghz processor with 512MB of RAM. The disk
had no MFT or system file fragmentation. This is not your
average partition. PerfectDisk defragmented this partition in 42
hours elapsed time and used 4 hours of CPU.
Our only experience with Diskeeper was on this same partition.
Diskeeper defragmented the partition in 107 hours elapsed and
used 52 hours of CPU. The Microsoft newsgroups are a good
alternative source of information for other user experiences with
large, fragmented environments.
Defragmenting very large, very
fragmented partitions is a
special problem and one
particularly related to
enterprise RAID
configurations...PerfectDisk
has been specifically designed
to efficiently defragment
partitions up to serveral
terabytes.
15 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
Windows XP, Vista and the MFT
With Windows XP, Microsoft documented a finding that states
that locating the Master File Table approximately one-third of the
way down a volume delivers a 5-10% performance increase.
Only PerfectDisk explicitly positions the MFT in this location on
Windows platforms.
Evaluating Defragmentation Software
The best way to determine which defragmentation solution is the
best for your environment is to evaluate them on your systems.
The first thing you need to do is ensure that you run both
products against exactly the same disk. To do this, you will need
a disk-imaging tool like Nortons Ghost
or Symantecs Drive
Image. These tools ensure that you have at least two disks that
are sector-by-sector copies.
Install the defragmentation software you want to evaluate. Run
the Analysis phase of one of the products against the disk you
want to defragment and note the total number of files and the
number of fragmented files. Identify the Most Fragmented Files
and note how badly fragmented are the worst files. Also note
the condition of the free space on the disk. Is it fragmented or
contiguous? Disk defragmentation software is only as good as
your worst disk. Choose a disk that has badly fragmented files
and/or limited free space. You want to make sure the product
you select can defragment just about anything.
Once you understand how bad the problem is on your target
disk, run one of the defragmentation products and time it to
completion. Vendors make suggestions on the running order of
the boot time and online defragmentation. Follow the suggestion
of the product vendor. Run the second product on the cloned
disk and do the same. When the products are finished, review
the reported statistics by looking at the same information you
evaluated before the defragmentation. Things you will want to
look for are:
Did the boot time defragmentation completely defragment the
MFT, metadata, and system files?
Did the online defragmentation completely defragment the data
files?
Is the free space fragmented or consolidated?
Was the time to complete acceptable?
An interesting exercise to validate your results is to cross check
the statistics with both products. For example: if you defragment
a disk with product A, view the results with both product A and
product B interfaces. There may be some disparity in file counts
16 Tutorial on Disk Defragmentation Copyright 2009 Raxco Software, Inc.
All Rights Reserved
The right product is the one
that reliably and consistently
delivers the best results under
the worst conditions.
due to how each vendor counts directories and subdirectories,
but between the two sets of statistics you will get a very good
idea of the quality of the job done.
Summary
While enterprise disk defragmentation sounds relatively simple,
it is clear that ones choice of technology can have a profound
impact on user productivity and system performance, as well as
ongoing system administration and support costs. The right
product is the one that reliably and consistently delivers the best
results under the worst conditions. Proactive defragmentation
protects the users investment in the platform, lowers the total
cost of ownership, and delivers customer satisfaction.
PerfectDisk, StealthPatrol, and AutoPilot Scheduling are
trademarks or registered trademarks of Raxco Software, Inc.
Diskeeper is a trademark or registered trademark of Diskeeper
Corporation. Microsoft, Windows, NT, Vista and XP are
trademarks or registered trademarks of Microsoft Corporation.
All other trademarks or trade names are the property of their
respective owners.