HOME

TheInfoList



OR:

In computing, CHKDSK (short for "check disk") is a system tool and
command Command may refer to: Computing * Command (computing), a statement in a computer language * command (Unix), a Unix command * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on A ...
in
DOS DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
and
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
(and related
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s), as well as
Digital Research Digital Research, Inc. (DR or DRI) was a privately held American software company created by Gary Kildall to market and develop his CP/M operating system and related 8-bit, 16-bit and 32-bit systems like MP/M, Concurrent DOS, FlexOS, Multiuser ...
FlexOS FlexOS is a discontinued modular real-time multiuser multitasking operating system ( RTOS) designed for computer-integrated manufacturing, laboratory, retail and financial markets. Developed by Digital Research's Flexible Automation Business ...
,
IBM International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
/
Toshiba is a Japanese multinational electronics company headquartered in Minato, Tokyo. Its diversified products and services include power, industrial and social infrastructure systems, elevators and escalators, electronic components, semiconductors ...
4690 OS 4690 Operating System (sometimes shortened to 4690 OS or 4690) is a specially designed point of sale (POS) operating system, originally sold by IBM. In 2012, IBM sold its retail business, including this product, to Toshiba, which assumed support. ...
, IBM
OS/2 OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
. It verifies the
integrity Integrity is the quality of being honest and having a consistent and uncompromising adherence to strong moral and ethical principles and values. In ethics, integrity is regarded as the honesty and Honesty, truthfulness or of one's actions. Integr ...
of the file system on a
volume Volume is a measure of regions in three-dimensional space. It is often quantified numerically using SI derived units (such as the cubic metre and litre) or by various imperial or US customary units (such as the gallon, quart, cubic inch) ...
(usually a partition) and attempts to fix logical file system errors. Logical errors are typically defined as software-level problems with a filesystem (or its
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
) 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
data recovery In computing, data recovery is a process of retrieving deleted, inaccessible, lost, corrupted, damaged, overwritten or formatted data from computer data storage#Secondary storage, secondary storage, removable media or Computer file, files, when ...
software or expert assistance. CHKDSK is similar to the
fsck The system utility fsck (''file system check'') is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux Linux ( ) is a family of open source Unix-like operating systems based on the L ...
command in
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and similar to
Microsoft ScanDisk Not to be confused with SanDisk. Microsoft ScanDisk (also called ScanDisk) is a diagnostic utility program included in MS-DOS and Windows 9x. It checks and repairs file systems errors on a disk drive, while the system starts. Overview The progra ...
, which co-existed with CHKDSK in
Windows 9x Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
and
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
6.x.


Implementations

An early implementation of a 'CheckDisk' was the ''CHECKDSK'' that was a part of
Digital Equipment Corporation Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president until ...
hardware's diagnostics, running on early 1970s TENEX and
TOPS-20 The TOPS-20 operating system by Digital Equipment Corporation (DEC) is a proprietary OS used on some of DEC's 36-bit mainframe computers. The Hardware Reference Manual was described as for "DECsystem-10/DECSYSTEM-20 Processor" (meaning the DEC PDP ...
.


SCP 86-DOS

The CHKDSK command was first implemented in 1980 by
Tim Paterson Tim Paterson (born 1 June 1956) is an American computer programmer, best known for creating 86-DOS, an operating system for the Intel 8086. This system emulated the application programming interface (API) of CP/M, which was created by Gary Kilda ...
and included in
Seattle Computer Products Seattle Computer Products (SCP) was a Tukwila, Washington, microcomputer hardware company which was one of the first manufacturers of computer systems based on the 16-bit Intel 8086 processor. Founded in 1978, SCP began shipping its first S ...
86-DOS 86-DOS (known internally as QDOS, for Quick and Dirty Operating System) is a discontinued operating system developed and marketed by Seattle Computer Products (SCP) for its Intel 8086-based computer kit. 86-DOS shared a few of its commands wi ...
.


MS-DOS / IBM PC DOS

The command is available in
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
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 File Allocation Table (FAT) is a file system developed for personal computers and was the default file system for the MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on Ha ...
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.


Microsoft Windows

CHKDSK can be run from DOS prompt,
Windows Explorer File Explorer, previously known as Windows Explorer, is a file manager application and default desktop environment that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user i ...
,
Windows Command Prompt cmd.exe, a.k.a. Command Prompt, is a shell (computing), shell computer program, program on later versions of Windows (Windows NT, NT and Windows CE, CE families), OS/2,, eComStation, ArcaOS, and ReactOS. In some versions of Windows (Windows C ...
,
Windows PowerShell PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langua ...
or
Recovery Console The Recovery Console is a feature of the Windows 2000, Windows XP and Windows Server 2003 operating systems. It provides the means for administrators to perform a limited range of tasks using a command-line interface. Its primary function is to ...
. On
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
operating systems, CHKDSK can also check the disk surface for bad sectors and mark them (in
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
6.x and
Windows 9x Windows 9x is a generic term referring to a line of discontinued Microsoft Windows operating systems released from 1995 to 2000 and supported until 2006, which were based on the kernel introduced in Windows 95 and modified in succeeding version ...
, this is a task done by
Microsoft ScanDisk Not to be confused with SanDisk. Microsoft ScanDisk (also called ScanDisk) is a diagnostic utility program included in MS-DOS and Windows 9x. It checks and repairs file systems errors on a disk drive, while the system starts. Overview The progra ...
). The
Windows Server Windows Server (formerly Windows NT Server) is a brand name for Server (computing), server-oriented releases of the Windows NT operating system (OS) that have been developed by Microsoft since 1993. The first release under this brand name i ...
version of CHKDSK is
RAID RAID (; redundant array of inexpensive disks or redundant array of independent disks) is a data storage virtualization technology that combines multiple physical Computer data storage, data storage components into one or more logical units for th ...
-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, and/or invalid characters in file name, are 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. On 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 mode Native describes a computing system as operating directly with an underlying technology; with no intervening communication or translation layers. Native software Native software is built to be executed directly by processors that implement ...
application) is started by the 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 Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
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 Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and
Windows Server 2008 Windows Server 2008, codenamed "Longhorn Server" (alternatives: "Windows Vista Server" or "Windows Server Vista"), is the seventh major version of the Windows NT operating system produced by Microsoft to be released under the Windows Server b ...
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 system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s may have interferingly written to the same partition.


The alleged Windows 7 bug

Before the release of
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
, ''
InfoWorld ''InfoWorld'' (''IW'') is an American information technology media business. Founded in 1978, it began as a monthly magazine. In 2007, it transitioned to a Web-only publication. Its parent company is International Data Group, and its sister pu ...
'' reported an alleged
memory leak In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in a way that memory which is no longer needed is not released. A memory leak may also happen when an objec ...
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 Neowin is a technology news website. Editorial focus is predominantly on Microsoft-related news, but the site also offers analysis and reporting on mobile news, tech trends, gadgets and new technological developments, as well as in-depth produc ...
dismissed Kennedy's assessment of the alleged leak's significance.
Steven Sinofsky Steven Jay Sinofsky (born 1965) is an American businessman, investor and software engineer. He served as president of the Windows Division at Microsoft from July 2009 until his resignation on November 13, 2012. In 1998 and in 2013, Sinofsky was ...
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."


DR/Novell DOS

DR DOS 6.0 also includes an implementation of the command.


FreeDOS

The
FreeDOS FreeDOS (formerly PD-DOS) is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running Legacy system, legacy software and supporting embedded systems. FreeDOS ca ...
version was developed by Imre Leber and is licensed under the GNU GPL 2.


ReactOS

The ReactOS implementation is based on a free clone developed by
Mark Russinovich Mark Eugene Russinovich (born December 22, 1966) is a Spanish-born American software engineer and author who serves as CTO of Microsoft Azure. He was a cofounder of software producers Winternals before Microsoft acquired it in 2006. Early lif ...
for
Sysinternals Windows Sysinternals is a website that offers technical resources and utilities to manage, diagnose, troubleshoot, and monitor a Microsoft Windows environment. Originally, the Sysinternals website (formerly known as ntinternals) was created in 19 ...
in 1998. It was adapted to ReactOS by Emanuele Aliberti in 1999 and supports volumes using the
FAT32 File Allocation Table (FAT) is a file system developed for personal computers and was the default file system for the MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on ...
filesystem. The command does not support volumes using the
Btrfs Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or "B.T.R.F.S.") is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (distinct from Linux's LVM), d ...
filesystem, although ReactOS supports it since version 0.4.1.


See also

*
Defragmentation In the maintenance of file systems, defragmentation is a process that reduces the degree of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous ...
*
Data scrubbing Data scrubbing is an error correction technique that uses a background task to periodically inspect main memory or storage for errors, then corrects detected errors using redundant data in the form of different checksums or copies of data. Data ...
*
List of file systems The following lists identify, characterize, and link to more thorough information on file systems. Many older operating systems support only their one "native" file system, which does not bear any name apart from the name of the operating system i ...
* e2fsprogs


References


Further reading

* * *


External links


Official documentation about Microsoft CHKDSKOpen source CHKDSK implementation that comes with MS-DOS v2.0
{{Windows commands External DOS commands Hard disk software Microsoft free software MSX-DOS commands OS/2 commands