ArticleslgStudy

computer science

CHKDSK

CHKDSK is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand CHKDSK rather than just read about it. In short: CHKDSK (short for "check disk") is a shell command that verifies the data integrity of the file system on a volume (usually a partition) and attempts to fix logical errors – software-level problems with a filesystem (or its metadata) as a result of prior software malfunction (e.g. crashes) or irregular use (e.g. hard resets). Logical errors are contrasted with and usually less severe than hardware-level errors, whic…

CHKDSK — main illustration
CHKDSK — illustration

Key takeaways

  • CHKDSK belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect CHKDSK to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of CHKDSK from memory before moving on to harder problems.

Reference excerpt

CHKDSK (short for "check disk") is a shell command that verifies the data integrity of the file system on a volume (usually a partition) and attempts to fix logical errors – software-level problems with a filesystem (or its metadata) as a result of prior software malfunction (e.g. crashes) or irregular use (e.g. hard resets). Logical errors are contrasted with and usually less severe than hardware-level errors, which can not be fixed with CHKDSK and may instead require specialized data recovery software or hardware service or replacement. Although the name ends with "DSK" as an abbreviation for "disk", the command supports storage media other than disk-based. The command is available in DOS, Windows, FlexOS, 4690 OS, OS/2, DR DOS 6.0, and FreeDOS. CHKDSK is similar to the fsck command in Unix and similar to Microsoft ScanDisk, which co-existed with CHKDSK in Windows 9x and MS-DOS 6.x.

Variants

CHECKDSK An early variant of a disk checking tool was a part of Digital Equipment Corporation hardware's diagnostics, running on early 1970s TENEX and TOPS-20.

SCP 86-DOS The CHKDSK command was first written in 1980 by Tim Paterson and included in 86-DOS.

DOS

The command is available in MS-DOS versions 1 and later. CHKDSK is implemented as an external command. MS-DOS versions 2.x - 4.x use chkdsk.com as the executable file. MS-DOS versions 5.x and later use chkdsk.exe as the executable file. CHKDSK can also show the memory usage, this was used before the command MEM.EXE was introduced in MS-DOS 4.0 to show the memory usage. In DR DOS the parameter /A limited the output to only show the memory usage.

MS-DOS 5.0 bug CHKDSK and UNDELETE in MS-DOS 5.0 have a bug which can corrupt data: 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 applies to CHKDSK.EXE and UNDELETE.EXE bearing a datestamp of April 9, 1991. This bug was fixed in MS-DOS 5.0a.

Windows

CHKDSK can be run via typical command line interfaces such as PowerShell and Command Prompt, and a special version is available in the Recovery Console. In Windows NT, CHKDSK can also mark bad sectors. In MS-DOS 6.x and Windows 9x, this is a done via Microsoft ScanDisk. The Windows Server version of CHKDSK is RAID-aware and can fully recover data in bad sectors of a disk in a RAID-1 or RAID-5 array if other disks in the set are intact. Fragments of files and directories deemed as corrupt as a result of, for example, power outages while writing, file name overlength, invalid characters in file name, and/or orphaned cluster chains (space reserved by files that no longer exist in the directory structure on FAT or exFAT), are by default moved into a directory under the partition's root, named found.000, and renamed into generic hexadecimally numbered files and directories starting with file00000000.chk and dir_00000000.chk respectively. In the Windows NT family, a standard CHKDSK scan consists of three phases of testing file metadata. It looks for errors but does not fix them unless it is explicitly ordered to do so. The same applies to surface scan—this test, which could be extremely time-consuming on large or low-performance disks, is not carried out unless explicitly requested. CHKDSK requires exclusive write access to the volume to perform repairs. Due to the requirement of the monopolized access to the drive, the CHKDSK cannot check the system disk in the normal system mode. Instead, the system sets a dirty bit to the disk volume and then reboots the computer. During the Windows start-up, a special version of CHKDSK called Autochk (a Native API application, short for "autocheck") is started by SMSS.EXE and checks and attempts repairing the file system if the dirty bit is set. Because of the exclusive access requirement and the time-consuming nature of CHKDSK operation, Windows Vista implemented a new file system health model in which the operating system fixes errors on the volumes as it encounters them. In the event that the problem is grave and a full scan is required, Action Center notifies the user to take the volume offline at the first convenience. Windows Vista and Windows Server 2008 added self-healing ability, turned on by default, in addition to providing the CHKDSK command. It detects physical file system errors and silently fixes them on the fly. Thus, many problems previously discovered on running CHKDSK never appear. It is administered by fsutil repair command. Criticism has been aimed at the tendency of AUTOCHK to automatically modify the file system when not explicitly solicited by the user who may wish to back up their data in prior, as an attempted repair may scramble, undermine and disown file and directory paths, especially on a multiboot installation where multiple operating systems may have interferingly written to the same partition.

The alleged Windows 7 bug Before the release of Windows 7, InfoWorld reported an alleged memory leak in CHKDSK; according to the report, the chkdsk /r command would cause the memory consumption to reach the maximum and the system to crash. Randall C. Kennedy of InfoWorld attributed the original report to "various Web sources" and said that in his tests, the memory consumption reached above 90%, although he did not experience a crash. Nevertheless, Kennedy took the memory consumption for a critical bug that would derail Windows 7's launch and chastised Microsoft. Tom Warren of Neowin dismissed Kennedy's assessment of the alleged leak's significance. Steven Sinofsky of Microsoft also responded that Microsoft could not reproduce a crash either but that the massive memory consumption was by design, to improve performance, and not a leak. Ed Bott of ZDNet also reviewed the claim with his own tests and observed that no crash would occur. Noting that chkdsk /r, by design, does not work on the system drive while Windows is online, Bott concluded "it's arguably a feature, not a bug, and the likelihood that you'll ever crash a system this way is very, very small and completely avoidable."

ReactOS

The ReactOS command is based on a free clone developed by Mark Russinovich for Sysinternals in 1998. It was adapted to ReactOS by Emanuele Aliberti in 1999 and supports volumes using the FAT32 filesystem. The command does not support volumes using the Btrfs filesystem, although ReactOS supports it since version 0.4.1.

… excerpt ends here. Continue reading the full article.

Illustrations

CHKDSK illustration
CHKDSK: CHKDSK.COM (among several other COM files) in IBM PC DOS 1.0.
CHKDSK.COM (among several other COM files) in IBM PC DOS 1.0.
CHKDSK: The chkdsk command on Windows XP
The chkdsk command on Windows XP
CHKDSK: The chkdsk command on ReactOS
The chkdsk command on ReactOS

Worked examples

Example 1 — a first encounter with CHKDSK

Start with the simplest possible case. Write down what CHKDSK claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to CHKDSK before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about CHKDSK ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of CHKDSK

In research
CHKDSK appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses CHKDSK in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
CHKDSK is common in secondary-school and first-year university syllabi. It links to neighbouring topics External DOS commands, Hard disk software, MSX-DOS commands, so understanding it makes those chapters shorter.
In everyday life
Look for CHKDSK outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “CHKDSK” →

How to study CHKDSK in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what CHKDSK means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain CHKDSK out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is CHKDSK in simple terms?

CHKDSK (short for "check disk") is a shell command that verifies the data integrity of the file system on a volume (usually a partition) and attempts to fix logical errors – software-level problems with a filesystem (or its metadata) as a result of prior software malfunction (e.g. crashes) or irreg…

Why does CHKDSK matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study CHKDSK?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on CHKDSK.

Tags

  • External DOS commands
  • Hard disk software
  • MSX-DOS commands
  • Microsoft free software
  • OS/2 commands
  • Windows commands

Keep exploring