Information About

Chkdsk




CHKDSK ( 8.3 command shortening of '''Checkdisk''') is a command in DOS and Microsoft Windows systems which verifies a Hard Disk or a Floppy Disk for File System integrity. It is similar to the Fsck command in Unix .


USAGE


By default, CHKDSK neither fixes errors nor checks for bad sectors. In order to fix errors while using the Command Line Interface , the /F parameter should be specified. In order to check for and mark bad sectors, the /R parameter should be specified. Other parameters can be listed by typing the command chkdsk /?


WINDOWS NT BASED


Under Windows NT , Windows 2000 , Windows 2003 , Windows XP and Windows Vista , CHKDSK can also check the disk surface for '' Bad Sector s'', a task previously done by SCANDISK . CHKDSK can also fix errors.


Running CHKDSK


Under Windows, CHKDSK can be run both from a console window, as the chkdsk command with flags, and from ''My Computer'' using the Graphical User Interface . For the latter,
  • Open ''My Computer''

  • Right-click with the Mouse on the disk or diskette to scan

  • Click ''Properties''

  • Click the ''Tools'' tab

  • Press the ''Check Now...'' button in the ''Error-checking'' box

  • In the box that opens, Check Box es allow the same functionality as the command line's /R and /F parameters


When used under Windows with the /F or the /R parameter when there are open files on the disk (for instance if running it on the boot disk) CHKDSK suggests it be run on the next restart. If the user agrees, it will execute autochk.exe when the computer is restarted, which will run the CHKDSK code.

Sometimes the check still fails, giving the error "Cannot open volume for direct access" on startup, due to an application ( Anti-virus , Anti-spyware , Firewall , and the like) that locks up the partition before CHKDSK can access it. This has been improved in Service Pack 2 , but still happens occasionally. One fix is to set the "/SAFEBOOT" option in the ''boot.ini'' tab after running ''msconfig''. {Link without Title} This puts the system in a minimal/low-resolution mode temporarily, though, which can be disconcerting but does not mean that anything has broken.

If the check does not occur and does not provide any error messages, this may be due to a corrupt copy of autochk.exe. A clean copy can be copied from C:\i386 to C:\WINDOWS\SYSTEM32 or from your Windows Installation CD.


Using the Recovery Console


When using the Windows Recovery Console , the CHKDSK command can use the following options:



/f : Does an exhaustive check of the drive and corrects any errors.

/r : Locates bad sectors and recovers readable information.



Note: If you specify the /r option, the /f option is implied. When you specify the chkdsk command without arguments, the command checks the current drive with no options in effect.


Viewing results


Conducting a CHKDSK can take some time, especially if using the /R parameter, and the results are often not visible, for various reasons. In order to view the results of a CHKDSK conducted on restart using Windows XP or Windows 2000,
  • Open the ''Control Panel''

  • Double click on ''Administrative Tools''

  • Double click on ''Event Viewer''

  • Click on ''Application'' (Windows XP) or ''Application Log'' (Windows 2000) from the left hand side of the window

  • Find items labeled ''Winlogon'' under the ''Source'' column (clicking the ''Source'' column heading sorts the entries alphabetically)

  • Results of CHKDSKs on restart can be found in the ''Winlogon'' entries. They can be viewed by double-clicking. Look for one with the correct date and time.


A typical result:


Checking file system on C:
The type of the file system is NTFS.

A disk check has been scheduled.
Windows will now check the disk.
Cleaning up minor inconsistencies on the drive.
Cleaning up 318 unused index entries from index of file 0x9.
Cleaning up 318 unused index entries from index of file 0x9.
Cleaning up 318 unused security descriptors.
CHKDSK is verifying file data (stage 4 of 5)...
File data verification completed.
CHKDSK is verifying free space (stage 5 of 5)...
Free space verification is complete.

14996645 KB total disk space.
10187752 KB in 88054 files.
30784 KB in 5774 indexes.
0 KB in bad sectors.
164341 KB in use by the system.
65536 KB occupied by the log file.
4613768 KB available on disk.

4096 bytes in each allocation unit.
3749161 total allocation units on disk.
1153442 allocation units available on disk.



THE MS-DOS 5 BUG

The version of CHKDSK (and Undelete ) supplied with MS-DOS 5.0 has a serious bug which can corrupt data. This applies to CHKDSK.EXE and UNDELETE.EXE with a date of 04/09/91. If the File Allocation Table of a disk uses 256 sectors, running CHKDSK /F can cause data loss and running UNDELETE can cause unpredictable results. This normally affects disks with a capacity of approximately a multiple of 128 MB. This bug was fixed in MS-DOS 5.0a. A Microsoft Knowledge Base article Microsoft Knowledge Base article about the MS-DOS 5.0 CHKDSK bug gives more details on this.


SEE ALSO




EXTERNAL LINKS




REFERENCES