Hard drives are bound to fail, resulting in data loss. Regular maintenance with a Windows 11 utility can prevent a major disaster.
There is one indisputable and unavoidable truth about storage technology: it will eventually fail. Whether it’s normal use, mishandling, or the simple passage of time, our storage devices are bound to fail and/or become obsolete. Diligent maintenance of our storage devices and systematic data backup are still important for Windows 11 users, even in the age of SSD drives and cloud servers.
SEE: Quick Glossary: Storage (TechRepublic Premium)
For those using Windows and using mechanical hard drives, the importance is even more pressing as this storage medium remains the most vulnerable to immediate failure.
Throughout the history of the modern personal computer, the mechanical hard drive has been known to fail at the most inopportune times. That’s why Windows users with mechanical hard drives should take a moment once a month to do some basic maintenance and run a reliable utility called chkdsk.
An overview of the chkdsk utility in Windows 11
The chkdsk utility, 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 backup of disk operating systems (DOS) and has been included in every Windows operating system since the beginning.
When used without parameters, chkdsk only displays volume status and does not fix any errors. Although chkdsk can be used from the graphical user interface (GUI) of Windows, it is most commonly associated with the command prompt.
The basic chkdsk syntax and associated parameters and switches include:
:Specifies the drive letter (followed by a colon), mount point, or volume name.
]For 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 * wildcards to specify multiple files. :
- /F: Fix errors on the disc. The disc must be locked. If chkdsk fails to lock the drive, a message appears asking if you want to check the drive the next time you restart the computer.
- /v: Shows the name of each file in each directory when checking the disk.
- /r: Locates bad sectors and recovers readable information. The disc must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors.
- /X: Forces the volume to unmount first, if necessary. All open handles to the reader are invalidated. /x also includes /f functionality.
- /I: For use with New Technology File System (NTFS) only. Performs less vigorous checking of index entries, which reduces the time it takes to run chkdsk.
- /vs : Use only with NTFS. Does not check for cycles in the folder structure, reducing the time it takes to run chkdsk.
]:Use only with NTFS. Changes the log file size to the size you enter. If you omit the size parameter, /l displays the current size.
- /b: Use only with NTFS. 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 setting after imaging a volume to a new hard drive.
- /to analyse: Use only with NTFS. Runs an online scan on the volume.
- /forceofflinefix: Use only with NTFS. /forceofflinefix should be used with /scan. Bypass all online repairs; any defects found are queued for offline repair (eg chkdsk /spotfix).
- /perf: Use only with NTFS. /perf should be used with /scan. Uses more system resources to perform a scan as quickly as possible. This can negatively impact the performance of other tasks running on the system.
- /spotfix: Use only with NTFS. Executes point fixing on the volume.
- /sdcleanup: Use only with NTFS. Garbage collects unnecessary security descriptor data (implies /f).
- /offlinescanandfix: Runs an offline scan and patch on the volume.
- /freeorphanedchains: Use only with FAT/FAT32/exFAT. Frees all orphaned cluster chains instead of retrieving their contents.
- /markclean: Use only with FAT/FAT32/exFAT. Marks the volume as clean if no corruption was detected, even if /f was not specified.
- /? : Display help at the command prompt.
The most used chkdsk command is:
This command checks for errors, 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 application can access the drive while chkdsk is running. If it is not possible to lock the drive, the utility will ask you if you want to run chkdsk at the next system boot.
You can run chkdsk on an SSD hard drive without damaging it, but it’s usually not necessary. Modern SSDs have their own built-in maintenance software to deal with bad sectors and misclassifications. Chkdsk is mostly redundant in these situations.
SEE: Checklist: Cloud Storage Management (TechRepublic Premium)
Run chkdsk to repair Windows 11 hard drive
To run chkdsk using the Windows 11 GUI, open Windows File Explorer, navigate to the hard drive volume you want to scan, and right-click. From the context menu, select Properties, then select the Tools tab (Figure A).
On the Tools tab, click the Check button. Windows 11 may warn you that it found no errors, but you can still run a scan. This process is the common chkdsk /f command we discussed earlier. To apply other settings, you will need to switch to the command prompt.
Search for “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 the appropriate parameters and switches.
It is important to note that if chkdsk finds errors and bad sectors on a hard drive, it will attempt to recover the lost data before performing repairs and marking the sectors. This recovered data will not be in a usable form by its default application. It will probably just be chunks of text or coded data that can be read with Notepad or another text editor. Data corrupted by a failing hard drive is usually data lost, which is why it’s so important to back up your data and perform regular maintenance on your storage devices.