mmsnapdir command

Controls how the special directories that connect to snapshots appear.

Synopsis

mmsnapdir Device [-r | -a]
    [--show-global-snapshots {rootfileset | allfilesets}]
    [{[--fileset-snapdir FilesetSnapDirName] [--global-snapdir GlobalSnapDirName]}
     | {{--snapdir | -s} SnapDirName}]

or

mmsnapdir Device [-q]

Availability

Available on all IBM Spectrum Scale™ editions.

Description

Use the mmsnapdir command to control how the special directories that connect to snapshots appear. Both the name of the directories and where they are accessible can be changed.

Global snapshots appear in a subdirectory in the root directory of the file system, whose default name is .snapshots. Fileset snapshots appear in a similar .snapshots subdirectory located in the root directory of each independent fileset. These special subdirectories are collectively referred to as snapdirs. Note that the root directory of the file system and the root directory of the root fileset are the same, so global snapshots and fileset snapshots of the root fileset will both appear in the same snapdir.

If you prefer to access the snapshots from each directory rather than traversing through the root directory, you can use an invisible directory to make the connection by issuing the mmsnapdir command with the -a option (see "Examples"). The -a option enables an invisible directory in each directory in the active file system (they do not appear in directories in snapshots) that contains a subdirectory for each existing snapshot of the file system (in the root fileset) or fileset (in other independent filesets). These subdirectories correspond to the copy of the active directory in the snapshot with the same name. For example, if you enter ls -a /fs1/userA, the (invisible) .snapshots directory is not listed. However, you can use ls /fs1/userA/.snapshots, for example, to confirm that .snapshots is present and contains the snapshots holding copies of userA. When the -a option is enabled, the paths /fs1/.snapshots/Snap17/userA and /fs1/userA/.snapshots/Snap17 refer to the same directory, namely userA at the time when Snap17 was created. The -r option (root-directories-only), which is the default, reverses the effect of the -a option (all-directories), and disables access to snapshots via snapdirs in non-root directories.

If you prefer to access global snapshots from the root directory of all independent filesets, use the mmsnapdir command with the --show-global-snapshots allfilesets option. With this option, global snapshots will also appear in the snapdir in the fileset root directory. The global snapshots will also appear in the snapdirs in each non-root directory if all-directories (the -a option) is enabled. To return to the default setting use --show-global-snapshots rootfileset, and global snapshots will only be available in root of the file system, or the root fileset, if all-directories is enabled.

The name of the snapdir directories can be changed using the --snapdir (or -s) option. This name is used for both global and fileset snapshots in both fileset root directories and, if all-directories is enabled, non-root directories also. The snapdir name for global and fileset snapshots can be specified separately using the --global-snapdir and --fileset-snapdir options. If these names are different, two snapdirs will appear in the file system root directory, with the global and fileset snapshots listed separately. When --show-global-snapshots is set to allfilesets, two snapdirs will appear in fileset root directories also, and when all-directories (the -a option) is specified, the two snapdirs will be available in non-root directories as well. If --global-snapdir is specified by itself, the fileset snapdir name is left unchanged, and vice versa if --fileset-snapdir option is used. Setting both snapdirs to the same name is equivalent to using the --snapdir option. The snapdir name enabled in non-root directories by all-directories is always the same as the name used in root directories.

For more information on global snapshots, see Creating and maintaining snapshots of file systems in the IBM Spectrum Scale: Administration Guide.

For more information on fileset snapshots, see Fileset-level snapshots in the IBM Spectrum Scale: Administration Guide.

Parameters

Device
The device name of the file system. File system names need not be fully-qualified. fs0 is just as acceptable as /dev/fs0.

This must be the first parameter.

-a
Adds a snapshots subdirectory to all subdirectories in the file system.
-r
Reverses the effect of the -a option. All invisible snapshot directories are no longer accessible. The snapshot directory under the file system root directory is not affected.
--show-global-snapshots {rootfileset | allfilesets}
This option controls whether global snapshots are accessible through a subdirectory under the root directory of all independent filesets (allfilesets) or only in the file system root (rootfileset). For example, issuing the following command:
mmsnapdir fs1 --show-global-snapshots allfilesets
specifies that the root directory of each independent fileset will contain a .gsnaps subdirectory listing all global snapshots, such as /fs1/junctions/FsetA/.gsnaps and /fs1/junctions/FsetA/.fsnaps. This can be used to make global snapshots accessible to clients, for example NFS users, that do not have access to the file system root directory.

Specifying rootfileset reverses this feature, restoring the default condition, so that global snapshots are only visible in the root fileset.

--fileset-snapdir FilesetSnapDirName
--global-snapdir GlobalSnapDirName
The --global-snapdir option specifies the name for the directory where global snapshots are listed. The --fileset-snapdir option specifies the name for the directory where fileset snapshots are listed. These options can be specified together or separately, in which case only the corresponding snapdir is changed. Neither option may be specified with --snapdir, which sets both to the same name.
For example, after issuing the command:
mmsnapdir fs1 --fileset-snapdir .fsnaps --global-snapdir .gsnaps
the directory /fs1/.gsnaps will list all global snapshots and /fs1/.fsnaps will only list fileset snapshots of the root fileset. Fileset snapshots of other independent filesets will be listed in .fsnaps under the root directory of each independent fileset, such as /fs1/junctions/FsetA/.fsnaps.
--snapdir | -s SnapDirName
Changes the name of the directory for both global and fileset snapshots to SnapDirName. This affects both the directory in the file system root as well as the invisible directory in the other file system directories if the -a option has been enabled. The root and non-root snapdirs cannot be given different names.
-q
Displays current snapshot settings. The -q option cannot be specified with any other options. This is the default if no other options are specified.

Exit status

0
Successful completion.
nonzero
A failure has occurred.

Security

If you are a root user, 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.

You must be a root user to use all of the mmsnapdir options. Non-root users can only use the -q option.

If you are a non-root user, you may only specify file systems that belong to the same cluster as the node on which the mmsnapdir command was issued.

Examples

  1. To rename the .snapshots directory (the default snapshots directory name) to .link for file system fs1, issue the command:
    mmsnapdir  fs1 -s .link
    After the command has been issued, the directory structure would appear similar to:
    /fs1/file1
    /fs1/userA/file2
    /fs1/userA/file3
    
    /fs1/.link/snap1/file1
    /fs1/.link/snap1/userA/file2
    /fs1/.link/snap1/userA/file3
  2. To add the .link subdirectory to all subdirectories in the file system, issue:
    mmsnapdir fs1 -a
    After the command has been issued, the directory structure would appear similar to:
    /fs1/file1
    /fs1/userA/file2
    /fs1/userA/file3
    /fs1/userA/.link/snap1/file2
    /fs1/userA/.link/snap1/file3
    
    /fs1/.link/snap1/file1
    /fs1/.link/snap1/userA/file2
    /fs1/.link/snap1/userA/file3

    The .link subdirectory under the root directory and under each subdirectory of the tree provides two different paths to each snapshot copy of a file. For example, /fs1/userA/.link/snap1/file2 and /fs1/.link/snap1/userA/file2 are two different paths that access the same snapshot copy of /fs1/userA/file2.

  3. To reverse the effect of the previous command, issue:
    mmsnapdir fs1 -r
    After the command has been issued, the directory structure would appear similar to:
    /fs1/file1
    /fs1/userA/file2
    /fs1/userA/file3
    
    /fs1/.link/snap1/file1
    /fs1/.link/snap1/userA/file2
    /fs1/.link/snap1/userA/file3
  4. To display the current snapshot settings, issue:
    mmsnapdir fs1 -q
    The system displays output similar to:
    Snapshot directory for "fs1" is ".link" (root directory only)
    If there are independent filesets, fileset snapshots, or the global and fileset snapshot directory names are different in the file system, the system displays output similar to:
    Fileset snapshot directory for "fs1" is ".link" (root directory only)
    Global snapshot directory for "fs1" is ".link" in root directory only

Location

/usr/lpp/mmfs/bin