View Mounted Disks and Partitions

First, we will have to check whether the disks are mounted or not, for this we will have to run the following command:

df -h

This will give the following output:

df -h command.

To avoid this issue we will use the following command which will unmount the partition:

umount /dev/sdb

Note: This will not return anything but it will unmount the partition.

How to fix fsck File System errors in Ubuntu?

The fsck tool is used widely by Linux and Ubuntu users for checking various types of errors that may occur in the filesystems, windows have a similar facility in which we can scan for broken disks and issues and try to fix them, similarly, the fsck is also used widely in the systems for checking and fixing errors. In This article, We’ll see how to fix fsck errors in Ubuntu and will explore various methods to check and repair filesystem errors seamlessly.

How to fix fsck File System errors in Ubuntu

  • Prerequisites to fix fsck File System errors in Ubuntu
  • How to Check and Repair Filesystem
  • Method 1: View Mounted Disks and Partitions
  • Running fsck for Checking Errors
  • Method 1: Force the fsck to the system root
  • Method 2: Run the fsck in the rescue mode
  • Fix the Detected Error Automatically
  • Fix Detected Errors Automatically with fsck
  • How to Skip Fsck on any Mounted Filesystems

Similar Reads

Prerequisites to fix fsck File System errors in Ubuntu

How to open Terminal in Linux? sudo command in Linux with Examples Introduction to UNIX System...

What is fsck in Ubuntu?

The fsck (file system consistency check) is a type of Linux utility that is used to check for filesystems for various types of errors and issues that may be present. The tool is mainly used for fixing errors and generating the reports for it. So in this article, we will understand this utility and its various commands....

How to Check and Repair Filesystem

to check and repair filesystem, First let’s understand the basic syntax that is used for the fsck utility, following is the basic syntax for the fsck utility:...

Method 1: View Mounted Disks and Partitions

First, we will have to check whether the disks are mounted or not, for this we will have to run the following command:...

Understand the fsck Exit codes

Every time we run the fsck it will return an exit code so it is important to know the exit codes to have an understanding of what the return says, following are the exit codes with their description used in fsck:...

Running fsck for Checking Errors

Sometimes we may have to run the fsck on the partition which is also root in the system, since we can’t run any of the fsck commands when the partition is mounted then we can use one of the following methods:...

Method 1: Force the fsck to the system root

This is very easy as compared to the other method, in this we only have to create a file named “forcefsck” inside of the root partition of our system, for this, we will use the following command:...

Method 2: Run the fsck in the rescue mode

This is a much lengthy process as compared to the 1st method, but still, let’s understand how we can use this method to run the fsck tool:...

Fix the Detected Error Automatically

Now we will have to run the fsck command to check for errors, for this, we will use the following command:...

Fix Detected Errors Automatically with fsck

We can also fix any errors that occur automatically by using the following command:...

How to Skip Fsck on any Mounted Filesystems

If you want to skip any fsck for a specific filesystem from checking, then you will have to add -t and then you will add “no” before any particular filesystem, let’s understand with an example, if we want to skip ext3 filesystem then we can run the following command for this:...

Conclusion

In this article, we understood what fsck utility is and looked at some of the methods to implement fsck and also understood how we can fix the errors in the Ubuntu system using the fsck utility tool, follow this article and you will have a good understanding about the fsck utility and how it’s used. It was all about What is fsck and How to fix fsck errors in Ubuntu?...

How to Fix fsck errors in Ubuntu – FAQs

How to use fsck to check and repair disk errors?...

Contact Us