System Tuneups: Defragmentation

Remember when you first purchased your PC?  The smell, the looks - and the speed.  However, over time you've probably noticed that it's not running like it used to.  It's slow, and costs you both time and money.

This article is the first in a series to help you get your system working like it used to.

Filesystems: FAT (File Allocation Table)

The intrinsics of filesystems are usually lost on most people.  However, to better understand why some computers run slower than others, it's best to know a bit about them.

Microsoft Windows environments aimed for the desktop market (typically home users) are usually always installed with what's known as the FAT filesystem.  In variants of FAT16 and FAT32, this filesystem holds the data that you store on your hard disk, and describes how it's stored, usually in blocks of 4 Kbyte or 8 Kbyte clusters.

For most of us, it stores our files, and more often than not, we are able to retrieve what we need.  However, picture this:  You have a file that is 1 Kbyte in size.  To you, it's taking up 1 Kbyte.  That's understandable - but physically on your hard disk, it's actually taking up 4 Kbytes due to the clustering metioned earlier.  Larger drives are formatted with larger clusters, so this 1 Kbyte file could actually take up 8 Kbytes or even 16 Kbytes in some cases.  That's a lot of wasted space!

Ouch!  Doesn't that mean I'm wasting valuable space?

There is in fact a lot of wasted space on hard disks.  Windows combats this by filling up these clusters with new files you create; this means that each of these clusters is actually filled up consecutively  as Windows writes over the disk.

However, picture this example:

 
 
 
 

Example 1: A Disk Cluster

Example 1 represents on cluster on a typical hard disk.  As mentioned earlier, this cluster is 4 Kbytes, where each row is 1 Kybte.  The hard disk writes from top to bottom.

We create a new file as earlier, which is 1 Kbyte.  We also created another file, which is 2 Kbytes.  On the hard disk, this is stored (and represented) as follows:

File #1
File #2
File #2
 

Example 2: Files inside a Disk Cluster

From Example 2, you can see that File #1 is taking up 1 Kbyte of space (one row), whilst File #2 is taking up 2 Kbytes of space (two rows).  As the hard disk reads top to bottom in our example, the speed of the hard disk is not penalized in any fashion.

What happens if our File #1 has further data added to it (we added a glossary to a document perhaps) and is now 2 Kbytes.  How does it get stored on the disk?  Storage devices cannot simply just shift the data down to accommodate the extra Kbyte of space required.  Example 3 shows what occurs when this happens:

File #1
File #2
File #2
File #1

Example 3: Files inside a Disk Cluster

Picture an example where the hard disk needs to open both File #1 and File #2.  As the hard disk reads top to bottom, it reads the first half of File #1 (1 Kbyte), then skips 2 Kbytes to read the other half of File #1.  Once that's done, it then needs to go back to the 2nd Kbyte to read the entirety of File #2.

This becomes a problem because each time the hard drive reads "top to bottom", it needs to move the drive arm back and forth to accommodate the read.  Take our example, and multiply that by the thousands of files on your hard disk, and retrieve all the files required.  This both slows down execution of applications and retrieval of data, and also places a lot of stress on the hard drive components.

There must be a solution?

There is a way you can remedy this, and you've probably even seen it before.  It's called a Disk Defragmenter, and for computers installed with Windows 3.1 or better, it's actually a standard feature.

A disk defragmenter takes disk fragments, and re-structures them in order to optimize both hard disk performance and load times.  This means taking Example #3, and physically moving files out of the way in order to streamline other files.  After a full defragmentation, on disk our files would instead appear thus:
 

File #1
File #1
File #2
File #2

Example 4: A Defragmented Cluster

Now instead of having to reverse itself to read two files, our hard disk instead needs to make one sweep to read both files.  Instead of requiring extra effort to retrieve the 2nd file, the hard drive can instead go onto its next task of retrieving the next set of files required.

Great!  How do I defragment?

Click on your Start button, and then click on the Run button.  Inside the box that appears, simply type: defrag

A new program will appear, asking you which drive you would like to defrag.  Scroll down to the end of the menu which mentions "All hard drives", and then click OK.  Windows will then commence defragmenting your hard disk.  You can view the progress of the defragmentation by clicking on "Show details", which will show graphically how your files are mapped out on your disk.

How often should I defragment, and can I speed up the process?

Defragmenting is easy, and should be performed on a regular basis.  If you regularly install/uninstall software or perform a lot of work on your disk, set a schedule whereby you defragment every 2-3 weeks.  If you are a light user, set a schedule of 5-6 weeks.

For older machines or heavily fragmented machines, defragmentation will take quite a bit of time.  There is a way to speed this up however in the form of Symantec's Norton's Utilities, a third party program created by the makers of Norton's Antivirus.

Inside these utilities is a program known as Speed Disk, which achieves disk defragmentation in a method different to Microsoft's implementation.  This results in roughly about a 20-40$ speed increase in the process.

Norton Utilities is available as part of Norton Systemworks Professional ($159.95), or separately for $79.95.

Please contact us on (02) 9870 7777 if you'd like to find out more.

Print Friendly Version

Ensuring that your system doesn't have any old programs (or a lot of programs running on startup) will speed up your computer.

When running a Defrag on your computer, it usually takes a while, so start it before you go to bed, and depending on the speed of your computer, it should be finished by the time you wake up.

Also make sure that you shut down all programs you are running before starting your Defragmentation.

If a file is in use, it can't be defragged properly.


© Coral Computers Pty Ltd
ABN 43 085 334 210