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


Linux file systems are generally robust and works 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. 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

We will start with listing mounted partitions and their file system information.

Check Device With Fsck

We  will check a block device other 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 mounted file system. So we need to unmount and check the file system.

We have check an unmounted file system like above named vdb1

LEARN MORE  Cockpit Easy and Web Administration of Linux

It seams it is clean and no problem

Provide File System As Parameter

We can provide file system as 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 error. And every time we have to press yes to accept. We can provide -y to accept all questions.

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)