TweakHomePC

Dual-booting all versions of Windows and Linux

   Dual-Boot    |    Win 8    |    Win 7    |    Vista    |    Win XP/2K/NT    |    Win9x/Me    |    How to    |    Legacy 9x Tweaks    |    SiteMap   


 

Here: Home > Legacy 9x Tweaks > Hard Disk Tweaks Center >


DEFRAGMENTATION


Fragmentation occurs in all Hard Disks.

When you use a program some files are moved into memory and may be altered while there. When finished, the files are sent back to the hard disk.

Now some may not fit as previously, are split up, and stored further away on different parts of the disk - they are fragmented.

In the future, accessing all these pieces from different areas of the disk will be a little slower, and then slower, and then ...

Defragmenting these data files puts them all back into neat sequential order, and they can be accessed faster. In addition, Win 98+ will place your most frequently accessed programs on the fastest parts of the disk.

Defragment often and fully for faster retrieval of hard disk data.


FRAGMENTATION Explained

The hard disk, primarily for storage, is very many times slower than memory. Accessing files that are fragmented slows it even further. Initially a program's files are stored on the hard disk in neat contiguous areas (in a string of adjoining clusters). The disk head needs very little movement to locate the files of a program - all are close together, and little time is wasted.

A program is called and loaded into memory. When finish, some files will go back into their original clusters on the disk. Others have changed, and will no longer fit as previously; they are sent to unused clusters on further-away parts of the disk; those files are now fragmented.

Removing data files from the hard disk is a constant occurrence in the home situation. This leaves lots of empty spaces on the hard drive. Also when Windows itself saves new data, it fills in these empty spaces, often splitting up files and thus increasing the amount of time it takes to access those files. The fragmentation process continues every time you use your PC, leading to parts of a program's files being spread all over the hard disk. The disk head takes time locating each of these parts with a resulting slowing of the system.

Defragmenting puts all the file parts back into neat consecutive order and hence decreases the time taken in locating them. Unfortunately fragmentation starts again immediately, so regular attention is necessary. Defragmenting is important, and especially so in low memory computers.

Fragmentation of, lets say, 3% may seem quite small and immaterial. However this is 3% of perhaps gigabytes. Also it is highly likely that most fragmentation has occurred in those very files you use most frequently!

DISK DEFRAGMENTATION    All users

• A severely fragmented hard disk can dramatically slow a system by up to 25%
• Fragmentation may cause data to be corrupted or lost

Dramatically improve performance by keeping the hard disk in good condition. Defragment using Disk Defragmenter; use it monthly, and use the Full option (Win95).

Disk Defragmenter ('Defrag') is the defragmentation utility installed with the default installation of Windows 95 and 98. When to use it depends on your type, and extent, of PC usage, and also on the hard disk or partition size.

For optimal usage, Defrag when about 5% fragmented. Once a month seems about right for the Home PC user, though many need to do so weekly. Run it minimized.

Its best to quit all programs. Before you start Defrag, first empty Recycle Bin. Then delete your browser's Temporary Files and History. Empty all unrequired mail from your E-Mail folders. Then delete .tmp and .bak files and any unneeded files and directories in \Temp and \Windows\Temp directories. Delete any trash.

You should disable the Screen Saver (or at least click on the Start menu, and leave it open while Defragging) and any other automated software you may have running - for best performance you should not be running them anyway, except that anti-viral software perhaps!

Disk Defragmenter is in: Start • Programs • Accessories • System Tools

[top of page]

WIN98+ and DEFRAG      All users

Win 98 Disk Defragmenter utility is considerably improved in Win98, 98SE and Me.

It records the order of accessed files as you work, and then reorganizes (when Defragging) these files on the hard disk to best suit Windows accessing them.

It also places the most frequently accessed programs on the fastest parts of the disk.

Disk Defragmenter uses TaskMon to monitor your application use so your most frequently launched programs are optimized the most (TaskMon's log files are hidden in \Windows\Applog).

Obviously the most recently used items can be given priority, so avoid Defragging soon after opening once-use programs. Defrag after you have been using your most regularly used and important programs and you will feel a difference in loading times in future. [Tip:

The end result is a noticeable speed boost for your regularly run programs - this will show only after some usage - it needs time to 'learn'.

A considerable drawback (if using the new FAT32 file system) is a substantial slowing of the Defrag process - this will may be a headache with large partitions.

Continue to defragment fully and often for best performance.
But first Click on the "Settings" button and check the "Reorganize program files so my programs start faster" box. Also check "Every time I defragment my hard drive".

[top of page]

ADVANCED WIN98+ and DEFRAG      Advanced users

Win 98 Win98 advanced Defragmentation tips

Remember Win98's Defrag may consider up to 50 programs, optimize only a few, and give most attention to the most frequently used ones. However it records usage over a period and gradually alters its priorities according to that usage. Therefore it could take months before your own latest priority kicks in.

1. If you stop using one of your favourate programs, you may want to go into \Windows\Applog and delete the entry for that program. If it is not present in the log then Defrag can not include it in its priorities. Look for xxxxx.lgZ where xxxxx is the program file name and Z is the drive letter. Careful manipulation of files in the Applog directory can pay dividends. The file Applog.ind tracks how many times a program has run.

2. Speed still depends on how far the disk head has to travel and on very large disks this can be considerable. If/when purchasing a new drive consider two smaller drives (2x12GB) instead of one large drive (24GB) and spread your programs across both. This will reduce head movements on both smaller disks. Obviously creating extra partitions, helpful in other ways, does not reduce disk head movements.

3. Use X_Setup to control optimization: [a] number of programs optimized (default: 50), [b] avoid optimizing old programs (default: 90+ days old), [c] files never optimized (default is SYSTEM.DAT\USER.DAT\SYSTEM.INI\WIN.INI) - or use "\(filename)" to add yours in the Reg.

[top of page]

MEDEFRAG UTILITY      All 98/98SE/95 users

Speedup Defragmentation with the Windows Me Defrag Utility

Win Me's Defragmentation utility is noticably faster than the previous versions that came with Win 98 and Win 95. Many users have successfully used Win Me's Defrag with Win 98 and some with Win95.

The results may vary between different computers and you use this utility at your own risk. However, all should be well and your defragging should take substantially less time.

The download below contains Me's Defrag.exe, plus installation instructions.

To download the Windows Me Defrag utility, click medefrag.zip (freeware, 98 KB).

[top of page]

CRACKUP UTILITY      All users

Show the percentage of fragmentation with Crackup

When you use Defragmenter in Win98 you are working 'blind'. You have no idea how much the drive(s) is fragmented!

Crackup is a very useful free utility from PC Magazine that provides this important information.

As always suggested by THPC, use the utility only when you need to do a check on the current state of fragmentation i.e. do not enable "Enable background scanning" under the Configuration tab. In "Drives to check" you can, if you prefer, select only the drives you use most frequently.

This utility is excellent for determining how often your hard disks need to be defragmented.

It works with local hard drives formatted with either the FAT16 or FAT32 file systems. You can uninstall Crackup by simply deleting its files and folder - the Registry is not involved.

" CrackUp accurately calculates disk fragmentation percents, and reports the fragmentation of all local hard drives in a single window. It can run in the background to check fragmentation at intervals, and warn if any drive exceeds the specified fragmentation level. A detail report provides raw fragmentation data in text or CSV format ".

Get it Crackup, freeware, 203KB.

[top of page]

VIRTUAL MEMORY & DEFRAG    All users

Its better to keep VM in one place on the hard disk

Keeping Virtual Memory 'intact' will enhance performance and also gain a little more free space.

The following applies ONLY to when the hard disk containing VM is to be Defragged.

First do your cleanup for that hard disk (see above)
1. Boot to Safe Mode


    (press the CTRL or F8 key during bootup, and select Safe Mode from the Startup Menu).
1. Right-click My Computer
2. Select Properties > Performance tab > Virtual Memory
3. Check Let me specify my own virtual memory settings
4. Check Disable virtual memory. (Not recommended)
5. Click OK, and ignore any Windows warning
6. Reboot back to Safe Mode

7. You can now run Defrag

8. Then return and uncheck Disable virtual memory. (Not recommended)
9. and re-enter your own VM settings (read Virtual Memory in this Section)
10.Reboot

Your SwapFile should now be on one continuous area of the disk.

[top of page]

NOTES ON FRAGMENTATION

Points to keep in mind:

• When using Defrag, and Scandisk, you can first switch off your screen saver and other scheduled events. They can interfere with it and slow it down. It only takes a moment to switch them on again when finished.

• Don't waste time defragging rubbish! First remove that software you forgot to uninstall. Then empty that Recycle Bin, delete appropriate Temp & Tmp files, delete unwanted e-mails (and Compact/Compress the Mail Folders), and empty the browser cache. You can even compress the Registry (use RegClean & RegCleaner). Basically remove any files you do not need.

• Defragmentation causes intensive disk activity leading some users to worry about wearing out the drive. In the long term it actually saves on disk activity and extends the life of the drive. It IS possible that a defragmentation may be the final straw for a very old drive that was on its way out anyway - nothing lasts forever; just be wary of old drives.

• Avoid using a defragmentation program that does not recognize long filenames. You may destroy the long filename space. You may also corrupt the drive's data, especially on volumes that are 1GB to 2GB in size. Known to be safe are Microsoft's Defragmenter, Norton's Speed Disk, and Nuts & Bolts.

• If you choose to use a third party defragmentation program, then be absolutely sure it is recommended for your version of Windows (and it is 'aware' of long filenames).

[top of page]

HARD DISKS Explained

How data is storage:

Visualize this:  Take a huge circular tray and let it represent a hard disk. It is totally empty, but has potential. Let the tray's size represents the hard disk capacity.

When the HD (the tray) is FDISKed and FORMATed it is divided into a large number of distinct storage areas each of exactly the same size - so now fill the tray with one layer of equally-sized white table tennis balls. These represent the Clusters you hear about, and each is capable of storing a file or part of one file, but not parts of different files. The actual size of the white balls is dependent on the capacity (more later).

Also created is the FAT (File Allocation Table) which the system needs to keep track of where everything will be stored - so replace the center ball with a red ball representing the FAT (it will never be used for anything else).

The Operating System and software are now installed - the white balls from the center are filled (turn yellow) and the FAT (red ball) is updated to keep track of what is going where. If a file is too large to fit in one unused Cluster (white ball), it fills them consecutively (including part of one which will remain partially empty - yellow).

[top of page]

PARTITIONS

When FORMATing a hard disk we can divide the physical disk into two or more Partitions which the system will recognize as distinctly different drives just as if they were different physical hard disks. This is essential with large hard disks especially as Win95 and DOS only recognizes partitions up to 2GB in size.

So take a few pieces of cardboard and divide the tray radially into differently sized sections. You still have a single physical hard drive (the tray) but Windows recognizes it as a number of different drives (which can have different Cluster sizes). Instead of having just C: you might now have C: D: E: F: G: ...

A partitioned disk has distinct advantages: shorter defragmentation time, faster gaming, cleaner re-installs, support for multiple OSs, and (if using FAT16) greater space through more efficient data storage.

Home users with a large disk should aim to have access to at least six Partitions for:
1. Windows (1 - 1.5GB)
2. Programs
3. Virtual Memory and Caches (300 - 600KB)
4. Games
5. Storage of data, backups, updates, downloads, etc
6. and probably - an image of Windows, 600KB.

[top of page]

CLUSTERS

A Partition is always divided into a large number of equally sized Clusters. Each Cluster can store one file or part of one file, but not parts of more than one file. The hard disk will have many unfilled areas (partially filled Clusters) that can not be used. The wastage is called Slack.

Clusters under FAT16:
Under the FAT16 system the size of each Cluster is totally controlled by the size of Partition selected - the size of the balls can be smaller but only if the space (Partition) is smaller. The resulting Cluster sizes can be 32KB, 16KB, 8KB, 4KB, or 2KB in size (see next).

Larger Clusters will, on average, have more Slack than smaller ones. Smaller Cluster are more efficient for storage. This is especially true if the hard disk has a large number of small files. For example, a 1KB file will be allocated all of a 32KB Cluster under FAT16. The empty portion (31KB) will remain unused.

Clusters under FAT32:
The above restriction is removed under FAT32 (only in Windows 95OSR2.5 and Windows 98, SE, Me). Slack still occurs but it is substantially less than under FAT 16.

For example, a Partition of up to 8GB can now use 4KB Clusters and gain about 250MB+.

FAT (File Allocation Table): Windows needs to keep track of everything on the hard disk and uses a 'contents table' for this, the FAT.

[top of page]

FAT16 & FAT32

EFFICIENCY OF FAT16 & FAT32 [File Allocation Table]

FAT 16 Partitions of

 16 - 127 MB use 2K Clusters [98% storage efficiency]
128 - 255 MB use 4K [ 96% ]
255 - 511 MB use 8K [ 93% ]
511 - 1023 MB use 16K [ 86% ]
1024 - 2047 MB use 32K [ 74% ]
2048 -      MB use 64K [ 57% ]
 
FAT 32 Partitions of
> 511 MB use 4K Clusters [96% storage efficiency]
> 8 GB use 8K [ 93% ]
> 60 GB use 16K [ 86% ]
> 2 TB use 32K [ 74% ]

When a file is written to disk, information is stored for future referrence. The file usually occupies very many Clusters. The entries include file name, size, attributes, the storage locations of all the different clusters belonging that file, and their correct order. When a file is requested, the OS first reads the entries to discover which clusters are required, where each of those cluster are stored, and the correct order in which those clusters must be collected (FAT). Now the original file can be recreated exactly. Due to fragmentation those clusters may be all over the place!

[top of page]

Please remember that you alone are responsible for the consequences of any changes you make to your computer hardware or software.

Copyright © LarryM 1998-2015 thpc@mail.com