Linux Administrator

How to:- Repair XFS Filesystem with “xfs_repair” using Single User Mode CentOS 7/8

In this article I will explain how to repair XFS Filesystem with ifs_repair using single user mode on CentOS 7/8 . Sometime it happens that our file system on the partition get corrupted and we need to report it.

So we need to repair file system we need to unmount the partition to make sure there is no any running process using the partition. You can do this only in single user mode or rescue mode.

Sometime it also happen due to some reason your system unable to reachable so in such cases it becomes mandatory to boot it into secure mode or single user mode and then perform repairing.

You may also like:

Let’s see how we can repair file system in secure mode or single user mode.

Please note: Before doing this activity first take  full backup.

Repair XFS Filesystem with xfs_repair using single user mode or secure mode

Follow these below steps to repair file system in secure mode or single user mode:

Step #1 : Boot system into rescue mode

First of all boot system into rescue mode using Live DVD which is used to install CentOS/ Redhat. After booting system with Live DVD you will get some out put like below:

CentOS 8

Install Red Hat Enterprise Linux 8.0.0
Test this media & install Red Hat Enterprise Linux 8.0.0
Troubleshooting             [Select this Options]

CentOS 7

Install Red Hat Enterprise Linux 7.0 in basic graphics mode
Rescue a Red Hat Enterprise Linux system  [Select this Options]
Run a memory test
Boot from local drive
Return to main menu

Now on the next screen press “3” to Skip to shell so that we can manually  mount repaired file system.

Now we can safely repair filesystem in single user mode or rescue mode at this time because now our partition and volumes is in the rescue mode and we have not mounted them and they are not in use  by the system process.

Let’s repair XFS Filesystem with xfs_repair command.

Follow these below commands to repair XFS Filesystem with ifs_repair command.

# xfs_repair /dev/mapper/<vg>-<lv>
or
# xfs_repair /dev/<sd device>
or
# xfs_repair /dev/<md device>

Once XFS Filesystem repaired in rescue mode exit from rescue mode and boot the system normally.

FAQs

What is XFS Filesystem?

XFS Filesystem is a robust and high-performance 64-bit journaling file system that are used for very large files and systems on a host and it is default file system in Redhat Hat Enterprise Linux 7.

What is XFS full form?

XFS stand for Extended File system or ext. It was implemented in April 1992 as the first file system in Linux Kernel.

Is XFS reliable?

XFS and JFS both are originally designed  for the servers, so we can say that both are built for high work load. XFS is very mature, stable and proven reliable.

Is XFS faster than EXT4 Filesystem?

Yes, XFS Filesystem much as 50% faster  than EXT4 Filesystem.

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment