This is only a preview of the February 1992 issue of Silicon Chip. You can view 45 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 "Build A Stereo Power Amplifier":
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
|
COMPUTER BITS
BY JENNIFER BONNITCHA
More things to do when things go wrong
This month we have more troubleshooting tips particularly ways of repairing damaged files.
Should you encounter problems with unexpected
program termination, one of the first things you
should do is check for file damage.
When you need to find out if there
is any file damage, the DOS command
CHKDSK (CHecK DiSK) is a good starting point. Its job is to check the formatted size and available space on a
disc, indicate the amount of disc space
consumed by system files, data files
and bad sectors, and finally show the
standard memory size and amount of
memory available. As a safety measure, it's a good idea to run CHKDSK
occasionally on all your regularly used
hard and floppy discs to prevent minor problems from turning into major
ones. This is an external DOS command, so you need to make sure a
copy of the file is available either in
the current directory or its location
CHKDSK has two switches you can
use in conjunction with the command:
/f (FIX) instructs CHKDSK to attempt
to correct any errors detected. CHKDSK
always asks if it should attempt to
correct errors it detects, however it
will actually do nothing unless this
switch is specified
/v (VERBOSE) this switch directs
CHKDSK to display filename and path
specifications for each file on the disc.
Using the DOS pipe (I) and FIND commands, you can find a file on a hard
disc:
CHKDSK C:/V I FIND FILENAME
You should initially run CHKDSK
without the /f switch to determine
what type of error may have taken
"Should you receive an Abort, Retry, Fail, Ignore
command while running CHKDSK, avoid the
Ignore option. If you do choose Ignore, the
corrective action taken by CHKDSK could cause
further problems."
must be included in the Path command.
CHKDSK analyses the entire disc and
in doing so, compares each subdirectory entry size against the File
Allocation Table (FAT), checks the integrity of each allocation chain in
the FAT and can optionally repair some
forms of file damage.
50
SILICON CHIP
place. You should also note that
CHKDSK is not designed for use with
the DOS commands JOIN, SUBST or
ASSIGN since it only reports on real
rather than logical drives. For this
reason, CHKDSK should not be run on
a network disc drive either.
The command CHKDSK [drive] will
typically return something like that
shown in Fig.1. The disc is examined
and if all is OK, no errors are reported. The status report displays information about the disc and the computer's memory. The first four lines
report on the total amount of disc
space, the number of files on the disc
and the remaining available space.
You may see a bad sector report as
well. The remaining two lines report .
on the amount of conventional
memory used and the amount still
available.
You can re-direct the output from
CHKDSK to either a file or printer if
you wish using the command:
CHKDSK [drive]> [FILENAME]
or CHKDSK [drive] > PRN
In addition, if you include a filename in the command, CHKDSK will
display the number of non-contiguous areas (or sectors) on the disc that
contain the name files. Although fragmented files (ie, those with non-con- ·
tiguous blocks) are acceptable to DOS,
they can slow down your computer's
performance quite considerably. If you
use the DOS wildcard . * , CHKDSK reports on each fragmented file in the
current directory.
Should you receive an Abort, Retry,
Fail, Ignore command while running
CHKDSK, avoid the Ignore option. If
you do choose Ignore, the corrective
action taken by CHKDSK could be incorrect and only cause further problems. Try the Retry option several
times if needed and then for preference use the Fail or Abort option.
Ignore•is the absolute last resort. ·
Problems you may have
CHKDSK can get confused over two
problems and thus will abort the procedure itself:
Cannot CHDIR to <file specifier>
CHDIR .. failed trying alternate method
Failures are usually caused by car-
When the file is closed, DOS writes
ing the chase eventually
become the new information to the FAT and if
memory-resident interrupted, the FAT chain is incomplete, the file's directory entry is inin the DOS disc
Volume LABELNAME created Dec 12, 1991 3:15p
consistent and the data may or may
buffers, so the drive
71442432 bytes total disk space
light will go out
not actually exist on the disc. A physi110592 bytes in 3 hidden files
cally or logically damaged directory
until you restart the
225280 bytes in 34 directories
computer. Listen may also create this problem.
57335808 bytes in 960 user files
also for a rhythmic
Provided you used the If switch
13770752 bytes available on disk
pattern to the disc
when running CHKDSK, you can reply
"Y" to the convert message. DOS will
movement.
655360 bytes total memory
then
create a separate file for each
Detecting
the
320704 bytes free
lost chain. These files are named
problem file is
FILExxxx.CHK (where xxxx represents
easier if you redirect the CHKDSK a sequential number starting with
rupt interrupt tables or insufficient output to a printer (CHKDSK > PRN).
0000). Should you decide to answer
RAM. In the first instance, the file tree
You will most likely receive another "N", DOS converts to zero the entries
cannot be processed beyond the point error message, then CHKDSK will fail
in the FAT that correspond to the lost
specified. When directories are cre- again. Once this happens, halt the
chains and marks those areas as availated, DOS automatically inserts two
program, restart DOS then use the Iv
able for new files.
entries. The first entry in each switch so CHKDSK can display the
If you have not used the If switch,
subdirectory is the "." entry (dot)
name of each file it checks. The last CHKDSK reports the amount of disc
which represents the directory itself.
file shown is usually the suspect file.
space that could be freed, regardless
The second entry is the given name
When (if) you find the problem file(s),
of your answer to the conversion ques" .. " (double dot) which represents the
you can either delete the file and hope
tion. Answering "Y" will cause
parent of the current directory. If ei- all the associated chains are also deCHKDSK to report the number of files
ther of these entries is corrupted,
leted. You could use a program like that would be created.
CHKDSK displays the first message.
Norton's FASTSAVE or Mace Utilities
You could, depending on the value
CHKDSK will ask if you want to
SAVE-RESTORE to repair the FAT or of the lost chains, answer "Y" to the
convert the directory to a file. Answering yes creates a standard file
containing the contents of the subdirectory (ie, the file names). The ac"A cluster is lost if the FAT entry for the cluster is
tual contents of the files become lost
a non zero number but the cluster does not
clusters when the subdirectory is conbelong to any file. A contiguous set of lost
verted. However, you get the chance
to do something about the lost clusclusters is a lost chain."
ters at the conclusion of the CHKDSK
command, provided you used the If
switch.
finally, format the disc to re-generate
conversion question then examine the
You could get this message during
the FAT (but, of course, destroy all
file's contents.
CHKDSK if you have a temporary hardexisting information).
Cross linking
ware glitch in the disc controller or
Little
orphan
Annies
interface.
FILENAME is cross-linked:
If CHKDSK locks up, it has entered a
xxx lost clusters found in yyy chains
On cluster xx
loop in which one link in the file''s
Convert lost chains to files (YIN)?
Two files are cross-linked when the
chain in the FAT points back to an
A cluster is a unit of space on a FAT indicates that a cluster belongs to
earlier link. During processing, should
disc. A cluster is "lost" if the FAT both files. The message is displayed
a wayward entry point to a previous
entry for the cluster is a non zero
once for each file that is cross-linked.
FAT entry for the file, CHKDSK enters
number but the cluster does not be- CHKDSK doesn't take any action and
an endless loop moving backward and
long to any file. A contiguous set of the files can often be salvaged by copyforward to trace the chain. The trace
lost clusters is a lost chain.
ing them to another physical disc or
continues forever and can be broken
The most probable cause of this
partition. You should then delete the
using the <CTRL BREAK> or <CTRL ALT
problem is that a program or DOS
Gross-linked files and examine the
DEL> key sequence (or, if you have
stopped before DOS finished closing copies. !f the files are intact, run
one on your computer, press the Rethe file. This error occurs only when
CHKDSK again for the suspect disc
set).
extending a previous file or when cre- and if all is OK, copy the files back to
You can be reasonably certain you
ating new files. CHKDSK has found
the original disc. Remember that once
are in a loop when CHKDSK displays
some clusters without an owner. When
you delete the files, they are almost
no message, there is no disc activity a file is created or extended, DOS
impossible to recover.
for approximately 30 seconds, or the
marks the clusters it will write to as
We'll have more adventures next
drive keeps working beyond an acin-use, thus creating the link in the
month on checking and repairing disc
ceptable limit. The FAT sections causfile's FAT chain.
damage.
SC
FIGURE 1
FEBRUARY1992
51
|