A-Z List


Chkdsk

Updated: April 17, 2012

Applies To: Windows Server 2008, Windows Vista

Checks the file system and file system metadata of a volume for logical and physical errors. If used without parameters, chkdsk displays only the status of the volume and does not fix any errors. If used with the /f, /r, /x, or /b parameters, it fixes errors on the volume.

ImportantImportant
Membership in the local Administrators group, or equivalent, is the minimum required to run chkdsk.

ImportantImportant
Interrupting chkdsk is not recommended. However, canceling or interrupting chkdsk should not leave the volume any more corrupt than it was before chkdsk was run. Rerunning chkdsk checks and repairs any remaining corruption on the volume.

For examples of how to use this command, see Examples.

Syntax

chkdsk [<Volume>[[<Path>]<FileName>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<Size>]] [/b]
Parameters

 

Parameter Description

<Volume>

Specifies the drive letter (followed by a colon), mount point, or volume name.

[<Path>]<FileName>

Use with file allocation table (FAT) and FAT32 only. Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use the ? and * wildcard characters to specify multiple files.

/f

Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.

/v

Displays the name of each file in every directory as the disk is checked.

/r

Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors.

/x

Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f.

/i

Use with NTFS only. Performs a less vigorous check of index entries, which reduces the amount of time required to run chkdsk.

/c

Use with NTFS only. Does not check cycles within the folder structure, which reduces the amount of time required to run chkdsk.

/l[:<Size>]

Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size.

/b

NTFS only: Clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. /b includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive.

/?

Displays help at the command prompt.

Remarks

  • Skipping volume checks

    The /i or /c switch reduces the amount of time required to run chkdsk by skipping certain volume checks.

  • Checking a locked drive at restart

    If you want chkdsk to correct disk errors, you cannot have open files on the drive. If files are open, the following error message appears:

    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)
    If you choose to check the drive the next time you restart the computer, chkdsk checks the drive and corrects errors automatically when you restart the computer. If the drive partition is a boot partition, chkdsk automatically restarts the computer after it checks the drive.

    You can also use the chkntfs /c command to schedule the volume to be checked the next time the computer is restarted. Use the fsutil dirty set command to set the volume's dirty bit (indicating corruption), so that Windows runs chkdsk when the computer is restarted.

  • Reporting disk errors

    You should use chkdsk occasionally on FAT and NTFS file systems to check for disk errors. Chkdsk examines disk space and disk use and provides a status report specific to each file system. The status report shows errors found in the file system. If you run chkdsk without the /f parameter on an active partition, it might report spurious errors because it cannot lock the drive.

  • Fixing logical disk errors

    Chkdsk corrects logical disk errors only if you specify the /f parameter. Chkdsk must be able to lock the drive to correct errors.

    Because repairs on FAT file systems usually change a disk's file allocation table and sometimes cause a loss of data, chkdsk might display a confirmation message similar to the following:

    10 lost allocation units found in 3 chains.
    Convert lost chains to files?
    If you press Y, Windows saves each lost chain in the root directory as a file with a name in the format File<nnnn>.chk. When chkdsk finishes, you can check these files to see if they contain any data you need. If you press N, Windows fixes the disk, but it does not save the contents of the lost allocation units.

    If you do not use the /f parameter, chkdsk displays a message that the file needs to be fixed, but it does not fix any errors.

    If you use chkdsk /f on a very large disk or a disk with a very large number of files (for example, millions of files), chkdsk /f might take a long time to complete.

  • Finding physical disk errors

    Use the /r parameter to find physical disk errors in the file system and attempt to recover data from any affected disk sectors.

  • Using chkdsk with open files

    If you specify the /f parameter, chkdsk displays an error message if there are open files on the disk. If you do not specify the /f parameter and open files exist, chkdsk might report lost allocation units on the disk. This could happen if open files have not yet been recorded in the file allocation table. If chkdsk reports the loss of a large number of allocation units, consider repairing the disk.

  • Using chkdsk with Shadow Copies for Shared Folders

    Because the Shadow Copies for Shared Folders source volume cannot be locked while Shadow Copies for Shared Folders is enabled, running chkdsk against the source volume might report false errors or cause chkdsk to unexpectedly quit. You can, however, check shadow copies for errors by running chkdsk in Read-only mode (without parameters) to check the Shadow Copies for Shared Folders storage volume.

  • Understanding exit codes

    The following table lists the exit codes that chkdsk reports after it has finished.

     

    Exit code Description

    0

    No errors were found.

    1

    Errors were found and fixed.

    2

    Performed disk cleanup (such as garbage collection) or did not perform cleanup because /f was not specified.

    3

    Could not check the disk, errors could not be fixed, or errors were not fixed because /f was not specified.

  • The chkdsk command, with different parameters, is available from the Recovery Console.

  • On servers that are infrequently restarted, you may want to use the chkntfs or the fsutil dirty query commands to determine whether the volume's dirty bit is already set before running chkdsk.

Examples

If you want to check the disk in drive D and have Windows fix errors, type:

chkdsk d: /f

If it encounters errors, chkdsk pauses and displays messages. Chkdsk finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until chkdsk finishes.

To check all files on a FAT disk in the current directory for noncontiguous blocks, type:

chkdsk *.*

Chkdsk displays a status report, and then lists the files that match the file specifications that have noncontiguous blocks.

Additional references

Command-Line Syntax Key



Community Content

Ravi Gurrala
Check disk issues on Windows Xp embedded
Check disk in Windows Xp  embedded            I am having hard time understanding the difference between <br />Chkdsk /F and chkdsk /X/F and chkdsk /X<br /><br />in my current system i am using /X so i am getting Error code 3 .I would like to know more details about these error code?<br />
Tags :

BharatReddy
Check disk in Windows Xp
I am having hard time understanding the difference between <br /> Chkdsk /F and chkdsk /X/F and chkdsk /X<br /><br /> in my current system i am using /X so i am getting Error code 3 most of the time but the disk is readable. (7 out of 10 times)<br /><br /> I am planning to change it to /X/F but i want to know the use of this?<br />
Tags :

ko ko zaya min tu
Caution on use of /R switch
<p>According to Lunarsoft.net Wiki, chkdsk with /R switch should <em>not</em> be used:<br /><br /><mtps:InstrumentedLink NavigateUrl="http://wiki.lunarsoft.net/wiki/Data_Recovery" runat="server" xmlns:mtps="http://msdn2.microsoft.com/mtps">http://wiki.lunarsoft.net/wiki/Data_Recovery</mtps:InstrumentedLink></p> <ol> <li>Its actions are undocumented, and some of its status messages are ridiculously terse ("found and fixed one or more errors") <li>It doesn't tell you what files are being modified (or if they're even being modified) when working with unreadable extents ("File record segment XYZ is unreadable"). <li>Most of the time, it doesn't tell you what sectors are bad (as in LBA sector number). <li>Even when it is giving you less terse messages about sectors ("Read failure with status 0xXYZ at offset 0xXYZ for 0xXYZ bytes") there still isn't enough information provided to use another tool (offset from what? Is this specified in LBA sector addressing or MFT logical addressing?) <li>You can't do a heavy duty check without also performing repairs, so even the offset information in the previous bullet point is useless after chkdsk does whatever it does. <li>It doesn't tell you if it was able to recover your data out of a bad sector. <li>It often doesn't tell you what is corrupted or why it gives up when it gives up ("one or more unrecoverable partitions"). <li>When recovering bad sectors, it immediately writes data back to the drive in order to force reallocation, but it won't tell you if it was successful or not, and writing to a failing drive is the worst thing you can do. <li><p>When the parent folder information is lost, the files are moved to X:\FOUND.### where ### is a number starting at 000. chkdsk doesn't tell you whether files put here are intact or not (and when processing a drive with bad sectors, you can usually assume the files placed here have holes in them or are just plain destroyed).</p></li></li></li></li></li></li></li></li></li> </ol> <p>On the other hand...<br /><br />"You should use the /F flag, however, because chkdsk is a decent free NTFS filesystem-level repair utility. NOTE: You should only use the /F flag if you know the drive has absolutely no bad sectors and is working completely perfectly. Server 2003, XP Professional x64, and Vista have a new chkdsk flag (/v), which prints extra information about modified files, but this is only useful for NTFS. For FAT32, it prints a list of every file being checked."<br /></p>
Tags : chkdsk/f

nrpapaleo
Windows 7 - chkdsk randomly perfoming
Under Windows 7 it may happen that chkdsk runs randomly when starting up. If it does not find any failures and this should happen seemingly without any reason it's probably a bug. There is no reason to panic! your drive is alright.<br /><br /> It seems that some Antivirus products or/and steam under Windows 7 are responsible for that behaviour. There is as far as i know no solution to this problem.<br />
Tags : random

ischilling
chkdsk consumes nearly all memory in Windows 7 (only)
Using chkdsk equally of the used parameters, does result in chkdsk consuming over 90% of the free memory in my system - which is computer dependend between 12GB and 24GB!<br /><br />Since in comparision to an similiar Vista 64bit installation, neither speed nor something else get's faster (or slower), consequently I am sure we have a bug here.<br /><br />Searching the Internet, I recognize I am not the only one experiencing this problem, but as it looks like there is not yet a known resolution - or does someone here has a working one?
Tags : memory

stathis1975
chkdsk for external drive message cannot lock the drive
i performed the chkdsk f: /x /f /r command and in the first line said cannot lock the drive and continued the operation..can someone help me with this one pls?<br />
Tags : error chkdsk

daviangel
chkdsk /r might consume a large amount of memory on Windows 7 and Windows Server 2008 R2
If you use chkdsk /r on a non-system volume , chkdsk /r might consume a large amount of memory. Up to over 90% of your total memory. This only occurs in Windows 7 and Windows Server 2008 R2.<br />

Page view tracker