mmcrsnapshot command
Creates a snapshot of a file system or fileset at a single point in time.
Synopsis
mmcrsnapshot Device SnapshotName [-j Fileset]
Availability
Available on all IBM Spectrum Scale™ editions.
Description
Use the mmcrsnapshot command to create global snapshots or fileset snapshots at a single point in time. System data and existing snapshots are not copied. The snapshot function allows a backup or mirror program to run concurrently with user updates and still obtain a consistent copy of the file system as of the time the copy was created. Snapshots also provide an online backup capability that allows easy recovery from common problems such as accidental deletion of a file, and comparison with older versions of a file.
A global snapshot is an exact copy of changed data in the active files and directories of a file system. Snapshots of a file system are read-only and they appear in a .snapshots directory located in the file system root directory. The files and attributes of the file system can be changed only in the active copy.
A fileset snapshot is an exact copy of changed data in the active files and directories of an independent fileset plus all dependent filesets. Fileset snapshots are read-only and they appear in a .snapshots directory located in the root directory of the fileset. The files and attributes of the fileset can be changed only in the active copy.
Snapshots may be deleted only by issuing the mmdelsnapshot command. The .snapshots directory cannot be deleted, though it can be renamed with the mmsnapdir command using the -s option.
Because global snapshots are not full, independent copies of the entire file system, they should not be used as protection against media failures. For protection against media failures, see the IBM Spectrum Scale: Concepts, Planning, and Installation Guide and search on "recoverability considerations".
For more information on global snapshots, see "Creating and maintaining snapshots of GPFS™ file systems" in the IBM Spectrum Scale: Advanced Administration Guide.
For more information on fileset snapshots, see "Fileset-level snapshots" in the IBM Spectrum Scale: Advanced Administration Guide.
Parameters
- Device
- The device name of the file system for which the snapshot is to
be created. File system names need not be fully-qualified. fs0 is
just as acceptable as /dev/fs0.
This must be the first parameter.
- SnapshotName
- Specifies the name given to the snapshot. For a global snapshot, SnapshotName appears as a subdirectory of the .snapshots directory in the root directory of the file system. Each global snapshot name must be unique from any other global snapshots. If you do not want to traverse the file system's root to access the global snapshot, a more convenient mechanism that enables a connection in each directory of the active file system can be enabled with the -a option of the mmsnapdir command.Note: Ensure that the snapshot name is using the "@GMT-yyyy.MM.dd-HH.mm.ss" format in order to be identifiable by the Windows VSS.
For a fileset snapshot, SnapshotName appears as a subdirectory of the .snapshots directory in the root directory of the fileset. Fileset snapshot names can be duplicated across different filesets. A fileset snapshot can also have the same name as a global snapshot. The mmsnapdir command provides an option to make global snapshots also available through the .snapshots in the root directory of all independent filesets.
- -j Fileset
- Creates a snapshot that only includes the specified fileset plus all dependent filesets that share the same inode space. Fileset must refer to an independent fileset. If -j is not specified, the mmcrsnapshot command creates a global snapshot that includes all filesets.
Exit status
- 0
- Successful completion.
- nonzero
- A failure has occurred.
Security
You must have root authority to run the mmcrsnapshot command when creating global snapshots.
Independent fileset owners can run the mmcrsnapshot command to create snapshots of the filesets they own.
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 file system in IBM Spectrum Scale: Administration and Programming Reference.
Examples
- To create a global snapshot snap1, for the file system fs1, issue this command:
The output is similar to this:mmcrsnapshot fs1 snap1
Writing dirty data to disk. Quiescing all file system operations. Writing dirty data to disk again. Snapshot snap1 created with id 1.
Before issuing the command, the directory structure would appear similar to:/fs1/file1 /fs1/userA/file2 /fs1/userA/file3
After the command has been issued, the directory structure would appear similar to:/fs1/file1 /fs1/userA/file2 /fs1/userA/file3 /fs1/.snapshots/snap1/file1 /fs1/.snapshots/snap1/userA/file2 /fs1/.snapshots/snap1/userA/file3
If a second snapshot were to be created at a later time, the first snapshot would remain as is. Snapshots are made only of active file systems, not existing snapshots. For example:
The output is similar to this:mmcrsnapshot fs1 snap2
Writing dirty data to disk. Quiescing all file system operations. Writing dirty data to disk again. Snapshot snap2 created with id 2.
After the command has been issued, the directory structure would appear similar to:/fs1/file1 /fs1/userA/file2 /fs1/userA/file3 /fs1/.snapshots/snap1/file1 /fs1/.snapshots/snap1/userA/file2 /fs1/.snapshots/snap1/userA/file3 /fs1/.snapshots/snap2/file1 /fs1/.snapshots/snap2/userA/file2 /fs1/.snapshots/snap2/userA/file3
- To create a snapshot Snap3 of the fileset FsetF5-V2,
for the file system fs1, issue this command:
The system displays output similar to:mmcrsnapshot fs1 Snap3 -j FsetF5-V2
To display the snapshot that contains the FsetF5-V2 fileset, issue this command:Writing dirty data to disk. Quiescing all file system operations. Writing dirty data to disk again. Snapshot Snap3 created with id 69.
The system displays output similar to:mmlssnapshot fs1 -j FsetF5-V2
Snapshots in file system fs1: Directory SnapId Status Created Fileset Snap3 69 Valid Wed Feb 1 12:55:51 2012 FsetF5-V2
- To create a snapshot of the gpfs0
file system that can be viewed over SMB protocol with Windows VSS, issue this command:
The system displays output similar to:mmcrsnapshot gpfs0 $(date --utc +@GMT-%Y.%m.%d-%H.%M.%S)
mmcrsnapshot gpfs0 $(date --utc +@GMT-%Y.%m.%d-%H.%M.%S) Flushing dirty data for snapshot @GMT-2015.10.02-21.03.33... Quiescing all file system operations. Snapshot @GMT-2015.10.02-21.03.33 created with id 7.