CHKDSK

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 fixes 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.

chkdsk
chkdsk.exe in action on drive C: in Windows 10
Original author(s)Tim Paterson
Developer(s)SCP, Microsoft, IBM, DR, Datalight, Novell, Toshiba, PhysTechSoft, ReactOS Contributors
Initial release1980 (1980)
Operating system86-DOS, MS-DOS, PC DOS, MSX-DOS, OS/2, FlexOS, DR-DOS, ROM-DOS, 4690 OS, PTS-DOS, Windows, FreeDOS, ReactOS
TypeCommand
LicenseMS-DOS: MIT
FreeDOS, ReactOS: GPLv2
Websiten/a

Implementations

CHKDSK.COM in IBM PC DOS 1.0

86-DOS

The CHKDSK command was first implemented in 1980 by Tim Paterson and included in Seattle Computer Products 86-DOS.[4]

MS-DOS

The command is available in MS-DOS versions 1 and later.[5] 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.[6]

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.[7]

Microsoft Windows

The chkdsk command on Windows XP

CHKDSK can be run from DOS prompt, Windows Explorer, Windows Command Prompt, Windows PowerShell or Recovery Console.[8]

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.[9]

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.[10][11]

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 the drive 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.[12]

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.[13][14]

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.[15] Tom Warren of Neowin dismissed Kennedy's assessment of the alleged leak's significance.[16] 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."[17]

DR/Novell DOS

DR DOS 6.0 also includes an implementation of the CHKDSK command.[18]

ReactOS

The ReactOS implementation is based on a free clone developed by Mark Russinovich for Sysinternals in 1998.[19]

See also

References

  1. http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf
  2. https://archive.org/details/4690OSV6r2UsersGuide/page/n169
  3. http://www.jatomes.com/Help/Os2Cmd.php#CHKDSK
  4. 86-DOS User's Manual - Version 0.3
  5. Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
  6. MS-DOS and Windows command line chkdsk command
  7. "When Not to Use MS-DOS 5.0 CHKDSK and UNDELETE Commands". Support (1.1 ed.). Microsoft. 16 November 2006.
  8. "Description of the Windows XP Recovery Console for advanced users". Support (8.0 ed.). Microsoft. 11 July 2013. Retrieved 4 September 2014.
  9. Holm, Dan; Thomas, Orin (2003). "11-3: Maintaining Disk Storage Volumes". Managing and Maintaining a Microsoft Windows Server 2003 Environment. Microsoft Press. p. 11.25. ISBN 9780735614376.
  10. "An explanation of the new /C and /I Switches that are available to use with Chkdsk.exe". Microsoft Support. Microsoft. 1 December 2007. Archived from the original on 24 October 2014. Retrieved 25 January 2019.
  11. "Troubleshooting Disks and File Systems". Windows XP Professional Resource Kit. Microsoft. 3 November 2005. Retrieved 4 September 2014.
  12. Bangalore, Kiran (10 May 2012). Sinofsky, Steven (ed.). "Redesigning chkdsk and the new NTFS health model". Building Windows 8. Microsoft.
  13. Chen, Ken (4 August 2014). "NTFS Self-Healing is An Overlooked but Useful Feature in Windows 7". Next of Windows.
  14. Pawar, Amit (13 February 2008). "Self-healing NTFS in Windows Server 2008 and Windows Vista". Amit Pawar - Infrastructure blog. Microsoft.
  15. Kennedy, Randall C. (5 August 2009). "Critical Windows 7 bug risks derailing product launch". InfoWorld. IDG. Retrieved 19 February 2015.
  16. Warren, Tom (5 August 2009). "Windows 7 RTM contains a rather nasty chkdsk bug". Neowin. Retrieved 19 February 2015.
  17. Bott, Ed (5 August 2009). "A killer Windows 7 bug? Sorry, no". ZDNet. CBS Interactive.
  18. DR DOS 6.0 User Guide Optimisation and Configuration Tips
  19. https://github.com/reactos/reactos/blob/master/base/system/chkdsk/chkdsk.c

Further reading

  • Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
  • Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
  • Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O'Reilly. ISBN 978-0-596-00148-3.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.