chkdsk


chkdsk

Verifies and fixes the integrity of a filesystem on a disk.

Syntax

 chkdsk [   volume   [ [[   path   ]   filename   ] ] ] [/f] [/v] [/r] [/x] [/i] [/c]  [/l[:   size   ] ] 

Options

None

Displays status of current drive.

volume

Specifies drive to check. This can be a drive letter followed by a colon , a volume mount point, or a volume name .

[path] filename

Lists specific file(s) to check using chkdsk (wildcards are acceptable).

/f

Fixes any disk errors found.

/v

Verbose mode (displays the name of each file checked).

/r

Recovers readable information from bad sectors.

/x

Forces volume to dismount first if necessary (NTFS only) and fixes any disk errors found. Note that all open handles to the disk are then invalid. You can't force-dismount the system volume.

/i

Performs a quick check of index entries only (NTFS only).

/c

Speeds check by ignoring cycles within folder structure (NTFS only).

/l[:size]

Specifies log-file size (NTFS only). Current size is displayed if no size is specified.

The following options are available only when running the Recovery Console (see Recovery Console in Chapter 4):

/p

Performs an exhaustive check on the drive regardless of whether chkdsk is marked to run (doesn't fix errors).

/r

Recovers readable information from bad sectors (implies /p ).

Examples

Check C: drive but don't fix any errors found:

  chkdsk C:  

Typical output might be:

 The type of the file system is NTFS.     WARNING!  F parameter not specified. Running CHKDSK in read-only mode.     CHKDSK is verifying files (stage 1 of 3)... File verification completed. CHKDSK is verifying indexes (stage 2 of 3)... Index verification completed. CHKDSK is verifying security descriptors (stage 3 of 3)... Security descriptor verification completed. CHKDSK is verifying Usn Journal... Usn Journal verification completed. Windows found problems with the file system. Run CHKDSK with the /F (fix) option to correct these.        2096450 KB total disk space.    1758220 KB in 23870 files.       8056 KB in 1407 indexes.          0 KB in bad sectors.      72348 KB in use by the system.      12544 KB occupied by the log file.     257826 KB available on disk.           2048 bytes in each allocation unit.    1048225 total allocation units on disk.     128913 allocation units available on disk. 

Note that errors were found. To try to correct these, run:

  chkdsk C: /f  

The output is now:

 The type of the file system is NTFS. Cannot lock current drive.     Chkdsk cannot run because the volume is in use by another process.  Would you like to schedule this volume to be checked the next time the system restarts? (Y/N) 

Press Y to schedule chkdsk to run at the next reboot. Note, however, that running chkdsk on the active partition may generate spurious errors. (On NTFS volumes , chkdsk identifies unreferenced security descriptions as errors, whereas they simply take up space.)

Notes

  • You must be a member of the Administrators group to use chkdsk .

  • chkdsk can take hours (or days) to run on very large volumes. To speed up chkdsk , use the /i and /c options, which omit certain checks on the volume.

  • If you choose to fix errors using chkdsk /f , there is a possibility of data loss ( especially on FAT partitions), so you are prompted to confirm whether chkdsk should make the necessary changes to the file-allocation table. Also, always make a full backup of volumes containing important data before running chkdsk /f on them.

  • The file %SystemRoot%\System32Autochk.exe is required by chkdsk in order to run. Autochk writes a message to the application log for each drive checked.

  • You can also check a disk for errors from the GUI using the Check Disk button on the Tools tab of a disk's properties sheet (see Disks in Chapter 4 for more information).

  • chkdsk can't repair corruption in the master file table (MFT) for an NTFS volume. If you have a file or directory that you can't open, rename, copy, or delete from an NTFS volume, back up the volume to tapeexcluding the problem file from the backup joband then restore the volume.

  • See the recover command later in this chapter for information about recovering physically damaged files.

See Also

chkntfs , convert , defrag , diskpart , Disks , format , label , mountvol



Windows Server 2003 in a Nutshell
Windows Server 2003 in a Nutshell
ISBN: 0596004044
EAN: 2147483647
Year: 2003
Pages: 415
Authors: Mitch Tulloch

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net