4

The LA Fox Developer Newsletter
January 1997
Disk Fragmentation (Con’t from page 3)
Defragmenters have been available for FAT volumes for years,
and one is included with Windows 95. When Windows NT was
first released, there were no defragmenters available. Microsoft
originally claimed that fragmentation was not a serious problem
under NT, particularly on NTFS volumes. Unfortunately, this is
not true. From my experience, fragmentation can actually be a
much worse problem on a computer running Windows NT than
on one running Windows 95 or DOS. Microsoft has finally
admitted the problem, and built ‘hooks’ into NT 4.0 to make it
easier to defragment disks, even when files are in use.

The primary reason why fragmentation is particularly severe
under NT is that, unlike previous versions of Windows, it does
not allow directories to be moved at all. In addition, if the
volume is formatted as NTFS, the operating system reserves
one or more large areas on the disk for the Master File Table,
which also cannot be moved. As a result, it is impossible for a
defragmenterto move all files and directories to the beginning of
the volume to consolidate the free space. At a minimum, the
possible free space areas on a FAT or NTFS volume on an NT
machine will be permanently divided into nearly as many
fragments as you have directories on the volume.

How bad is the problem? Two recent experiences with my NT
Server laptop with a 1.3 gig drive should illustrate. In order to do
a client/server demo, I copied a VFP database and tables
occupying 120 Mb to the laptop. I then ran the VFP upsizing
wizard to create a 200Mb SQL Server database containina the
same data. Performance was very slow, which I attributed to
overloading the 100 MHz processor. Later, I ran a defragger and
discovered that the largest VFP table (70 megs) and the SQL
Server database were in over 200 fragments each. After
defragging, performance nearly thpled.

Later I deleted those databases and installed some new pro-
grams. Then I copied an updated version of the DBF files to the
laptop. I ran a disk analysis, whose partial results were:


The largest DBF file (80 megs) was in an incredible 10,087
fragments. A second 20 meg table was in 2,454 fragments.
Imagine what the performance would be doing a SQL SELECT
on those tables!

Another potential performance problem is a fragmented swap
file. If you expand the size of the swap file on a heavily used
volume, it may become fragmented. I found a swap file on one
client’s server in 700 fragments. Since swap files cannot be
moved either, the best solution is to move the swap file to a
different drive temporarily, defragment the drive it was on, then
recreate it on this drive.

At press time (January 1997) there are 2 defragmenters avail-
able for Windows NT. Diskeeper from Executive Software, has
been out for 2 years. The workstation version lists for $125
(street price lower). The $399 server version can remotely
defrag all NT workstations connected to the network, as long as
they have a copy of the workstation product installed. Both
versions can be scheduled to run at off times, or will run con-
tinuously in background and yield processor to foreground
applications.

Diskeeper also offers a free “lite” version, available for down-
loading at www.execsoft.com. It is a fully-functioning
defragmenter, but lacks the scheduling features of the worksta-
tion and server versions.

Symantec also has a free beta version of the Norton Speed Disk
for NT available at www.symantec.com. The beta version will
not work after 2/15/97, by which time the full product should be
available for purchase (pricing is not yet available).

These products perform essentially the same functions, and do
a good job of keeping you entertained with graphical fragmenta-
tion displays. Assuming there is sufficient free space available,
they will completely defragment most files. In some cases it
may be impossible to completely defrag afew large files
because there are no contiguous free spaces large enough to
hold the entire file. In addition, these defraggers will relocate
numerous smaller files to fill in the small gaps between directo-
ries completely, thus minimizing the number of small free space
fragments and leaving larger blocks of free space elsewhere.
They will defrag both FAT and NTFS volumes.

Rather than doing a performance and feature comparison here, I
recommend you download and install both of these products,
and see which you like better. While you are at it, be sure to
peruse the excellent documentation available on the
www.execsoft.com site, which provides a good description of the
way data is stored by NT and of how defragmenting programs
deal with some of the limitations described earlier.

fEd. Note: Jim Slater is the Executive VP of the Rocky Moun-
tain Fox Users Group in Denver. He has been developing in
dBase and Foxpro for 12 years, was a beta tester for VFP 3.0
and 5.0, and is a Microsoft MVP. Jim can be reached on CIS at
76367,1735 or on the Internet atSlaterJ@ix.netcom.com.J

Did You Know? If you’re planning a trip to Myanmar(whereve
that is) leave the modem at home - as well as the fax machine,
ISDN adapter, and any thoughts of starting up a network. The
military government prohibits the ownership, use, import, or
borrowing of any devices or technology it deems harmful to
state security, national unity, yada-yada-yada. Anyone who
runs afoul of the Computer Science Development Law risks up
to 15 years in prison.
Page 4

4