g.The FSCK command is a very important Linux / Unix utility, it is usually used to check and fix errors in the file system. In fact, it is similar to the chkdsk utility in the way Windows works. It is available for Linux, macOS and FreeBSD operating systems.
g.
File systems are often responsible for organizing the storage and recovery of data. In any case, over time, the file system The cell may be damaged and some parts will become inaccessible. If such inconsistency occurs in your file system, it is recommended to check its integrity.
This can be done using the system utility fsck (Check for file system texture differences). This check can be performed in full at boot time or manually.
In this article we will look at the fsck utility as it is also used to fix CD errors.
When should you use fsck on Linux?
There are several scenarios where we might want to run fsck. Here are some examples:
The startup system is not working.
Files on the system are getting questionable (I often see I / O errors).
Attached motivation (including USB sticks / SD cards) may not work as expected.
Available fsck options
Fsck-Acquisition must be running and granting superuser or root privileges. You can apply it in different ways with arguments. Their absorption will depend on your particular case. Below are some of the most importantAdditional parameters:
-A – used to check all file systems. The stolen list is located in / etc / fstab .
-C – display the next line.
-l – locks the device, which ensures that no other program has to use the section when checking.
-M – do not check fixed file systems.
-N – just show what can be done – no changes are made.
-P – if you need to archive filesystems, including in parallel, root.
-R – do not check the main file system. This is only useful if it includes “ -A “.
-r – Provides statistics for the device being scanned.
-T Do not display title.
-t – enter filesystem for tested methods only. Types can always be comma separated lists. € “
-v Enter an accurate description.
How To Run Fsck To Fix Linux Filesystem Errors
Run fsck in recovery mode Hold down the Shift key while booting to see the entire Grub menu. Choose one of our “Advanced Options”. Then select “Recovery Mode”. Select “fsck” in the next menu.
To run fsck, you almost certainlyYou will need to make sure that the particular partition you are trying to check cannot be mounted. For this article, I am using our own second reader, / dev / sdb , mounted at / mnt .
This is what happens if I try to boot with fsck mounted.