Show Tabular array of Contents

4.xiv. Repairing a File Arrangement

When nodes neglect with the file arrangement mounted, file organization journaling allows fast recovery. However, if a storage device loses power or is physically disconnected, file organisation corruption may occur. (Journaling cannot be used to recover from storage subsystem failures.) When that type of corruption occurs, you can recover the GFS file system by using the gfs_fsck command.

The gfs_fsck command must be run only on a file system that is unmounted from all nodes.

You should not cheque a GFS file organization at kick time with the gfs_fsck control. The gfs_fsck command can not make up one's mind at boot fourth dimension whether the file organisation is mounted by some other node in the cluster. You should run the gfs_fsck command manually only after the system boots.

To ensure that the gfs_fsck command does not run on a GFS file arrangement at kicking fourth dimension, modify the /etc/fstab file then that the final two columns for a GFS file organization mountain point show "0 0" rather than "ane i" (or any other numbers), every bit in the following case:

/dev/VG12/lv_svr_home	/svr_home	gfs	defaults,noatime,nodiratime,noquota	0 0                      

The gfs_fsck command has changed from previous releases of Scarlet Hat GFS in the following ways:

  • Pressing Ctrl + C while running the gfs_fsck interrupts processing and displays a prompt request whether you would like to abort the command, skip the remainder of the current pass, or proceed processing.

  • You can increase the level of verbosity by using the -5 flag. Adding a 2nd -v flag increases the level again.

  • You can decrease the level of verbosity by using the -q flag. Adding a 2nd -q flag decreases the level over again.

  • The -n option opens a file organisation as read-simply and answers no to any queries automatically. The option provides a manner of trying the command to reveal errors without actually allowing the gfs_fsck command to take consequence.

Refer to the gfs_fsck human being folio, gfs_fsck(8), for additional information nearly other command options.

Running the gfs_fsck command requires system memory above and beyond the memory used for the operating system and kernel. Each cake of retentivity in the file organisation itself requires approximately one byte of boosted retention. Then to estimate the amount of memory you will demand to run the gfs_fsck control on your file system, divide the file arrangement size (in bytes) past the block size.

For instance, for a GFS file organisation that is 16TB with a block size of 4K, dissever 16TB by 4K:

                      17592186044416 / 4096 = 4294967296

This file arrangement requires approximately 4GB of costless retentivity to run the gfs_fsck command. Note that if the block size was 1K, running the gfs_fsck control would crave four times the memory, or 16GB.

Usage

gfs_fsck -y                                                  BlockDevice                                              
-y

The -y flag causes all questions to be answered with yeah. With the -y flag specified, the gfs_fsck command does not prompt you for an reply earlier making changes.

BlockDevice

Specifies the block device where the GFS file system resides.

Instance

In this example, the GFS file system residing on block device /dev/gfsvg/gfslv is repaired. All queries to repair are automatically answered with yes. Because this case uses the -v (verbose) option, the sample output is extensive and repetitive lines accept been elided.

[root@tng3-1]#                                                  gfs_fsck -five -y /dev/gfsvg/gfslv                                                Initializing fsck Initializing lists... Initializing special inodes... Validating Resource Group index. Level ane check. 92 resource groups found. (passed) Setting block ranges... Creating a block list of size 9175040... Immigration journals (this may accept a while)Clearing journal 0 Immigration journal 1 Clearing journal 2 ... Clearing journal 10  Journals cleared. Starting pass1 Checking metadata in Resources Grouping 0 Checking metadata in Resource Group ane ... Checking metadata in Resource Group 91 Pass1 complete       Starting pass1b Looking for duplicate blocks... No duplicate blocks plant Pass1b complete       Starting pass1c Looking for inodes containing ea blocks... Pass1c complete       Starting pass2 Checking directory inodes. Pass2 consummate       Starting pass3 Marking root inode connected Checking directory linkage. Pass3 consummate       Starting pass4 Checking inode reference counts. Pass4 complete       Starting pass5 ... Updating Resource Group 92 Pass5 consummate       Writing changes to disk Syncing the device. Freeing buffers.