The description below is from the book DOS the
Easy Way by Everett Murdock Ph.D.
for information about downloading the book.
Type: External (1.0 and later)
CHKDSK [d:][path][filename] [/F][/V]
Purpose: Checks a disk and provides a file and memory status
Checks for errors on a disk. Displays error messages (if problems are
and issues a status report.
If you specify the /F option, the program will correct non-contiguous
when it finds them. These errors can be accidentally created due to the
that DOS does not always store files in one continuous block on the
space is limited on the disk (especially if you have previously erased
replaced files), DOS may store the file in two or more pieces in whatever
are available on the disk. If the links between the clusters (blocks of
are lost, CHKDSK will discover the error and report it. By using the /F
you tell CHKDSK to find any of these parts of files or programs that have
separated from the rest of the file, to create a new file for each, and
the lost segment to these files. These new files will all start with the
letters FILE and will end with four numbers (starting with 0000) plus a
extension. The first file created will be labeled FILE0000.CHK.
When you use the /F option, CHKDSK also looks for and corrects other
disk errors (refer to Appendix A for more information about CHKDSK
errors). They include:
The size of the space reserved for a file block is incorrect.
result in the DOS error message
Allocation error in file
If you run CHKDSK using the /F option, it will alter the size allocation
There are a number of possible errors having to do with DOS`s
record of a file`s attributes. For example, a size of linking attribute
associated with one or more files does not match the actual file
information. This can result in the error message
Entry has a bad attribute
If you run CHKDSK using the /F option, the program will try to
correct the error.
First Cluster Number Invalid
DOS`s internal directory of file information on the disk contains
a pointer to file storage information that does not match the actual files
stored on the disk. This can result in the error message
First cluster number is invalid, entry truncated
If you run CHKDSK using the /F option, the pointer information is
corrected (truncated to a zero length file).
The CHKDSK command is discussed in Chapter 1, Introduction
in the downloadable book
DOS the Easy Way .
/F - Corrects errors when it finds them. If CHKDSK finds lost clusters
(parts of files or programs that have become separated from the rest of the
file) it will write the lost segment to new files and provide the filename
FILEnnnn (nnnn will be a number starting with 0000).
/V - Displays progress messages while CHKDSK is in operation.
filename - If you enter a filename, CHKDSK also reports how many files
are stored in non-contiguous blocks (see explanation of non-contiguous blocks
If you enter
CHKDSK will analyze the disk in drive A and report a status message. It
will look something like this:
362496 bytes total disk space
53248 bytes in 2 hidden files
301056 bytes in 8 user files
8192 bytes available on disk
524288 bytes total memory
198976 bytes free
The first four lines of this display refer to the disk you specified:
indicate the total disk space (the storage capacity of the disk), the
hidden (system) files stored on the disk, the number of user files stored
disk, and the amount of storage space still remaining to be used. If you
created directories on the disk, they would be reported in a fifth line.
last two lines do not refer to the disk you specified; they indicate the
of memory (RAM) in your system and how much of it remains available for
If (for example) three lost clusters are found, the program will also
3 lost clusters found in 3 chains.
Convert lost chains to files (Y/N)?
After this error message is displayed, you should run CHKDSK again, this
time using the /F option. Enter the command as
chkdsk a: /f
Three new files would be created on the root directory of the disk with
the following filenames:
Each of these files will contain a lost cluster. You can use your word
processor to look at these files to determine which file the lost segment
from. If the lost segment came from a text file you may be able to
with the main file. However, upon inspection, you may find that the
text file is intact. This may indicate that the lost segment resulted
management tasks carried out by your word processor (or other type of
In this case, you can simply delete the newly created segment file.
If the lost segment came from a program file, you probably will not be
re-merge it. If possible, replace the file by re-copying from the
source. If you cannot replace the file, check the program file that is
on disk carefully by running all of its features. It may still be