PCIN, The PC Improvement News logo

  Add to Favorites     Make Home Page

Defragment Your Hard Drive

I'm sure everyone has heard that it is important to defragment their hard drive. People used to say they were going to optimize their hard drive, but now the common term is to defragment.

What does it mean to defragment? Well, if you imagine your hard drive as a bunch of little boxes (with spaces being empty boxes), an unfragmented hard drive would have all of the boxes for 1 program or file together like this:

1 1 1 2 2 2 2 3 3 3 3 4 4 4 4

Well, what happens when you delete program or file number 3? The resulting set up is like this:

1 1 1 2 2 2 2         4 4 4 4

Now lets say that you make a new document and save it to your hard drive. It is a very large document. The resulting set up would be

1 1 1 2 2 2 2 5 5 5 5 4 4 4 4 5 5 5

Now you can see that if you wanted to open up file 5, the computer would have to look in two different places before it can open it. This is a simple example of what a fragmented hard drive is. It is very possible that after going an extended period of time without defragmenting your hard drive, you could get a hard drive that looks like this

1 21  34  2  2  34  4  5  6  34  21  1  34  9  12

If the computer wanted to open file 34, it would have to look in 4 places. It gets much worse than this.

To defragment is to take all of the fragmented pieces and put them back in order. Windows comes with a defragmenting program. You can also get third party software such as Norton Utilities which comes with a defragmenting program.

NOTE: If you are using FAT32, make sure you use a defragmenting program that is FAT32 compatible. If you use a program that isn't compatible, you can lose your data and mess up your whole system.

The only thing that is important to remember when trying to defragment a hard drive is not to use your computer when you are doing this. Every time you open or close a file/program, something is written to the hard drive. When the defragmenting program senses that the hard drive has been modified in even the slightest manor, it will restart. Things you have to look out for are virus checkers that run in the background. It is best to close down all open applications, including programs that are resident in your system tray. You can also press Ctrl-Alt-Del to manually close some programs. When everything is closed, just run Defrag. It is located in the Start Menu under Programs --> Accessories --> System Tools. You can view the options and change the way Defrag does its job. It is probably best though if you are a novice to just leave it the way it is.

If you follow those steps, you will do a basic defragmenting.

When I do a defragmenting, I like to do a little more. Just remember that if you try any of this you do so at your own risk. I am experienced and feel quite comfortable doing this.

I first erase all of the junk that is on my computer and empty the recycle bin. I then go into the swap file settings and disable the swap file. I then restart the computer in DOS mode.

I deltree the recent, tempor~1, history, temp, and cookies directory.

I then move to the root directory and execute the following command

attrib -r -h -s -a *.* /s

This removes all file attributes. Some defragmenters won't defragment a system (s) file. Removing every files attributes can take a very long time if you have a lot of files on your computer. It is also important to know that if you are using Norton Utilities to defragment your hard drive, you don't need to do this step. Speed Disk (the Norton Utilities defragmenter) will move system files if you ask it to.

I then restart the computer in safe mode and run Defrag. When Defrag is finished, be sure to restore your swap file settings.

Defrag can take a long time, especially if your are using FAT32 as you have 4 times as many clusters as a FAT16 system. And of course the smaller the hard drive the faster it will be.

It is probably a good idea to do a regular defrag every week or two. I only do a thorough defrag once every couple of months as it is so time consuming.

Note: Visit http://support.microsoft.com/default.aspx?scid=kb;EN-US;q155326 for a Microsoft KB article that explains the command-line parameters for Windows 9x versions of defrag. This will let you setup batch files.

Return to Articles Home Page

Return to the FreeHelp Headquarters


PCIN Logo
Subscribe to PCIN now!

Home | Overview | Subscribe | Unsubscribe | Latest Issue | Previous Issues
Free Help Headquarters | Free Help Downloads | PCIN Test Systems
Make Suggestions | Recommend PCIN | Support PCIN | Survey | PCIN.net Site Search
Poll of the Week | Privacy Policy | Links | About Me | Contact Me

Support PCIN
By Donating Today