How and why to run chkdsk to scan and repair a Windows 11 hard drive

How and why to run chkdsk to scan and repair a Windows 11 hard drive

Hard drives are destined to fail, resulting in lost data. Regular maintenance with a Windows 11 utility may prevent a major catastrophe.

Scan and repair a hard drive Windows 11
Image: Mark Kaelin

There is one indisputable and inevitable truth about storage technology: It will eventually fail. Whether it is through normal use, mishandling or the mere passage of time, our storage devices are destined to fail and/or become obsolete. The diligent maintenance of our storage devices and the systematic back up of data is still important for Windows 11 users, even in the age of solid-state drives (SSDs) and cloud servers.

SEE: Quick glossary: Storage (TechRepublic Premium)

For those running Windows and using mechanical hard drives, the importance is even more pressing because that storage medium remains most vulnerable to immediate failure.

Throughout modern personal computer history, the mechanical hard drive has been notorious for failing at the most inopportune moments. This is why Windows users with mechanical hard drives should take a moment once a month to perform basic maintenance and run a reliable utility called chkdsk.

A rundown on the chkdsk utility in Windows 11

The utility chkdsk, short for “check disk,” will scan the file system and file system metadata of a hard drive for logical and physical errors. Chkdsk is a hold over from disk operating systems (DOS) and has been included as part of every Windows operating system since the beginning.

When used without parameters, chkdsk displays only the status of the volume and does not fix any errors. While chkdsk can be used from the Windows graphical user interface (GUI), it is most often associated with the command prompt.

The basic chkdsk syntax and the associated parameters and switches include:

chkdsk [<volume>[[<path>]<filename>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b]

  • <volume>: Specifies the drive letter (followed by a colon), mount point or volume name.
  •  [<path>]<filename>: Use with file allocation table (FAT) and FAT32 only. Specifies the location and name of a file or set of files that chkdsk will check for fragmentation. You can use the ? and * wildcard characters to specify multiple files.
  • /f: Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.
  • /v: Displays the name of each file in every directory as the disk is checked.
  • /r: Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors.
  • /x: Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f.
  • /i: Use with the new technology file system (NTFS) only. Performs a less vigorous check of index entries, which reduces the amount of time required to run chkdsk.
  • /c: Use with NTFS only. Does not check cycles within the folder structure, which reduces the amount of time required to run chkdsk.
  • /l[:<size>]: Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size.
  • /b: Use with NTFS only. Clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. /b includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive.
  • /scan: Use with NTFS only. Runs an online scan on the volume.
  • /forceofflinefix: Use with NTFS only. /forceofflinefix must be used with /scan. Bypass all online repair; all defects found are queued for offline repair (for example, chkdsk /spotfix).
  • /perf: Use with NTFS only. /perf must be used with /scan. Uses more system resources to complete a scan as fast as possible. This may have a negative performance impact on other tasks running on the system.
  • /spotfix: Use with NTFS only. Runs spot fixing on the volume.
  • /sdcleanup: Use with NTFS only. Garbage collect unneeded security descriptor data (implies /f).
  • /offlinescanandfix: Runs an offline scan and fix on the volume.
  • /freeorphanedchains: Use with FAT/FAT32/exFAT only. Frees any orphaned cluster chains instead of recovering their contents.
  • /markclean: Use with FAT/FAT32/exFAT only. Marks the volume clean if no corruption was detected, even if /f was not specified.
  • /?: Displays help at the command prompt.

The most used chkdsk command is:

chkdsk /f

This command scans for errors and then fixes the errors and marks the bad sectors, so they are never used again. To perform this task, the drive must be locked. In other words, no other applications may access the drive while chkdsk is running. If it is not possible to lock the drive, the utility will ask if you would like to run chkdsk on the next system startup.

You may run chkdsk on an SSD hard drive without damaging it, but it is generally not necessary. Modern SSD drives have their own built-in maintenance software to handle bad sectors and filing errors. Chkdsk is mostly redundant in those situations.

SEE: Checklist: Cloud storage management (TechRepublic Premium)

Run chkdsk to repair a Windows 11 hard drive

To run chkdsk using the Windows 11 GUI, open Windows File Explorer, navigate to the hard drive volume you would like to scan for errors and right click. From the context menu, select Properties, and then, select the Tools tab (Figure A).

Figure A

Tools menu under the Windows 11 Data (D:) Properties pop-up
Figure A: Scan your hard drive for any errors through the Tools tab on the drive’s Properties menu.

On the Tools tab, click the Check button. Windows 11 might warn you that it has found no errors, but you can scan anyway. This process is the common chkdsk /f command we discussed before. To apply other parameters, you will have to switch to the command prompt.

Search “command prompt” in the Windows 11 desktop search app, and select Run As Administrator from the list of options. From the resulting command prompt screen (Figure B), you can enter a viable chkdsk command with appropriate parameters and switches.

Figure B

administrator command prompt on Windows 11
Figure B: Enter a viable chkdsk command in the command prompt.

It is important to note that if chkdsk finds errors and bad sectors on a hard drive, it will attempt to retrieve lost data before it makes repairs and marks sectors. This recovered data will not be in a form useable by its default application. It will likely only be bits of text or coded data that can be read with Notepad or another text editor. Data corrupted by a failing hard drive is generally mostly lost data, which is why it is so important to back up your data and perform regular maintenance on your storage devices.

Source of Article