4.14. Repairing a File System
gfs_fsckcommand must be run only on a file system that is unmounted from all nodes.
gfs_fsckcommand can not determine at boot time whether the file system is mounted by another node in the cluster. You should run the
gfs_fsckcommand manually only after the system boots.
gfs_fsckcommand does not run on a GFS file system at boot time, modify the
/etc/fstabfile so that the final two columns for a GFS file system mount point show "0 0" rather than "1 1" (or any other numbers), as in the following example:
/dev/VG12/lv_svr_home /svr_home gfs defaults,noatime,nodiratime,noquota 0 0
gfs_fsckcommand has changed from previous releases of Red Hat GFS in the following ways:
- Pressing Ctrl+C while running the
gfs_fsckinterrupts processing and displays a prompt asking whether you would like to abort the command, skip the rest of the current pass, or continue processing.
- You can increase the level of verbosity by using the
-vflag. Adding a second
-vflag increases the level again.
- You can decrease the level of verbosity by using the
-qflag. Adding a second
-qflag decreases the level again.
-noption opens a file system as read-only and answers
noto any queries automatically. The option provides a way of trying the command to reveal errors without actually allowing the
gfs_fsckcommand to take effect.
gfs_fsck(8), for additional information about other command options.
gfs_fsckcommand requires system memory above and beyond the memory used for the operating system and kernel. Each block of memory in the file system itself requires approximately one byte of additional memory. So to estimate the amount of memory you will need to run the
gfs_fsckcommand on your file system, divide the file system size (in bytes) by the block size.
17592186044416 / 4096 = 4294967296
gfs_fsckcommand. Note that if the block size was 1K, running the
gfs_fsckcommand would require four times the memory, or 16GB.
-yflag causes all questions to be answered with
yes. With the
-yflag specified, the
gfs_fsckcommand does not prompt you for an answer before making changes.
- Specifies the block device where the GFS file system resides.
/dev/gfsvg/gfslvis repaired. All queries to repair are automatically answered with
yes. Because this example uses the
-v(verbose) option, the sample output is extensive and repetitive lines have been elided.
gfs_fsck -v -y /dev/gfsvg/gfslvInitializing fsck Initializing lists... Initializing special inodes... Validating Resource Group index. Level 1 check. 92 resource groups found. (passed) Setting block ranges... Creating a block list of size 9175040... Clearing journals (this may take a while)Clearing journal 0 Clearing journal 1 Clearing journal 2 ... Clearing journal 10 Journals cleared. Starting pass1 Checking metadata in Resource Group 0 Checking metadata in Resource Group 1 ... Checking metadata in Resource Group 91 Pass1 complete Starting pass1b Looking for duplicate blocks... No duplicate blocks found Pass1b complete Starting pass1c Looking for inodes containing ea blocks... Pass1c complete Starting pass2 Checking directory inodes. Pass2 complete Starting pass3 Marking root inode connected Checking directory linkage. Pass3 complete Starting pass4 Checking inode reference counts. Pass4 complete Starting pass5 ... Updating Resource Group 92 Pass5 complete Writing changes to disk Syncing the device. Freeing buffers.