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.COM, the default operating system shell and command-line interpreter for DOS
* Command key, a modifier key on Apple Macintosh computer keyboards
* ...
in
DOS
DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems.
DOS may also refer to:
Computing
* Data over signalling (DoS), multiplexing data onto a signalling channel
* Denial-of-service attack (DoS), an attack on a communicat ...
,
Digital Research
Digital Research, Inc. (DR or DRI) was a 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 DOS, DOS Plus, DR DOS and Gr ...
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 U ...
,
IBM/
Toshiba
, commonly known as Toshiba and stylized as TOSHIBA, is a Japanese multinational conglomerate corporation headquartered in Minato, Tokyo, Japan. Its diversified products and services include power, industrial and social infrastructure system ...
4690 OS, IBM
OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 r ...
,
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
and related
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s. It verifies the
file system integrity of a
volume
Volume is a measure of occupied 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). Th ...
and attempts to fix logical file system errors. It is similar to the
fsck
The system utility fsck (''file system consistency check'') is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD. A similar command, CHKDSK, exists in Microsoft Windows ...
command in
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser 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, and ot ...
and similar to
Microsoft ScanDisk, which co-existed with
CHKDSK
in
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in su ...
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 ope ...
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 unt ...
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 ...
and included in
Seattle Computer Products 86-DOS.
MS-DOS / IBM PC DOS
![IBM PC DOS 1](https://upload.wikimedia.org/wikipedia/commons/a/ac/IBM_PC_DOS_1.0_screenshot.png)
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 ope ...
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.
Microsoft Windows
CHKDSK
can be run from
DOS prompt,
Windows Explorer
File Explorer, previously known as Windows Explorer, is a file manager application that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file ...
,
Windows Command Prompt
Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows (Windows NT family and Windows CE family), and ReactOS operating systems. On Windows CE .NET 4.2, W ...
,
Windows PowerShell
PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-so ...
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 graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system.
The first version of Win ...
operating systems,
CHKDSK
can also check the disk surface for
bad sector A bad sector in computing is a disk sector on a disk storage unit that is permanently damaged. Upon taking damage, all information stored on that sector is lost. When a bad sector is found and marked, the operating system like Windows or Linux will ...
s 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 ope ...
6.x and
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced from 1995 to 2000, which were based on the Windows 95 kernel and its underlying foundation of MS-DOS, both of which were updated in su ...
, this is a task done by
Microsoft ScanDisk). The
Windows Server
Windows Server (formerly Windows NT Server) is a group of operating systems (OS) for servers that Microsoft has been developing since July 27, 1993. The first OS that was released for this platform was Windows NT 3.1 Advanced Server. With the r ...
version of
CHKDSK
is
RAID
Raid, RAID or Raids may refer to:
Attack
* Raid (military), a sudden attack behind the enemy's lines without the intention of holding ground
* Corporate raid, a type of hostile takeover in business
* Panty raid, a prankish raid by male college ...
-aware and can fully recover data in bad sectors of a disk in a
RAID-1
In computer storage, the standard RAID levels comprise a basic set of RAID ("redundant array of independent disks" or "redundant array of inexpensive disks") configurations that employ the techniques of striping, mirroring, or parity to create lar ...
or
RAID-5
In computer storage, the standard RAID levels comprise a basic set of RAID ("redundant array of independent disks" or "redundant array of inexpensive disks") configurations that employ the techniques of striping, mirroring, or parity to create lar ...
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
A dirty bit or modified bit is a bit that is associated with a block of computer memory and indicates whether the corresponding block of memory has been modified. The dirty bit is set when the Central processing unit, processor writes to (modifies ...
to the disk volume and then reboots the computer. During the
Windows start-up, a special version of
CHKDSK
called
Autochk
(a
native mode
In computing, native software or data-formats are those that were designed to run on a particular operating system. In a more technical sense, native code is code written specifically for a certain processor. In contrast, cross-platform software ...
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, which was released five years before, at the time being the longest time span between successive releases of ...
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
Action Center is a notification center included with Windows Phone 8.1, Windows 10 and Windows 10 Mobile. It was first introduced with Windows Phone 8.1 in July 2014, and was introduced to the desktop with the launch of Windows 10 on July 29, 2015 ...
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, which was released five years before, at the time being the longest time span between successive releases of ...
and
Windows Server 2008
Windows Server 2008 is the fourth release of the Windows Server operating system produced by Microsoft as part of the Windows NT family of the operating systems. It was released to manufacturing on February 4, 2008, and generally to retail on F ...
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
Multi-booting is the act of installing multiple operating systems on a single computer, and being able to choose which one to boot. The term dual-booting refers to the common configuration of specifically two operating systems. Multi-booting m ...
installation where multiple
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
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 released to manufacturing on July 22, 2009, and became generally available on October 22, 2009. It is the successor to Windows Vista, released nearly ...
, ''
InfoWorld
''InfoWorld'' (abbreviated IW) is an 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 today is International Data Group, and its siste ...
'' 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 object ...
in
CHKDSK
; according to the report, the
chkdsk /r
command would cause the memory consumption to reach the maximum and the system to
crash
Crash or CRASH may refer to:
Common meanings
* Collision, an impact between two or more objects
* Crash (computing), a condition where a program ceases to respond
* Cardiac arrest, a medical condition in which the heart stops beating
* Couch su ...
. 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 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
Ed Bott is an American technology journalist and author, known for his books and articles on Microsoft Windows. While he has over twenty years of experience writing about a variety of tech-related topics and has written for some well-known medi ...
of ''
ZDNet
ZDNET is a business technology news website owned and operated by Red Ventures.
The brand was founded on April 1, 1991, as a general interest technology portal from Ziff Davis and evolved into an enterprise IT-focused online publication.
His ...
'' 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
DR-DOS (written as DR DOS, without a hyphen, in versions up to and including 6.0) is a disk operating system for IBM PC compatibles. Upon its introduction in 1988, it was the first DOS attempting to be compatible with IBM PC DOS and MS-D ...
also includes an implementation of the command.
FreeDOS
The
FreeDOS
FreeDOS (formerly Free-DOS and 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 software and supporting embedded systems.
FreeDOS can ...
version was developed by Imre Leber and is licensed under the
GNU GPL 2
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general us ...
.
ReactOS
![ReactOS-0](https://upload.wikimedia.org/wikipedia/commons/9/9b/ReactOS-0.4.13_chkdsk_command_667x434.png)
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 it was acquired by Microsoft in 2006.
Ea ...
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. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. It is often supported for compatibility reasons by ...
filesystem.
The command does not support volumes using the
Btrfs
Btrfs (pronounced as "better F S", "butter F S", "b-tree F S", or simply by spelling it out) is a computer storage format that combines a file system based on the copy-on-write (COW) principle with a logical volume manager (not to be confused ...
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 contigu ...
*
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 Computer 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 ...
*
e2fsprogs
e2fsprogs (sometimes called the e2fs programs) is a set of utilities for maintaining the ext2, ext3 and ext4 file systems. Since those file systems are often the default for Linux distributions, it is commonly considered to be essential softwar ...
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