The mmfileid command

The mmfileid command identifies files that are on areas of a disk that are damaged or suspect.

Attention: Use this command only when the IBM® Support Center directs you to do so.

Before you run mmfileid, you must run a disk analysis utility and obtain the disk sector numbers that are damaged or suspect. These sectors are input to the mmfileid command.

The command syntax is as follows:
mmfileid Device
 {-d DiskDesc | -F DescFile}
 [-o OutputFile] [-f NumThreads] [-t Directory]
 [-N {Node[,Node...] | NodeFile | NodeClass}] [--qos QOSClass]
The input parameters are as follows:
Device
The device name for the file system.
-d DiskDesc
A descriptor that identifies the disk to be scanned. DiskDesc has the following format:
NodeName:DiskName[:PhysAddr1[-PhysAddr2]]

It has the following alternative format:

:{NsdName|DiskNum|BROKEN}[:PhysAddr1[-PhysAddr2]]
NodeName
Specifies a node in the GPFS cluster that has access to the disk to scan. You must specify this value if the disk is identified with its physical volume name. Do not specify this value if the disk is identified with its NSD name or its GPFS disk ID number, or if the keyword BROKEN is used.
DiskName
Specifies the physical volume name of the disk to scan as known on node NodeName.
NsdName
Specifies the GPFS NSD name of the disk to scan.
DiskNum
Specifies the GPFS disk ID number of the disk to scan as displayed by the mmlsdisk -L command.
BROKEN
Tells the command to scan all the disks in the file system for files with broken addresses that result in lost data.
PhysAddr1[-PhysAddr2]
Specifies the range of physical disk addresses to scan. The default value for PhysAddr1 is zero. The default value for PhysAddr2 is the value for PhysAddr1.

If both PhysAddr1 and PhysAddr2 are zero, the command searches the entire disk.

The following lines are examples of valid disk descriptors:
k148n07:hdisk9:2206310-2206810
:gpfs1008nsd:
:10:27645856
:BROKEN
-F DescFile
Specifies a file that contains a list of disk descriptors, one per line.
-f NumThreads
Specifies the number of worker threads to create. The default value is 16. The minimum value is 1. The maximum value is the maximum number allowed by the operating system function pthread_create for a single process. A suggested value is twice the number of disks in the file system.
-N {Node[,Node...] | NodeFile | NodeClass}
Specifies the list of nodes that participate in determining the disk addresses. This command supports all defined node classes. The default is all or the current value of the defaultHelperNodes configuration parameter of the mmchconfig command.

For general information on how to specify node names, see Specifying nodes as input to GPFS commands.

-o OutputFile
The path name of a file to which the result from the mmfileid command is to be written. If not specified, the result is sent to standard output.
-t Directory
Specifies the directory to use for temporary storage during mmfileid command processing. The default directory is /tmp.
--qos QOSClass
Specifies the Quality of Service for I/O operations (QoS) class to which the instance of the command is assigned. If you do not specify this parameter, the instance of the command is assigned by default to the maintenance QoS class. This parameter has no effect unless the QoS service is enabled. .For more information, see mmchqos command. Specify one of the following QoS classes:
maintenance
This QoS class is typically configured to have a smaller share of file system IOPS. Use this class for I/O-intensive, potentially long-running GPFS commands, so that they contribute less to reducing overall file system performance.
other
This QoS class is typically configured to have a larger share of file system IOPS. Use this class for administration commands that are not I/O-intensive.
For more information, see the Setting the Quality of Service for I/O operations topic.

You can redirect the output to a file with the -o flag and sort the output on the inode number with the sort command.

The mmfileid command output contains one line for each inode found to be on a corrupted disk sector. Each line of the command output has this format:
InodeNumber   LogicalDiskAddress   SnapshotId   Filename
InodeNumber
Indicates the inode number of the file identified by mmfileid.
LogicalDiskAddress
Indicates the disk block (disk sector) number of the file identified by mmfileid.
SnapshotId
Indicates the snapshot identifier for the file. A SnapshotId of 0 means that the file is not a snapshot file.
Filename
Indicates the name of the file identified by mmfileid. File names are relative to the root of the file system in which they reside.
Assume that a disk analysis tool reports that disks hdisk6, hdisk7, hdisk8, and hdisk9 contain bad sectors, and that the file addr.in has the following contents:
k148n07:hdisk9:2206310-2206810
k148n07:hdisk8:2211038-2211042
k148n07:hdisk8:2201800-2202800
k148n01:hdisk6:2921879-2926880
k148n09:hdisk7:1076208-1076610
You run the following command:
mmfileid /dev/gpfsB -F addr.in
The command output might be similar to the following example:
Address 2201958 is contained in the Block allocation map (inode 1)
Address 2206688 is contained in the ACL Data file (inode 4, snapId 0)
Address 2211038 is contained in the Log File (inode 7, snapId 0)
14336 1076256 0 /gpfsB/tesDir/testFile.out
14344 2922528 1 /gpfsB/x.img
The lines that begin with the word Address represent GPFS system metadata files or reserved disk areas. If your output contains any lines like these, do not attempt to replace or repair the indicated files. If you suspect that any of the special files are damaged, call the IBM Support Center for assistance.
The following line of output indicates that inode number 14336, disk address 1072256 contains file /gpfsB/tesDir/testFile.out. The 0 to the left of the name indicates that the file does not belong to a snapshot. This file is on a potentially bad disk sector area:
14336 1072256 0 /gpfsB/tesDir/testFile.out
The following line of output indicates that inode number 14344, disk address 2922528 contains file /gpfsB/x.img. The 1 to the left of the name indicates that the file belongs to snapshot number 1. This file is on a potentially bad disk sector area:
14344 2922528 1 /gpfsB/x.img