mmdelsnapshot command

Deletes a GPFS™ snapshot.

Synopsis

mmdelsnapshot Device SnapshotName [-j FilesetName]
    [-N {Node[,Node...] | NodeFile | NodeClass}]
    [--qos QOSClass]

Availability

Available on all IBM Spectrum Scale™ editions.

Description

Use the mmdelsnapshot command to delete a GPFS snapshot.

Once the command is issued, the snapshot is marked for deletion and cannot be recovered.

If the node from which the mmdelsnapshot command is issued or the file system manager node fails, the snapshot might not be completely deleted. The mmlssnapshot command shows these snapshots with status DeleteRequired. Reissue the mmdelsnapshot from another node to complete the removal, or allow the snapshot to be cleaned up automatically by a later mmdelsnapshot command. A snapshot in this state cannot be accessed.

Any files open in the snapshot are forcibly closed. The user receives an errno of ESTALE on the next file access.

If a snapshot has file clones, you must delete the file clones or split them from their clone parents before you delete the snapshot. Use the mmclone split or mmclone redirect command to split file clones. Use a regular delete (rm) command to delete a file clone. If a snapshot is deleted that contains a clone parent, any attempts to read a block that refers to the missing snapshot returns an error. A policy file can be created to help determine whether a snapshot has file clones. See the IBM Spectrum Scale: Advanced Administration Guide for more information about file clones and policy files.

Parameters

Device
The device name of the file system for which the snapshot is to be deleted. File system names do not need to be fully qualified.
SnapshotName
Specifies the name of the snapshot to be deleted.
-N {Node[,Node...] | NodeFile | NodeClass}
Specifies the nodes that participate in deleting the snapshot. This command supports all defined node classes. The default is all or the current value of the defaultHelperNodes parameter of the mmchconfig command.

For general information on how to specify node names, see Specifying nodes as input to GPFS commands in the IBM Spectrum Scale: Administration and Programming Reference.

-j FilesetName
Specifies the name of the fileset that contains the fileset snapshot to be deleted (SnapshotName). If -j is not specified, the mmdelsnapshot command attempts to delete a global snapshot named SnapshotName.
--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 the topic mmchqos command in the IBM Spectrum Scale: Administration and Programming Reference. 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 topic Setting the Quality of Service for I/O operations (QoS) in the IBM Spectrum Scale: Advanced Administration Guide.

Exit status

0
Successful completion.
Nonzero
A failure occurred.

Security

You must have root authority to run the mmdelsnapshot command when you delete global snapshots.

Independent fileset owners can run the mmdelsnapshot command to delete snapshots of filesets that 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 delete the snapshot snap1 for the file system fs1, issue the following command:
mmdelsnapshot fs1 snap1
The output is similar to the following example:
Invalidating snapshot files...
Deleting snapshot files...
 100.00 % complete on Tue Feb 28 10:40:59 2012
Delete snapshot snap1 complete, err = 0
Before you issue the command, the directory might have the following structure:
/fs1/file1
/fs1/userA/file2
/fs1/userA/file3

/fs1/.snapshots/snap1/file1
/fs1/.snapshots/snap1/userA/file2
/fs1/.snapshots/snap1/userA/file3
After you issue the command, the directory has the following structure:
/fs1/file1
/fs1/userA/file2
/fs1/userA/file3
/fs1/.snapshots

Location

/usr/lpp/mmfs/bin