The hard disk is one of the most essential hardware elements in any type of operating system since it is impossible to perform tasks such as:
- Install the operating system itself
- Store the information of each user
- Install programs and applications
Now, we currently have two types of hard disk such as mechanical disks (HDD), and solid state disks (SDD) which have notable differences both in the reading and writing of information such as security and speed, but without a doubt that at some point we may be facing some kind of error on the disk, especially internally such as:
- Corrupted data or partition table damaged
- Slow reading of information
- Damage to the main boot record
This type of error has a negative impact on the normal use of the disk, affecting all the actions that we carry out in the system since sudden blockages, reboots or shutdowns can occur. To analyze and correct hard disk problems internally, Microsoft has developed a utility called CHKDSK and today TechnoWikis will thoroughly explain what it is and how to use it correctly in Windows 10..
What is CHKDSK?
CHKDSK (Check Disk) is a tool that checks the file system and file system metadata on a volume in order to detect logical and physical errors, if we use the CHKDSK utility without parameters, only the volume status will be displayed and it does not correct any errors, but if used with the parameters / f, / r, / xo / b, it corrects errors in the selected volume automatically.
Some of the advantages of using CHKDSK in Windows 10 are:
- Perform a scan and repair of physical problems, especially in sectors, of available hard drives
- View and analyze the integrity of the hard disk in real time
- It will be possible to repair logical errors on the hard disk
The general syntax for using CHKDSK is as follows:
chkdsk [<Volume> [[<Route>] <File>]] [/ f] [/ v] [/ r] [/ x] [/ i] [/ c] [/ l [: <Size>]] [/ b]
1. Parameters available in CHKDSK Windows
The parameters available in CHKDSK are
- <Volume>: Indicates the letter of the unit (followed by a colon), the mounting point or the name of the volume to be analyzed
- [<Route>]: This option is used only with the file allocation table (FAT) and FAT32 and allows you to indicate the location and name of a file or files in which chkdsk will execute the fragmentation
- / f: This option corrects errors on the disk, for this the disk must be locked, if not, CHKDSK will display a message indicating if you want to check the unit the next time you restart the computer
- / v: Displays the name of each file in each directory as the hard disk is verified
- / r: This option locates the bad sectors and retrieves readable information, we can add the / f parameter to perform an additional physical disk error analysis
- / x: Force the volume to be disassembled if necessary, there all open controllers of the unit are invalidated. / x also includes the functionality of / f
- / i: Only applies to NTFS unit and is responsible for performing a less thorough check of index entries thus reducing the amount of time required to run chkdsk
- / c: It can also be used only with NTFS and this option does not verify the cycles within the folder structure
- / l [: <Size>]: Only applies to NTFS and changes the size of the log file to the size that is entered
- / b: Only for NTFS and its function is to clear the list of defective clusters in the volume and run a new analysis of all assigned and error free clusters
- / ?: Displays help in the command prompt
Some tips and recommendations when using CHKDSK
- The / io / c switch reduces the amount of time required for CHKDSK analysis by omitting certain volume checks
- For CKHDSK to correct disk errors, it is not possible to have files open on the drive
- It is advisable to make use of CHKDSK over time periods in the FAT and NTFS file systems in order to check for disk errors. Chkdsk examines disk space and disk usage and generates a specific status report for each selected file system
- Chkdsk corrects logical disk errors only if you specify the / f parameter
- We can use the / r parameter to detect physical disk errors in the file system and try to recover data from the affected disk sectors.
Now, there are a number of variables to use with CHKDSK where each one plays an essential role for the analysis and correction of errors, some of these options are:
With this option it will be possible to analyze and search for errors online on an NTFS disk
With this variable, the volume will be automatically dismantled to correct the problems that have been recorded in previous analyzes.
With this command, which is only available for NTFS systems, you will collect and subsequently erase data that the analyzer does not use
This variable performs an offline mode analysis correcting possible errors on the hard disk
This option only applies to NTFS and should be used with the / scan command and its task is to perform an online analysis and send the detected errors to a queue to be repaired offline
chkdsk / scan / forceofflinefix
Only for NTFS and should be used with the / scan command, its mission is to use more resources from the system to perform a quick scan which can affect the stability of the system
When an analysis of the hard disk is carried out with CHKDSK, output codes are generated indicating the result that has been obtained, these codes are:
Disk cleaning (such as garbage collection) was performed or cleaning was not performed because the / f parameter was not specified
The disk could not be verified, errors could not be fixed, or errors were not repaired because / f was not specified
2. How to access CHKDSK through the properties of the Windows drive
The first option we have to use CHKDSK is graphically through the properties of the unit.
Step 1
For this, we must access the file explorer and right click on the respective unit and select the Properties option:
Step 2
The following window will be displayed where we must go to the Tools tab and there we click on the Check button located in the Error checking section:
Step 3
The following window will be displayed:
Step 4
There a superficial analysis is carried out, but it will be possible to click on the Examine unit option in order to perform a deeper analysis, we will see that this task starts:
Step 5
Once this action is finished, the following pop-up window will be displayed:
Step 6
There a summary is generated indicating that no errors were detected in the selected unit, to access a more detailed control, we click on the Show details line and this will redirect us to the event viewer where we will see the following:
There, we can note that CHKDSK is composed of three stages that are:
Stage 1
Examine the basic structure of the file system
Stage 2
Examine the file name link
Stage 3
Security Descriptors Exam
Step 7
This information is useful for administration and control tasks. Now, in case any of the selected units presents an error we will see the following:
Step 8
In this case, we click on the option Repair unit and we will see that the process of analysis and correction of the errors begins:
Once this analysis is completed it will be possible to repair the unit immediately or repair it at the next login.
3. How to use CHKDSK through Linux console
Another alternative to use CHKDSK is through the command prompt, for this it is recommended to access as administrators and there execute the following:
chkdsk / f (Unit)
Remember that the / f parameter detects and corrects errors in the unit:
We can see that the 3 stages of analysis are executed and there we will see explicit results of each of them..
4. How to use CHKDSK with Windows PowerShell
Step 1
The same command above will be possible to use with the PowerShell console and we will see exactly the same result:
chkdsk / f (Unit)
Step 2
Now, we can execute the chkdsk / scan option to detect NTFS disk online errors:
Step 3
It will also be possible to use the following line in order to perform a detailed analysis of the selected unit:
chkdsk (Unit): / f / r / x
We can see how CHKDSK is one of the best tools integrated in Windows 10 for the analysis and correction of errors on the hard disk.