How To Repair Ext2, Ex3, Ext4 File System In Linux? – POFTUT

How To Repair Ext2, Ex3, Ext4 File System In Linux?

Linux file systems are generally robust and work very well. But it can happen errors rarely. How can we check and fix these file system errors? Fsck is a check and repair utility for Linux file systems. Fsck can check and repair one or more file system. The file system can be a device or a mount point. If no file system is specified /etc/fstab entries are checked serially.

List Mounts And File Systems

First, we will start by listing mounts and partitions. We can use different commands but in this case, we will use the mount command without any options.

List Mounts And File Systems

List Mounts And File Systems

Check Device With Fsck

We  will check a block device another name a disk with fsck

Our file system in this example is xfs so there is another tool named xfs_repair.

As we see in this example we can not check the mounted file system. So we need to unmount and check the file system.

We have check an unmounted file system like above named vdb1. It seems it is clean and no problem

LEARN MORE  Linux fsck Command Tutorial With Examples

Provide File System As Parameter

We can provide a file system as a parameter like below

Accept All Question While Check

If there are a lot of errors fsck will ask you a lot of questions whether you want to correct the error. And every time we have to press yes to accept. We can provide -y to accept all questions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)