1

is it possible to run xfs repair by re-edit the fstab file?

/dev/mapper/vg-linux_root /                       xfs     defaults        0 0
UUID=7de1dc5c-b605-4a6f-bdf1-f1e869f6ffb9 /boot   xfs     defaults        0 0
/dev/mapper/vg-linux_var /var                     xfs     defaults        0 0
/dev/mapper/vg-linux_swap swap                    swap    defaults        0 0

I am not sure but by replace the last number from 0 to 1 , is it right?

King David
  • 433
  • 4
  • 17

2 Answers2

1

The format of fstab should be :

(Device)  (MountPoint) (FsType) (MountOptions)  (Dump) (FsCheck)

So here FsCheck field can take one of the below values :

0 : fsck is disabled

1 : fsck is enabled with more priority ( mainly for root filesystems )

2 : fsck is enabled for other filesystems with less priority.

So you have to choose one of these options.

Reda Salih
  • 231
  • 2
  • 7
  • 1
    The manual site die.net states that fsck on xfs returns without doing anything, it does not run xfs_repair. https://linux.die.net/man/8/fsck.xfs – Gerrit Mar 21 '20 at 22:05
0

No, a positive passno (6th fstab field) is not sufficient. Yes, it still should be 1 for / and 2 otherwise.

Specific to XFS, fsck.xfs by default does not do anything. Journal recovery at mount may get it into a usable state. But if that fails, the system won't boot, usually requiring booting a rescue target to recover.

However, the system administrator can force fsck.xfs to run xfs_repair(8) at boot time by creating a /forcefsck file or booting the system with "fsck.mode=force" on the kernel command line.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32