{"id":442,"date":"2013-05-17T20:48:27","date_gmt":"2013-05-17T20:48:27","guid":{"rendered":"http:\/\/montgomeryminds.com\/blog\/?p=442"},"modified":"2013-05-17T21:21:27","modified_gmt":"2013-05-17T21:21:27","slug":"chkdsk-windows-cmd-line-tool-microsoft-overview","status":"publish","type":"post","link":"https:\/\/montgomeryminds.com\/blog\/chkdsk-windows-cmd-line-tool-microsoft-overview\/","title":{"rendered":"CHKDSK Windows cmd line tool &#8211; Microsoft overview"},"content":{"rendered":"<style><!--\nstrong { color: #c0c020; }\ncode { font-size: 100%; }\n--><\/style>\n<p><script type=\"text\/javascript\">\/\/ <![CDATA[\nfunction bonw () {\n\n}\n\/\/ ]]><\/script><br \/>\n<button>black on white [tbd]<\/button> (cuz the yellow highlight color below was chosen for white (light) chars on black background)<br \/>\nHere&#8217;s microsoft&#8217;s overview of the <code>CHKDSK<\/code> Windows command line tool.\u00a0 An <a title=\"CHKDSK windows cmd line tool \u2013 Microsoft In-Depth discussion\" href=\"https:\/\/montgomeryminds.com\/blog\/chkdsk-windows-cmd-line-tool-microsoft-in-depth-discussion\/\">in-depth discussion can be found here<\/a>.<\/p>\n<p>Quote microsoft:<\/p>\n<div style=\"border-left: thin solid gray; padding-left: 1em;\">\n<h1>Chkdsk<\/h1>\n<p>Creates and displays a status report for a disk based on the file system. <strong>Chkdsk<\/strong> also lists and corrects errors on the disk. Used without parameters, <strong>chkdsk<\/strong> displays the status of the disk in the current drive.<!--more--><\/p>\n<p><a name=\"E4\"><\/a><\/p>\n<h2>Syntax<\/h2>\n<p><strong>chkdsk<\/strong> [<i>volume<\/i><strong>:<\/strong>][[<i>Path<\/i>] <i>FileName<\/i>] [<strong>\/f<\/strong>] [<strong>\/v<\/strong>] [<strong>\/r<\/strong>] [<strong>\/x<\/strong>] [<strong>\/i<\/strong>] [<strong>\/c<\/strong>] [<strong>\/l<\/strong>[<strong>:<\/strong><i>size<\/i>]]<\/p>\n<div><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\"><img loading=\"lazy\" alt=\"Top of page\" src=\"http:\/\/www.microsoft.com\/library\/gallery\/templates\/MNP2.Common\/images\/arrow_px_up.gif\" width=\"7\" height=\"9\" border=\"0\" \/><\/a><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\">Top of page<\/a><\/div>\n<p><a name=\"EIC\"><\/a><\/p>\n<h2>Parameters<\/h2>\n<p><strong><i>volume<\/i><\/strong><strong><i>:<\/i><\/strong><strong> <\/strong><strong>: <\/strong>Specifies the drive letter (followed by a colon), mount point, or volume name.<\/p>\n<p><strong>[<\/strong><strong><i>Path<\/i><\/strong><strong>] <\/strong><strong><i>FileName<\/i><\/strong><strong> <\/strong><strong>: <\/strong>Specifies the location and name of a file or set of files that you want <strong>chkdsk<\/strong> to check for fragmentation. You can use wildcard characters (that is, * and ?) to specify multiple files.<\/p>\n<p><strong>\/f<\/strong><strong> <\/strong><strong>: <\/strong>Fixes errors on the disk. The disk must be locked. If <strong>chkdsk<\/strong> cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.<\/p>\n<p><strong>\/v<\/strong><strong> <\/strong><strong>: <\/strong>Displays the name of each file in every directory as the disk is checked.<\/p>\n<p><strong>\/r<\/strong><strong> <\/strong><strong>: <\/strong>Locates bad sectors and recovers readable information. The disk must be locked.<\/p>\n<p><strong>\/x<\/strong><strong> <\/strong><strong>: <\/strong>Use with NTFS only. Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. <strong>\/x<\/strong> also includes the functionality of <strong>\/f<\/strong>.<\/p>\n<p><strong>\/i<\/strong><strong> <\/strong><strong>: <\/strong>Use with NTFS only. Performs a less vigorous check of index entries, reducing the amount of time needed to run <strong>chkdsk<\/strong>.<\/p>\n<p><strong>\/c<\/strong><strong> <\/strong><strong>: <\/strong>Use with NTFS only. Skips the checking of cycles within the folder structure, reducing the amount of time needed to run <strong>chkdsk<\/strong>.<\/p>\n<p><strong>\/l<\/strong><strong>[:<\/strong><strong><i>size<\/i><\/strong><strong>] <\/strong><strong>: <\/strong>Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, <strong>\/l<\/strong> displays the current size.<\/p>\n<p><strong>\/?<\/strong><strong>: <\/strong>Displays help at the command prompt.<\/p>\n<div><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\"><img loading=\"lazy\" alt=\"Top of page\" src=\"http:\/\/www.microsoft.com\/library\/gallery\/templates\/MNP2.Common\/images\/arrow_px_up.gif\" width=\"7\" height=\"9\" border=\"0\" \/><\/a><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\">Top of page<\/a><\/div>\n<p><a name=\"E2F\"><\/a><\/p>\n<h2>Remarks<\/h2>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Running <strong>chkdsk<\/strong>To run <strong>chkdsk<\/strong> on a fixed disk, you must be a member of the Administrators group.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Checking a locked drive at restartIf you want <strong>chkdsk<\/strong> 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, <strong>chkdsk<\/strong> checks the drive and corrects errors automatically when you restart the computer. If the drive partition is a boot partition, <strong>chkdsk<\/strong> automatically restarts the computer after it checks the drive.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Reporting disk errors<strong>Chkdsk<\/strong> examines disk space and disk use for the file allocation table (FAT) and NTFS file systems. <strong>Chkdsk<\/strong> provides information specific to each file system in a status report. The status report shows errors found in the file system. If you run <strong>chkdsk<\/strong> without the <strong>\/f<\/strong> command-line option on an active partition, it might report spurious errors because it cannot lock the drive. You should use <strong>chkdsk<\/strong> occasionally on each disk to check for errors.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Fixing disk errors<strong>Chkdsk<\/strong> corrects disk errors only if you specify the <strong>\/f<\/strong> command-line option. <strong>Chkdsk<\/strong> must be able to lock the drive to correct errors. Because repairs usually change a disk&#8217;s file allocation table and sometimes cause a loss of data, <strong>chkdsk<\/strong> sends a confirmation message similar to the following:10 lost allocation units found in 3 chains.Convert lost chains to files?If you press <strong>Y<\/strong>, Windows saves each lost chain in the root directory as a file with a name in the format File<i>nnnn<\/i>.chk. When <strong>chkdsk <\/strong>finishes, you can check these files to see if they contain any data you need. If you press <strong>N<\/strong>, Windows fixes the disk, but it does not save the contents of the lost allocation units.<\/p>\n<p>If you do not use the <strong>\/f<\/strong> command-line option, <strong>chkdsk <\/strong>sends a message if a file needs to be fixed, but it does not fix any errors.<\/p>\n<p>If you use <strong>chkdsk \/f<\/strong> on a very large disk (for example, 70 gigabytes) or a disk with a very large number of files (for example, millions of files), <strong>chkdsk<\/strong> might take a long time (for example, over several days) to complete. The computer is not available during this time because <strong>chkdsk<\/strong> does not relinquish control until it is finished.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Checking a FAT diskWindows displays <strong>chkdsk<\/strong> status reports for a FAT disk in the following format:Volume Serial Number is B1AF-AFBF72214528 bytes total disk space73728 bytes in 3 hidden files<\/p>\n<p>30720 bytes in 12 directories<\/p>\n<p>11493376 bytes in 386 user files<\/p>\n<p>61440 bytes in bad sectors<\/p>\n<p>60555264 bytes available on disk<\/p>\n<p>2048 bytes in each allocation unit<\/p>\n<p>35261 total allocation units on disk<\/p>\n<p>29568 available allocation units on disk<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Checking an NTFS diskWindows displays <strong>chkdsk<\/strong> status reports for an NTFS disk in the following format:The type of the file system is NTFS.CHKDSK is verifying files&#8230;File verification completed.<\/p>\n<p>CHKDSK is verifying indexes&#8230;<\/p>\n<p>Index verification completed.<\/p>\n<p>CHKDSK is verifying security descriptors&#8230;<\/p>\n<p>Security descriptor verification completed.<\/p>\n<p>12372 kilobytes total disk space.<\/p>\n<p>3 kilobytes in 1 user files.<\/p>\n<p>2 kilobytes in 1 indexes.<\/p>\n<p>4217 kilobytes in use by the system.<\/p>\n<p>8150 kilobytes available on disk.<\/p>\n<p>512 bytes in each allocation unit.<\/p>\n<p>24745 total allocation units on disk.<\/p>\n<p>16301 allocation units available on disk.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Using <strong>chkdsk<\/strong> with open filesIf you specify the <strong>\/f<\/strong> command-line option, <strong>chkdsk<\/strong> sends an error message if there are open files on the disk. If you do not specify the <strong>\/f<\/strong> command-line option and open files exist, <strong>chkdsk<\/strong> 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 <strong>chkdsk<\/strong> reports the loss of a large number of allocation units, consider repairing the disk.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Finding physical disk errorsUse the <strong>\/r<\/strong> command-line option to find physical disk errors in the file system. For information about recovering physically damaged files with <strong>recover<\/strong>, see Related Topics.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Reporting bad disk sectorsBad sectors reported by <strong>chkdsk <\/strong>were marked as bad when your disk was first prepared for operation. They pose no danger.<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>Understanding exit codesThe following table lists the exit codes that <strong>chkdsk <\/strong>reports after it has finished.<\/p>\n<table id=\"EVDAC\" cellspacing=\"0\" cellpadding=\"0\">\n<thead>\n<tr valign=\"top\">\n<td id=\"colEXDAC\">Exit code<\/td>\n<td id=\"colE1DAC\">Description<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr valign=\"top\">\n<td>0<\/td>\n<td>No errors were found.<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>1<\/td>\n<td>Errors were found and fixed.<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>2<\/td>\n<td>Disk cleanup, such as garbage collection, was performed, or cleanup was not performed because <strong>\/f<\/strong> was not specified.<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>3<\/td>\n<td>Could not check the disk, errors could not be fixed, or errors were not fixed because <strong>\/f<\/strong> was not specified.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">\u2022<\/td>\n<td>The <strong>chkdsk<\/strong> command, with different parameters, is available from the Recovery Console.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\"><img loading=\"lazy\" alt=\"Top of page\" src=\"http:\/\/www.microsoft.com\/library\/gallery\/templates\/MNP2.Common\/images\/arrow_px_up.gif\" width=\"7\" height=\"9\" border=\"0\" \/><\/a><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\">Top of page<\/a><\/div>\n<p><a name=\"EAFAC\"><\/a><\/p>\n<h2>Examples<\/h2>\n<p>If you want to check the disk in drive D and have Windows fix errors, type:<\/p>\n<p><strong>chkdsk d: \/f<\/strong><\/p>\n<p>If it encounters errors, <strong>chkdsk<\/strong> pauses and displays messages. <strong>Chkdsk<\/strong> finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until <strong>chkdsk<\/strong> finishes.<\/p>\n<p>To check all of files on a FAT disk in the current directory for noncontiguous blocks, type:<\/p>\n<p><strong>chkdsk *.*<\/strong><\/p>\n<p><strong>Chkdsk<\/strong> displays a status report, and then lists the files matching the file specification that have noncontiguous blocks.<\/p>\n<div><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\"><img loading=\"lazy\" alt=\"Top of page\" src=\"http:\/\/www.microsoft.com\/library\/gallery\/templates\/MNP2.Common\/images\/arrow_px_up.gif\" width=\"7\" height=\"9\" border=\"0\" \/><\/a><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx#top\">Top of page<\/a><\/div>\n<p><a name=\"EZFAC\"><\/a><\/p>\n<h2>Formatting legend<\/h2>\n<table id=\"E2FAC\" cellspacing=\"0\" cellpadding=\"0\">\n<thead>\n<tr valign=\"top\">\n<td id=\"colE4FAC\">Format<\/td>\n<td id=\"colEAGAC\">Meaning<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr valign=\"top\">\n<td><i>Italic<\/i><\/td>\n<td>Information that the user must supply<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td><strong>Bold<\/strong><\/td>\n<td>Elements that the user must type exactly as shown<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>Ellipsis (&#8230;)<\/td>\n<td>Parameter that can be repeated several times in a command line<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>Between brackets ([])<\/td>\n<td>Optional items<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>Between braces ({}); choices separated by pipe (|). Example: {even|odd}<\/td>\n<td>Set of choices from which the user must choose only one<\/td>\n<\/tr>\n<tr valign=\"top\">\n<td>Courier font<\/td>\n<td>Code or program output<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/ntcmds.mspx\">Command-line reference A-Z<\/a><\/p>\n<\/div>\n<p>End quoting microsoft:<\/p>\n<p>From: <a href=\"http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx?mfr=true\">http:\/\/www.microsoft.com\/resources\/documentation\/windows\/xp\/all\/proddocs\/en-us\/chkdsk.mspx?mfr=true<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>black on white [tbd] (cuz the yellow highlight color below was chosen for white (light) chars on black background) Here&#8217;s microsoft&#8217;s overview of the CHKDSK Windows command line tool.\u00a0 An in-depth discussion can be found here. Quote microsoft: Chkdsk Creates &hellip; <a href=\"https:\/\/montgomeryminds.com\/blog\/chkdsk-windows-cmd-line-tool-microsoft-overview\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,3],"tags":[],"_links":{"self":[{"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/posts\/442"}],"collection":[{"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":17,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/montgomeryminds.com\/blog\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}