| Home > About PCs > Maintenance > Defrag |
Fragmentation is a phenomenon that gradually increases on your hard disk as a normal part of file operations. Any PC disk is divided up into little discrete units called "clusters." Any given cluster always either belongs to a particular file, or is marked as available. One file may be stored on dozens or hundreds of clusters. Every time a file gets added, deleted or modified, there's an increasing tendency for various parts of the file to get stored in different places on the disk.
Your computer's file system can cope with fragmentation on a day-to-day basis. It keeps track of where everything is, and when you retrieve a file, it just jumps around and gathers up all the parts. When the disk is fragmented it takes a little longer to retrieve a file than it would if the file were stored contiguously, that is, in one continuous stream of clusters, all physically located together on the disk.
Modern applications use a lot of disk files besides the ones you see; program and DLL files, configuration files, temporary work files etc. The performance hit adds up, and the longer you let it slide, the worse it gets. I once defragmented a PC that had probably been used for two to four years without being defragmented. Defrag took about two hours to finish, and afterward the machine appeared to be about twice as fast at launching programs and loading and saving files.
Linux and other Unix flavors usually don't require defragmentation as a periodic maintenance procedure, if there is a reasonable amount of free disk space, because they minimize fragmentation during normal file operations. This will also tend to be true of other advanced file systems to some extent.
Windows 95 and later has a program called Disk Defragmenter. It's normally in the Start menus under Programs, Accessories, System Tools. All you have to do is run Disk Defragmenter about once every three to six months. If you do it about that often, generally it will only take a few minutes, and your file operations will stay at peak efficiency. More often than once a month is probably not a good idea; there is after all a certain amount of wear and tear inherent in running the defragmenter.
It'd be a good idea to make a backup, and then run Scandisk, before running your defragmenter program. It's probably also safest to have nothing else running on your PC while Defragmenter is running.
If you ever need to stop Disk Defragmenter before it's done, always use its Stop button. Stop makes Defragmenter finish the move it was doing the instant you clicked the button, and then wait; then you can exit Defragmenter without screwing up your file system.
You might also want to look at the Wikipedia article on defragmentation.
If you never defragment your PC, the file system is just going to gradually get more and more complicated the longer it's in use. You probably won't see much effect for the first six months to a year. Eventually you will get to a state where coping with your massively fragmented file system is imposing a significant performance hit on your operating system.
If it gets to be a big enough hairball, and you never let Scandisk run either, probably eventually there will be file system errors, lost or corrupted files, or software/OS corruption. You might lose documents, have to reinstall software, or even have to reformat your hard disk and reinstall Windows and everything else. I suppose some people buy a new PC and start over.
The official pre-DOS-6 Redmond method of fixing fragmentation was theoretically as follows:
I never saw anybody actually do it that way.
If you have to, you can also semi-fix fragmentation like this:
This method will not result in a completely defragmented system, but it would be a definite improvement over a badly neglected and heavily fragmented one, if for some mysterious reason a regular defragmenter program were not available. Still takes way too long.
Obviously either of these scenarios is less than satisfactory; which is why defragmenter programs were created. A defragmenter fixes the problem in place; it just uses the free space on the disk and moves parts of files around until everything is once again contiguous. The more thoroughly fragmented a disk is, the longer the defragmenter will take to tidy things up.
On some Windows 98 and Windows ME systems, depending on what utilities you have installed, you may find that Disk Defragmenter keeps stopping and starting over, when you try to run it in normal boot mode. This is generally due to utilities or background programs that are changing the disk contents and messing it up. The key symptom is when the progress bar goes back to zero percent. If you have this problem, bottom line, I've found the easiest fix is to boot your computer to Windows safe mode, run the defragmenter in safe mode, and then switch back to normal boot mode.
To boot Windows 98 in safe mode:
A slightly shorter method:
Once Windows 98 is booted in safe mode, you can run Defragmenter. You can confirm you're in Windows safe mode by noting the words Safe mode appearing in all four corners of the display, also by a rather verbose dialog box that appears.
To change back to normal boot mode, follow the same directions but uncheck the Enable Startup Menu box, and skip the last step in each method above, because you won't see the startup menu.
Windows ME can be tough to get into safe mode. Here's an alternative method to get ME into a selective startup mode similar to safe mode, in which Defragmenter should run without problems. You can use this method in Windows 98 as well, with the noted variations. This is not a true Windows safe mode, and you will not see "Safe mode" in the display corners.