This is only a preview of the June 1997 issue of Silicon Chip. You can view 31 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Colour TV Pattern Generator; Pt.1":
Items relevant to "High-Current Speed Controller For 12V/24V Motors":
Items relevant to "Build An Audio/RF Signal Tracer":
Articles in this series:
Articles in this series:
Items relevant to "Manual Control Circuit For A Stepper Motor":
Articles in this series:
Articles in this series:
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
COMPUTER BITS
BY JASON COLE
Tuning up your hard disc drive
The hard disc drive on your PC requires
regular maintenance for trouble-free Windows
95 operation. The procedure is straightforward
but there are some simple rules that must be
followed to avoid losing data.
With Windows 95 there is one thing
you must do: clean your hard disk
drive (HDD) on a regular basis. This
is known as house cleaning and just
like you do at home, you put things
away first and then make the place
nice and neat.
The same goes for the HDD, which
needs to be cleaned up on a regular
basis. Just how often you should do
this is determined by how often the
HDD is written to. In addition, there
is a strict procedure that must be followed because you can lose data if it
is not done correctly.
The two programs that you use to
clean up your HDD are ScanDisk and
Defrag. Let’s take a closer look at these.
Fig.1: the hard disc drive (HDD) is checked for errors by running ScanDisk. The
standard test will usually suffice but you should occasionally run the thorough
test to scan for any disc surface errors.
54 Silicon Chip
ScanDisk in Windows 95 is similar
to CHKDSK in DOS. Basically, it goes
through the HDD and checks all the
files against the File Allocation Table
(FAT). It then reports any errors that
may be there and gives you an opportunity to fix them. ScanDisk is not a
particularly powerful program but it
is an excellent one to use to ensure
the integrity of the data on the HDD.
Defrag, which is short for Defrag
menter, does just that – it defrag
ments your data. When a drive has
been used for some time and a lot
of data has been saved and deleted,
“holes” appear between the various
files that are created on the HDD.
That’s because the various files are
not necessarily stored on the disc in
a contiguous fashion.
What happens is that the Disk Operating System (DOS) always starts
looking for space from the beginning
of the drive. If it finds that there is already data in the first cluster, it checks
the next cluster and so on until it finds
space. If your file requires two clusters
of drive space and the first available
space is only one cluster in length it
will write what it can there. It then
looks for the next free space to write
the remaining data and that could be
several sectors away.
As a result, the file can be split
into two or more separate pieces on
the HDD; in other words, it becomes
fragmented. And, like the disorder in
your home, the longer you leave it, the
more defragmented the HDD becomes.
Of course, when you access the file,
it appears to be all in one piece. That’s
because the HDD keeps a record (in
the file allocation table) of where all
the fragments are. When you access
the file, the HDD simply looks for all
the fragments so that the file can be
reassembled.
Fig.2 (left): this is the message that appears if ScanDisk
finds no errors on the disc. If errors are found and fixed,
it’s wise to run ScanDisk again until it goes through
without finding any errors. Fig.3 (below) shows the dialog
box that appears when you start the Windows 95 Defrag
program.
The advantage of this technique is
that you can store a lot more data on
the HDD. The downside is that if your
files are badly defragmented, it takes
longer for them to be read from the
HDD. In addition, errors are far more
likely to occur.
By running Defrag, all those fragmented files are moved and written
back to the HDD so that they are now
in contiguous blocks. Depending
on the settings you give the Defrag
program, the files can be simply
defragmented leaving spaces between
them, or the files can all be moved to
the beginning of the drive, thereby
eliminating any “holes” that may have
previously been created.
But what happens if the drive has
an error, such as a file that is given
the wrong size in the FAT? If the
computer has been told that a file is
larger than it actually is, the amount
of the oversize may actually overlap
an adjacent file. If you run Defrag
without first checking for this type
of error, the computer will move the
oversized file and also take part of the
adjacent file with it. The first file may
still work but the header of the second
may be gone and without it that file
cannot be opened.
Run ScanDisc first
So how can we clean up the HDD
and not lose anything? The trick is
to correct any disc errors for running
ScanDisc first. The procedure is as
follows:
(1) Click on the Start button, then
click Programs, Accessories, System
Tools, ScanDisk. A dialog box will
appear as shown in Fig.1
(2) If this is the first time you have
ever checked your HDD or it hasn’t
been done for some time, then make
sure you select the “Thorough” option. This not only checks the files
and folders for errors but also scans
the disk surface for defects. Do not
select the “Automatically fix errors”
option as it is always best to know
what has gone wrong (and to what
file) so that you can do something
about it.
(3) Select the drive to be scanned
and click the Start button
ScanDisk will now go through
your HDD and check for any errors.
The Standard test should only take
about 20 seconds (depending on the
size of the disc and how many files
you have). If you chose the Thorough
option, however, then get a cup of
coffee because it can take over 90
minutes to scan every sector of the
HDD for errors.
I will not go through all the possible
errors that can occur because there
are so many of them. However, one
of the most common errors is: Lost
allocation units found in X chains
If you get this message, convert the
lost allocation units to files and then
have a quick look through them with
a text editor to see if they are a part
of an important document. These
files, by the way, will all have a .chk
extension, so they are easy to identify.
Going back to our error message, the
X chains number tells you how many
*.chk files will be made in the root
directory. Some of these lost chains
can be quite large and I have come
across one that was 79Mb in size.
However, that was from a system that
had a faulty HDD controller.
By the way, do not attempt to check
your hard disc for errors by running
CHKDSK.EXE in a DOS box. If you do,
it can pick up open Windows files,
such as the Swap File, and show it
as an error. CHKDSK.EXE should only
be run in DOS itself, while ScanDisk
should be used exclusively in Windows 95 (you can also run Scandisk
from DOS).
When the scan is completed you
should get a message like the one in
Fig.2. If you come across an error and
elect to fix it, it’s always wise to run
ScanDisk again and to keep re-running it until it goes through without
finding an error.
Defragging the disc
Once Scandisk has been run, you
can run the Defrag program. This is
done by clicking Start, then Programs,
Accessories, System Tools, Disk De
frag
menter. This will bring up the
dialog box shown in Fig.3, allowing
you to select the drive to be defrag
mented.
The next dialog box (Fig.4) tells you
how badly the disc is fragmented. In
this particular case, the reading is
only 1% but this figure can be a bit
misleading. That’s because it doesn’t
really tell you how badly the disc is
June 1997 55
Fig.4 (above): this dialog box can be a bit misleading.
That’s because it doesn’t really tell you how badly the
disc is fragmented at all. Instead, it indicates the degree
of file fragmentation which means that there could be
lots of “holes” on the disc between the various files.
Fig.5 (right): another way to get to ScanDisk and Defrag
is to double-click the My Computer icon on the
Desktop, then right click on the hard drive of choice
and select Properties. You then select the Tools tab to
bring up this dialog box.
fragmented at all. Instead, it indicates
the degree of file fragmentation.
This means that while the individual files may be contiguous, they can
still be all over the place on the disc,
with “holes” everywhere between
them. And, as explained previously,
it is these holes that cause file fragmentation.
Clicking the advanced button
brings up the Advanced Options
dialog box. This lets you select the
defragmentation method and there is
also an option that tells Defrag to scan
the disc first for any errors.
Clicking OK and then the Start
button in the dialog box of Fig.4 sets
the Defrag program running and again
you can go and make yourself a cup of
coffee because the Defrag procedure
can take quite some time.
Another way to get to Scandisk
and Defrag, which is a bit faster, is to
double-click the My Computer icon
on the Desktop, then right click on
the hard drive of choice and select
Properties.
This brings up a new dialog box,
which has several tab options. Selecting the Tools tab brings up the
options shown in Fig.5. The Check
Now button launches the ScanDisk
program, while the Defragment Now
button launches the Defrag program.
56 Silicon Chip
There is also a Backup Now option
but this requires a tape backup unit
to work.
more likely to fail than a well-organized volume.
Important advice
Finally, here’s some fun stuff for
Windows 95. Are you sick of the front
“splash” screen as you load Windows?
If so, this “splash” screen can be easily
changed using a graphics utility.
The opening “splash” screen is a
bitmap file called logo.sys. The bitmap size is 320 x 400 with 256 colours.
To change the screen, first backup or
rename the existing logo.sys file. This
done, grab whatever you want as a
“splash”, save it as a bitmap (logo.
bmp) and rename the file to logo.sys.
Here are the splash screen names:
Logo.sys – front splash (located in the
root directory);
Logos.sys – It’s Now Safe To Turn
Off Your Computer (located in the
Windows directory);
Logow.sys – Please Wait While Your
Computer Shuts Down (located in the
Windows directory).
All three files should be backed up
before attempting any changes, otherwise it will be necessary to reinstall
Windows if you change your mind
and want the originals back again. If
the new bitmap is too big or corrupted,
the computer should still work but the
SC
picture will not appear.
To sum up, you must follow a strict
regime when cleaning up your hard
disc. The two main points to remember are these:
(1) Do not run Defrag without running
ScanDisk first; and
(2) Do run Defrag immediately after
running ScanDisk.
If you run ScanDisk and then do
something else, such as opening and
saving a file or copying files to the
HDD, always run ScanDisk again before running Defrag. This rule should
be followed, no matter how trivial the
extra work may have been.
After all of this, which may seem
a little involved but is really quite
easy, your computer will operate a lot
better. In some systems you may not
notice any real difference but a few
will see a significant increase in loading speed and overall performance.
In either case, your system will be
more reliable.
By the way, if you are running
DriveSpace to get more room, these
processes will take a lot longer. Persevere, however, because a badly organized DriveSpace volume is much
Some fun stuff
|