3.10. Repairing a File System
When nodes fail with the file system mounted, file system journaling allows fast recovery. However, if a storage device loses power or is physically disconnected, file system corruption may occur. (Journaling cannot be used to recover from storage subsystem failures.) When that type of corruption occurs, you can recover the GFS2 file system by using the fsck.gfs2 command.
Note
If you have previous experience using the gfs_fsck command on GFS file systems, note that the fsck.gfs2 command differs from some earlier releases of gfs_fsck in the in the following ways:
You cannot set the interactive mode with Ctrl-C. Pressing Ctrl-C cancels the fsck.gfs2 command. Do not press Ctrl-C unless you want to cancel the command.
You can increase the level of verbosity by using the -v flag. Adding a second -v flag increases the level again.
You can decrease the level of verbosity by using the -q flag. Adding a second -q flag decreases the level again.
The -n option opens a file system as read-only and answers no to any queries automatically. The option provides a way of trying the command to reveal errors without actually allowing the fsck.gfs2 command to take effect.
Refer to the gfs2.fsck man page for additional information about other command options.
In this example, the GFS2 file system residing on block device /dev/testvol/testlv is repaired. All queries to repair are automatically answered with yes.
[root@dash-01 ~]# fsck.gfs2 -y /dev/testvg/testlv
Initializing fsck
Validating Resource Group index.
Level 1 RG check.
(level 1 passed)
Clearing journals (this may take a while)...
Journals cleared.
Starting pass1
Pass1 complete
Starting pass1b
Pass1b complete
Starting pass1c
Pass1c complete
Starting pass2
Pass2 complete
Starting pass3
Pass3 complete
Starting pass4
Pass4 complete
Starting pass5
Pass5 complete
Writing changes to disk
fsck.gfs2 complete