Computer and Software Support


DOS Command Chkdsk

Syntax:

CHKDSK [d:][path][filename] [/F][/V]

Purpose: Checks a disk and provides a file and memory status report.


Discussion

Checks for errors on a disk. Displays error messages (if problems are found) and issues a status report.

If you specify the /F option, the program will correct non-contiguous errors when it finds them. These errors can be accidentally created due to the fact that DOS does not always store files in one continuous block on the disk. If space is limited on the disk (especially if you have previously erased and replaced files), DOS may store the file in two or more pieces in whatever spaces are available on the disk. If the links between the clusters (blocks of data) are lost, CHKDSK will discover the error and report it. By using the /F option, you tell CHKDSK to find any of these parts of files or programs that have become separated from the rest of the file, to create a new file for each, and to write 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 .CHK extension. The first file created will be labeled FILE0000.CHK.

When you use the /F option, CHKDSK also looks for and corrects other types of disk errors (refer to Appendix A for more information about CHKDSK errors). They include:

Allocation

The size of the space reserved for a file block is incorrect. This can result in the DOS error message

Allocation error in file

If you run CHKDSK using the /F option, it will alter the size allocation number.

Attribute

There are a number of possible errors having to do with DOS`s internal 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).

Options

/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 above).
 

This page is from http://www.easydos.com. I pasted it on my website to avoid possible broken links. For further help with DOS commands, Check easydos.com out.