mmrestripefile command

Rebalances or restores the replication factor of the specified files, performs any incomplete or deferred file compression or decompression, or detects and repairs data and directory block replica mismatches in the specified files.

Synopsis

mmrestripefile [-f] {-m | -r | -p | -b [--strict] | -l | -c [--read-only] | -z}
                {--inode-number [SnapPath/]InodeNumber [[SnapPath/]InodeNumber...] | 
                --inode-number-file InodeNumberFile |
                -F FilenameFile | Filename [Filename...]}

Availability

Available on all IBM Storage Scale editions.

Description

The mmrestripefile command attempts to repair the specified files, performs any deferred or incomplete compression or decompression of the specified files, or detects and repairs data and directory block replica mismatches in the specified files. Use -F option to specify a file that contains the list of file names to be processed or the --inode-number-file option to specify the list of inode numbers to be processed, with one file name per line.

The repair options are rebalancing (-b), restoring replication factors (-r), migrating data (-m), migrating file data to the proper pool (-p), relocating the block placement of the files (-l), data and directory block replica compare and repair (-c), and performing any deferred or incomplete compression or decompression (-z). The -b option not only rebalances files but also performs all the operations of the -m and -r options. For more information, see Restriping a GPFS file system.

CAUTION:
Do not run the mmrestripefs or mmrestripefile command while an mmrestorefs command is running.

Parameters

--inode-number [SnapPath/]InodeNumber
Specifies the inode number of the file to be restriped. If the current working directory is not already inside the active file system or snapshot, then the inode number must be prefixed by the path to the active file system or snapshot. For example:
mmrestripefile –inode-number /fs0/.snapshots/snap1/34608
You must have root authority to use this option.
--inode-number-file InodeNumberFile
Specifies a file that contains a list of inode numbers of files to be restriped, one inode number per line. You must have root authority to use this option.
-F FilenameFile
Specifies a file that contains a list of names of files to be restriped, one name per line.
Filename
Specifies the names of one or more files to be restriped.

Options

Start of change-fEnd of change
Start of changeRuns the action forcibly regardless of whether the file status shows the required action or not. For example, the flags field in an mmlsattr -L command output is showing blank but the mmlsattr -D command may display a data block placement which is inconsistent with the outcome expected from running the mmrestripefile -b --strict command. To forcibly distribute file blocks evenly across the disks of the file system run the mmrestripefile -f -b --strict command.End of change
-m
Migrates critical data from any suspended disk for a list of specified files. Critical data is all data that would be lost if currently suspended disks were removed.
-r
Migrates all data for a list of files from suspended disks. If a disk failure or removal makes some replicated data inaccessible, this command also restores replicated files to their designated level of replication. Use this option immediately after a disk failure to protect replicated data against a subsequent failure. You can also use this option before you take a disk offline for maintenance to protect replicated data against the failure of another disk during the maintenance process.
-p
Moves the data of ill-placed files to the correct storage pool.

Some utilities, including the mmchattr command, can assign a file to a different storage pool without moving the data of the file to the new pool. Such files are called ill-placed. The -p parameter causes the command to move the data of ill-placed files to the correct storage pools.

-b [--strict]
Rebalances the specified files to improve file system performance. Rebalancing attempts to distribute file blocks evenly across the disks of the file system. In IBM Storage Scale 5.0.0 and later, rebalancing is implemented by a lenient round-robin method that typically runs faster than the previous method of strict round robin. To rebalance the file system using the strict round-robin method, include the --strict option.
--strict
Rebalances the specified files with a strict round-robin method. In IBM Storage Scale 4.2.3 and earlier versions, rebalancing always uses this method.
Note: Rebalancing distributes file blocks across all the disks in the cluster that are not suspended, including stopped disks. For stopped disks, rebalancing does not allow read operations and allocates data blocks without writing them to the disk. When the disk is restarted and replicated data is copied onto it, the file system completes the write operations.
-l
Relocates the block placement of the file. The location of the blocks depends on the current write affinity depth, write affinity failure group setting, block group factor, and the node from which the command is run. For example, for an existing file, regardless of how its blocks are distributed on disks currently, if mmrestripefile -l is run from node A, the final block distribution looks as if the file was created from scratch on node A.
To specify the write affinity failure group where the replica is put, before you run mmrestripefile -l, enter a command like the following example:
mmchattr --write-affinity-failure-group "WadfgValueString" filename
where WadfgValueString is the failure group.
-c [--read-only]
Compares the data or directory blocks of the specified files with their replicas and attempts to fix any mismatches. This option does not compare metadata blocks like indirect blocks. It also does not compare files whose size is less than the inode size, because their data is stored in the inode. To find the inode size, enter the following command:
mmlsfs <file_system_name> -i
--read-only
Only compares replicas and does not attempt to fix any mismatches.
-z
Performs any deferred or incomplete compression or decompression of files. For more information, see the topic File compression.

Exit status

0
Successful completion.
nonzero
A failure has occurred.

Security

You must have write access to the file to run the mmrestripefile command unless you run with the -c --read-only option, in which case read access to the file is sufficient.

The node on which the command is issued must be able to execute remote shell commands on any other node in the cluster without the use of a password and without producing any extraneous messages. For more information, see Requirements for administering a GPFS file system.

Examples

This example illustrates restriping a file that is named testfile0. The following command confirms that the file is ill-placed:
mmlsattr -L testfile0
The system displays the following output:
file name:            testfile0
metadata replication: 2 max 2
data replication:     2 max 2
immutable:            no
appendOnly:           no
flags:                illplaced
storage pool name:    system
fileset name:         root
snapshot name:
To correct the problem, issue the following command:
mmrestripefile -p testfile0
To confirm the change, issue the following command:
mmlsattr -L testfile0
The system displays the following output:
file name:            testfile0
metadata replication: 2 max 2
data replication:     2 max 2
immutable:            no
appendOnly:           no
flags:                
storage pool name:    system
fileset name:         root
snapshot name:
The following command compresses or decompresses a file for which compression or decompression is deferred or incomplete:
mmrestripefile -z  largefile.data

See also

Location

/usr/lpp/mmfs/bin