Hard Drive
Space Efficiency

by Alan C. Proctor, Jr.


Physical fitnessfor your hard drive

Yes, there is one more thing you have to keep physically fit. Granted, in comparison with the rabbit food, vitamins, weights, and aerobic routines we all endure, keeping a computer's hard drive in shape will be easy. Similar to our own problems with cholesterol levels, bulging waist lines and other deleterious effects from smoking and too much red meat, a hard drive has its problems with *.tmp files, lost allocation units, and disk space.

Windows programs produce many temporary files (*.tmp) with all the swapping they do between programs and providing the GUI (graphical user interface). If left unchecked, these *.tmp files can quickly overrun free hard drive space. To prevent this unwanted invasion from occurring, there are several lines that can be added to your autoexec.bat fileafter making the directory C:\windows\temp. The first lines to add (not necessarily at the beginning) are SET TEMP=C:\windows\temp and SET TMP=C:\windows\temp. These two lines will tell Windows applications to place all their temporary files (there are two delineations due to different programs requiring different parameters) in these directories, rather than loose on the hard drive. The next lines to add are:

cd\windows\temp
del *.tmp
cd\

These lines will delete the *.tmp files from the C:\windows\temp directory each time your computer is rebooted, thus saving your hard drive's valuable space.

Space, free space that is, is very important for Windows to function properly. If Windows has no room to make its temporary files, cross linked files can occur (which have the potential to destroy/corrupt data). The suggested amount of free space to maintain on a hard drive is 20 MB. This amount will allow Windows ample room to create *.tmp files to its heart's content (which are then deleted every time you boot up with the previously mentioned modifications).

Regarding booting up, let me clarify. Almost every time a PC is rebooted (cold or hot) while still in Windows, the *.tmp files that are floating in RAM memory that have not yet been written to disk get "lost." Because they weren't properly written to disk, these files are loose cannons called lost allocations units. These units can also take up valuable disk space and when coupled with insufficient disk space to begin with can cause data corruption such as cross linked files. Among the best ways to prevent this unseen problem from occurring is to run DOS 6.2's SCANDISK from within the autoexec.bat. The additional line should be one of the last lines in the autoexec.bat file and should simply read SCANDISK.

The last preventive measure that we will discuss for a hard drive's health is DOS 6.2's DEFRAG (DEFRAG first showed up in DOS 6.0). DOS is dumb when it comes to writing information to the disk. With a brand new hard drive, each sector is filled up sequentially as data is written to the disk. However, as information is deleted and added rather than writing to the next available free sector, DOS finds the first free sector at the beginning of the disk. Thus, bits and pieces of files can be saved all over the hard drive (which can lead to delayed response time reading and writing). DEFRAG corrects this problem by rewriting the data so that all the files are in consecutive sectors together. I suggest running DEFRAG about once a month; the program is menu driven and will walk you through step by step.

By now, you should be asking "OK fine, now that I know what to do in the future, how do I find out if I have any of these problems?" If weird errors have been occurring regularly regarding memory problems, errors reading drives, or general protection faults (GPF)there might be a problem on the hard drive.

The first thing to do is run SCANDISK. Do not run SCANDISK (or DEFRAG) inside Windows as an incorrect reading will occur. If errors are found, let SCANDISK fix themand always make an undo disk. Next, perform a CHKDSK in DOS to determine how much disk space is free. If there is less than 20 MB free, start deciding which games, err... I mean, what valuable data you're going to delete or move to floppies. While you're at it, do a search in File Manager (also the best place to delete large amounts of data because directory/file structures can be easily seen) for all *.tmp files. File Manager will then list all *.tmp files regardless what directory they're inwhich makes for easy deletion.

Granted, this all seems like extra work: and it is. However, if your data is truly valuable and worth protecting, much less to avoid the cost of a new hard drive, these are small measures by comparison. So please, implement the preventive measures discussed earlier because, like our own health: an ounce of prevention is worth a pound of cure.

Alan C. Proctor, Jr. is a HAL-PC member.


This page is best viewed using Netscape ver. 2.0b5 or higher. Designed by Meredith Foster. E-mail me at webmaster@hal-pc.org with any comments you have and tell me what you want to see here.

Back to the User Journal Home Page