.TH mmfsck 02/16/06 mmfsck Command .SH "Name" .PP \fBmmfsck\fR - Checks and repairs a GPFS file system. .SH "Synopsis" .PP \fBmmfsck\fR \fIDevice\fR [\fB-n\fR | \fB-y\fR] [\fB-c\fR | \fB-o\fR] [\fB-t\fR \fIDirectory\fR] [\fB-v\fR | \fB-V\fR] [\fB-N\fR {\fINode\fR[,\fINode\fR...] | \fINodeFile\fR | \fINodeClass\fR}] .PP The file system must be unmounted before you can run the \fBmmfsck\fR command with any option other than \fB-o\fR. .PP \fBDescription\fR .PP The \fBmmfsck\fR command in offline mode is intended to be used only in situations where there have been disk or communications failures that have caused \fBMMFS_FSSTRUCT\fR error log entries to be issued, or where it is known that disks have been forcibly removed or otherwise permanently unavailable for use in the file system, and other unexpected symptoms are seen by users. In general it is unnecessary to run \fBmmfsck\fR in offline mode unless under the direction of the IBM Support Center. .PP If neither the \fB-n\fR nor \fB-y\fR flag is specified, the \fBmmfsck\fR command runs interactively prompting you for permission to repair each consistency error as reported. It is suggested that in all but the most severely damaged file systems, you run the \fBmmfsck\fR command interactively (the default). .PP The occurrence of I/O errors, or the appearance of a message telling you to run the \fBmmfsck\fR command, may indicate file system inconsistencies. If either situation occurs, use the \fBmmfsck\fR command to check file system consistency and interactively repair the file system. .PP The \fBmmfsck\fR command checks for these inconsistencies: .RS +3 .HP 3 \(bu Blocks marked allocated that do not belong to any file. The corrective action is to mark the block free in the allocation map. .HP 3 \(bu Files for which an inode is allocated and no directory entry exists (orphaned files). The corrective action is to create directory entries for these files in a \fBlost+found\fR subdirectory at the root of this file system. The index number of the inode is assigned as the name. If you do not allow the \fBmmfsck\fR command to reattach an orphaned file, it asks for permission to delete the file. .HP 3 \(bu Directory entries pointing to an inode that is not allocated. The corrective action is to remove the directory entry. .HP 3 \(bu Incorrectly formed directory entries. A directory file contains the inode number and the generation number of the file to which it refers. When the generation number in the directory does not match the generation number stored in the file's inode, the corrective action is to remove the directory entry. .HP 3 \(bu Incorrect link counts on files and directories. The corrective action is to update them with accurate counts. .HP 3 \(bu Cycles in the directory structure. The corrective action is to break any detected cycles. If the cycle was a disconnected cycle, the new top level directory is moved to the \fBlost+found\fR directory. .HP 3 \(bu Invalid policy files. The corrective action is to delete the file. .HP 3 \(bu The \fBmmfsck\fR command checks that each fileset has a root directory, that each linked fileset has exactly one valid junction pointing to it, and that no junctions point to unlinked filesets. In addition, the metadata file of the filesets are checked for consistency with respect to the inode of the file system. .RE .PP If you are repairing a file system due to node failure and the file system has quotas enabled, it is suggested that you run the \fBmmcheckquota\fR command to recreate the quota files. .PP Indications leading you to the conclusion that you should run the \fBmmfsck\fR command include: .RS +3 .HP 3 1. An \fBMMFS_FSSTRUCT\fR along with an \fBMMFS_SYSTEM_UNMOUNT\fR error log entry on any node indicating some critical piece of the file system is inconsistent. .HP 3 2. Disk media failures .HP 3 3. Partial disk failure .HP 3 4. \fBEVALIDATE=214\fR, Invalid checksum or other consistency check failure on a disk data structure, reported in error logs or returned to an application. .RE .PP For further information on recovery actions and how to contact the IBM Support Center, see the \fIGeneral Parallel File System: Problem Determination Guide\fR. .PP If you are running the online \fBmmfsck\fR command to free allocated blocks that do not belong to any files, plan to make file system repairs when system demand is low. This is an I/O intensive activity and it can affect system performance. .PP \fBResults\fR .PP If the file system is inconsistent, the \fBmmfsck\fR command displays information about the inconsistencies and (depending on the option entered) may prompt you for permission to repair them. The \fBmmfsck\fR command tries to avoid actions that may result in loss of data. In some cases, however, it may indicate the destruction of a damaged file. .PP If there are no file system inconsistencies to detect, the \fBmmfsck\fR command reports this information for the file system: .RS +3 .HP 3 \(bu Number of files .HP 3 \(bu Used blocks .HP 3 \(bu Free blocks .RE .PP All corrective actions, with the exception of recovering lost disk blocks (blocks that are marked as allocated but do not belong to any file), require that the file system be unmounted on all nodes. If the \fBmmfsck\fR command is run on a mounted file system, lost blocks are recovered but any other inconsistencies are only reported, not repaired. .PP If a bad disk is detected, the \fBmmfsck\fR command stops the disk and writes an entry to the error log. The operator must manually start and resume the disk when the problem is fixed. .PP The file system must be unmounted on all nodes before the \fBmmfsck\fR command can repair file system inconsistencies. .SH "Parameters" .PP .RS +3 \fB\fIDevice\fR \fR .RE .RS +9 The device name of the file system to be checked and repaired. File system names need not be fully-qualified. \fBfs0\fR is as acceptable as \fB/dev/fs0\fR. .PP This must be the first parameter. .RE .PP .RS +3 \fB-N {\fINode\fR[,\fINode\fR...] | \fINodeFile\fR | \fINodeClass\fR} \fR .RE .RS +9 Specify the nodes to participate in the check and repair of the file system. This command supports all defined node classes. The default is \fBall\fR (all nodes in the GPFS cluster will participate in the check and repair of the file system). .PP For information on how to specify node names, see \fISpecifying nodes as input to GPFS commands\fR in \fIGPFS: Administration and Programming Reference\fR. .RE .SH "Options" .PP .RS +3 \fB-c \fR .RE .RS +9 When the file system log has been lost and the file system is replicated, this option specifies that the \fBmmfsck\fR command attempt corrective action by comparing the replicas of metadata and data. If this error condition occurs, it is indicated by an error log entry. The \fB-c\fR and \fB-o\fR flags are mutually exclusive. .RE .PP .RS +3 \fB-n \fR .RE .RS +9 Specifies a \fBno\fR response to all prompts from the \fBmmfsck\fR command. The option reports inconsistencies but it does not change the file system. To save this information, redirect it to an output file when you issue the \fBmmfsck\fR command. .RE .PP .RS +3 \fB-o \fR .RE .RS +9 Specifies that the file system can be mounted during the operation of the \fBmmfsck\fR command. Online mode does not perform a full file system consistency check, but blocks marked as allocated that do not belong to a file are recovered. The \fB-c\fR and \fB-o\fR flags are mutually exclusive. .RE .PP .RS +3 \fB-y \fR .RE .RS +9 Specifies a \fByes\fR response to all prompts from the \fBmmfsck\fR command. Use this option only on severely damaged file systems. It allows the \fBmmfsck\fR command to take any action necessary for repairs. .RE .PP .RS +3 \fB-t \fIDirectory\fR \fR .RE .RS +9 Specifies the directory to be used for temporary storage during \fBmmfsck\fR command processing. The default directory is \fB/tmp\fR. The minimum space required (in byes) is equal to the maximum number of inodes in the file system multiplied by 8. .RE .PP .RS +3 \fB-v \fR .RE .RS +9 Specifies the output is verbose. .RE .PP .RS +3 \fB-V \fR .RE .RS +9 Specifies the output is verbose and contain information for debugging purposes. .RE .SH "Exit status" .PP .PP .RS +3 \fB0 \fR .RE .RS +9 Successful completion. .RE .PP .RS +3 \fB2 \fR .RE .RS +9 The command was interrupted before it completed checks or repairs. .RE .PP .RS +3 \fB4 \fR .RE .RS +9 The command changed the file system and it must now be restarted. .RE .PP .RS +3 \fB8 \fR .RE .RS +9 The file system contains damage that has not been repaired. .RE .SH "Security" .PP You must have root authority to run the \fBmmfsck\fR command. .PP You may issue the \fBmmfsck\fR command from any node in the GPFS cluster. .PP When using the \fBrcp\fR and \fBrsh\fR commands for remote communication, a properly configured \fB.rhosts\fR file must exist in the root user's home directory on each node in the GPFS cluster. If you have designated the use of a different remote communication program on either the \fBmmcrcluster\fR or the \fBmmchcluster\fR command, you must ensure: .RS +3 .HP 3 1. Proper authorization is granted to all nodes in the GPFS cluster. .HP 3 2. The nodes in the GPFS cluster can communicate without the use of a password, and without any extraneous messages. .RE .SH "Examples" .RS +3 .HP 3 1. To run the \fBmmfsck\fR command on the \fBfs1\fR file system, receive a report, but not fix inconsistencies, issue this command: .sp .nf mmfsck fs1 -n .fi .sp The system displays information similar to: .sp .nf Checking "fs1" Checking inodes Checking inode map file Checking directories and files Checking log files Checking extended attributes file Checking allocation summary file Checking policy file Validated policy 'for stripe group fs1': parsed 3 Placement Rules, 0 Migrate/Delete/Exclude Rules Checking filesets metadata Checking file reference counts Checking file system replication status 1212416 inodes 87560 allocated 0 repairable 0 repaired 0 damaged 0 deallocated 0 orphaned 0 attached 7211746 subblocks 227650 allocated 0 unreferenced 0 deletable 0 deallocated 44504 addresses 0 suspended File system is clean. .fi .sp \fBmmfsck\fR found no inconsistencies in this file system. .HP 3 2. To run the \fBmmfsck\fR command on the \fB/dev/fs2\fR file system, receive a report, and fix inconsistencies, issue this command: .sp .nf mmfsck /dev/fs2 -y\ .fi .sp The system displays information similar to: .sp .nf Checking "/dev/fs2" Checking inodes Checking inode map file Checking directories and files Checking log files Checking extended attributes file Checking file reference counts File inode 6912 is not referenced by any directory. Reattach inode to lost+found? yes Checking file system replication status 33792 inodes 46 allocated 0 repairable 0 repaired 0 damaged 0 deallocated 1 orphaned 1 attached 3332520 subblocks 19762 allocated 0 unreferenced 0 deletable 0 deallocated 728 addresses 0 suspended File system is clean. .fi .sp .RE .SH "See also" .PP mmcheckquota Command .PP mmcrfs Command .PP mmdelfs Command .PP mmdf Command .PP mmlsfs Command .SH "Location" .PP \fB/usr/lpp/mmfs/bin\fR .PP