-2

we have redhat machines version - 6.x

all disks that mounted have xfs files system as:

UUID=198s5364-a29c-429e-b16d-e772acd /data_SA              xfs     rw,noatime,inode64,allocsize=16m 1 2

we want to fix the file system on some of the disks,

what is the right approach to use

  1. xfs_repair
  2. fsck.xfs
  3. fsck
shalom
  • 451
  • 12
  • 26

2 Answers2

0

From the fsck man page:

   fsck.xfs  is called by the generic Linux fsck(8) program at startup to check and repair an XFS filesystem.  XFS is a journaling filesystem and performs recovery at mount(8) time if
   necessary, so fsck.xfs simply exits with a zero exit status.

   If you wish to check the consistency of an XFS filesystem, or repair a damaged or corrupt XFS filesystem, see xfs_repair(8).
Daniel
  • 302
  • 1
  • 5
  • xfs_repair if you need to check/repair the filesystem, fsck.xfs dose nothing it just exits with 0 for compatibility – Daniel May 02 '18 at 12:24
  • @shalom: "If you wish to check the consistency of an XFS filesystem, or repair a damaged or corrupt XFS filesystem, see xfs_repair(8)." – Janne Pikkarainen May 02 '18 at 12:27
0

the best option is by xfs_repair

the steps are:

first find your device UUID in /dev/disk/by-uuid

find what is the disk that is related to the mount point folder

Example : According to the /etc/fstab the disk is data_SA

UUID=198s5364-a29c-429e-b16d-e772acd /data_SA              xfs     rw,noatime,inode64,allocsize=16m 1 2

Unmount the mount point folder

umount /data_SA ( or umount –l /data_SA  if it say busy )

Repair the file-system as the following:

xfs_repair /dev/disk/by-uuid/198s5364-a29c-429e-b16d-e772acd

Finally mount again the mount point folder

mount /data_SA
shalom
  • 451
  • 12
  • 26