Original author(s) | Tim Paterson |
---|---|
Developer(s) | SCP, Microsoft, IBM, DR, Datalight, Novell, Toshiba, PhysTechSoft, ReactOS Contributors |
Initial release | 1980 |
Written in | MS-DOS: x86 assembly language FreeDOS, ReactOS: C |
Operating system | 86-DOS, MS-DOS, PC DOS, MSX-DOS, SISNE plus, OS/2, eComStation, ArcaOS, FlexOS, DR-DOS, ROM-DOS, 4690 OS, PTS-DOS, Windows, FreeDOS, ReactOS |
Platform | Cross-platform |
Type | Command |
License | MS-DOS: MIT FreeDOS, ReactOS: GPLv2 |
Website | learn |
In computing, CHKDSK
(short for "check disk") is a system tool and command in DOS, Digital Research FlexOS, [1] IBM/Toshiba 4690 OS, [2] IBM OS/2, [3] Microsoft Windows and related operating systems. It verifies the file system integrity of a volume and attempts to fix logical file system errors. It 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.
An early implementation of a 'CheckDisk' was the CHECKDSK that was a part of Digital Equipment Corporation hardware's diagnostics, running on early 1970s TENEX and TOPS-20. [4] [5]
The CHKDSK
command was first implemented in 1980 by Tim Paterson and included in Seattle Computer Products 86-DOS. [6]
The command is available in MS-DOS versions 1 and later. [7] 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. [8]
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.
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. [9]
CHKDSK
can be run from DOS prompt, Windows Explorer, Windows Command Prompt, Windows PowerShell or Recovery Console. [10]
On Windows NT operating systems, CHKDSK
can also check the disk surface for bad sectors and mark them (in MS-DOS 6.x and Windows 9x, this is a task done by 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. [11]
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. [12] [13]
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. [14] [15]
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 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 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. [16]
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. [17] [18]
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. [19] [20] [21]
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. [22] Tom Warren of Neowin dismissed Kennedy's assessment of the alleged leak's significance. [23] 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." [24]
DR DOS 6.0 also includes an implementation of the CHKDSK
command. [25]
The FreeDOS version was developed by Imre Leber and is licensed under the GNU GPL 2. [26]
The ReactOS implementation is based on a free clone developed by Mark Russinovich for Sysinternals in 1998. [27] 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.
New Technology File System (NTFS) is a proprietary journaling file system developed by Microsoft. Starting with Windows NT 3.1, it is the default file system of the Windows NT family. It superseded File Allocation Table (FAT) as the preferred filesystem on Windows and is supported in Linux and BSD as well. NTFS reading and writing support is provided using a free and open-source kernel implementation known as NTFS3 in Linux and the NTFS-3G driver in BSD. By using the convert
command, Windows can convert FAT32/16/12 into NTFS without the need to rewrite all files. NTFS uses several files typically hidden from the user to store metadata about other files stored on the drive which can help improve speed and performance when reading data. Unlike FAT and High Performance File System (HPFS), NTFS supports access control lists (ACLs), filesystem encryption, transparent compression, sparse files and file system journaling. NTFS also supports shadow copy to allow backups of a system while it is running, but the functionality of the shadow copies varies between different versions of Windows.
File Allocation Table (FAT) is a file system developed for personal computers and was the default filesystem for MS-DOS and Windows 9x operating systems. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. The increase in disk drives capacity required four major variants: FAT12, FAT16, FAT32, and ExFAT. FAT was replaced with NTFS as the default file system on Microsoft operating systems starting with Windows XP. Nevertheless, FAT continues to be used on flash and other solid-state memory cards and modules, many portable and embedded devices because of its compatibility and ease of implementation.
COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot. As a shell, COMMAND.COM has two distinct modes of operation: interactive mode and batch mode. Internal commands are commands stored directly inside the COMMAND.COM binary; thus, they are always available, but can only be executed directly from the command interpreter.
HPFS is a file system created specifically for the OS/2 operating system to improve upon the limitations of the FAT file system. It was written by Gordon Letwin and others at Microsoft and added to OS/2 version 1.2, at that time still a joint undertaking of Microsoft and IBM, and released in 1988.
NTLDR is the boot loader for all releases of Windows NT operating system from 1993 with the release of Windows NT 3.1 up until Windows XP and Windows Server 2003. From Windows Vista onwards it was replaced by the BOOTMGR bootloader. NTLDR is typically run from the primary storage device, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk. NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.
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 subsequent versions. The first version in the 9x series was Windows 95, which was succeeded by Windows 98 and then Windows Me, which was the third and last version of Windows on the 9x line, until the series was superseded by Windows XP.
The Installable File System (IFS) is a filesystem API in MS-DOS/PC DOS 4.x, IBM OS/2 and Microsoft Windows that enables the operating system to recognize and load drivers for file systems.
In computing, a file system or filesystem governs file organization and access. A local file system is a capability of an operating system that services the applications running on the same computer. A distributed file system is a protocol that provides file access between networked computers.
File attributes are a type of meta-data that describe and may modify how files and/or directories in a filesystem behave. Typical file attributes may, for example, indicate or specify whether a file is visible, modifiable, compressed, or encrypted. The availability of most file attributes depends on support by the underlying filesystem where attribute data must be stored along with other control structures. Each attribute can have one of two states: set and cleared. Attributes are considered distinct from other metadata, such as dates and times, filename extensions or file system permissions. In addition to files, folders, volumes and other file system objects may have attributes.
Undeletion is a feature for restoring computer files which have been removed from a file system by file deletion. Deleted data can be recovered on many file systems, but not all file systems provide an undeletion feature. Recovering data without an undeletion facility is usually called data recovery, rather than undeletion. Undeletion can both help prevent users from accidentally losing data, or can pose a computer security risk, since users may not be aware that deleted files remain accessible.
Microsoft 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.
In computing, SUBST
is a command on the DOS, IBM OS/2, Microsoft Windows and ReactOS operating systems used for substituting paths on physical and logical drives as virtual drives.
Microsoft Drive Optimizer is a utility in Microsoft Windows designed to increase data access speed by rearranging files stored on a disk to occupy contiguous storage locations, a technique called defragmentation. Microsoft Drive Optimizer was first officially shipped with Windows XP.
The NTFS file system defines various ways to redirect files and folders, e.g., to make a file point to another file or its contents without making a copy of it. The object being pointed to is called the target. Such file is called a hard or symbolic link depending on a way it's stored on the filesystem.
Wubi is a free software Ubuntu installer, that was the official Windows-based software, from 2008 until 2013, to install Ubuntu from within Windows, to a single file within an existing Windows partition.
In computing, the trash, also known by other names such as dustbin, wastebasket, and others, is a graphical user interface desktop metaphor for temporary storage for files set aside by the user for deletion, but not yet permanently erased. The concept and name is part of Mac operating systems, a similar implementation is called the Recycle Bin in Microsoft Windows, and other operating systems use other names.
In computing, label
is a command included with some operating systems. It is used to create, change, or delete a volume label on a logical drive, such as a hard disk partition or a floppy disk. Used without parameters, label
changes the current volume label or deletes the existing label.
MS-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 operating systems attempting to be compatible with MS-DOS, are sometimes referred to as "DOS". MS-DOS was the main operating system for IBM PC compatibles during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system.
In computing, recover
is a primitive file system error recovery utility included in MS-DOS / IBM PC DOS versions prior to DOS 6.0 and a number of other operating systems.
Under Tenex .. Hardware Maintenance Procedures .. Recovery from Checkdsk Errors
CHKDSK
and UNDELETE
Commands". Support (1.1 ed.). Microsoft. 16 November 2006.