mmdelsnapshot command

Deletes a GPFS™ snapshot.

Synopsis

mmdelsnapshot Device [[Fileset]:]Snapshot[,[[Fileset]:]Snapshot...
[-j FilesetName[,FilesetName...]][--qos QOSClass]
[-N{all | mount | Node[,Node...]|NodeFile | NodeClass

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: Administration Guide for more information about file clones and policy files.

In IBM Spectrum Scale 4.2.1 and later, snapshot commands support the specification of multiple snapshots. Users can easily delete multiple snapshots for maintenance and cleanup operations. Also, system performance is increased by batching operations and reducing overhead.

In this release, the following new usages of the mmdelsnapshot command have been introduced:
mmdelsnapshot fs [[Fileset]:]Snapshot[,[[Fileset]:]Snapshot...]
mmdelsnapshot fs [[Fileset]:]Snapshot[,[[Fileset]:]Snapshot...] -j Fileset
mmdelnapshot fs Snapshot -j Fileset1,Fileset2,...

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.
Fileset
Specifies the name of the fileset that contains the fileset snapshot to be deleted. If Fileset is not specified, the mmdelsnapshot command deletes a global snapshot named Snapshot.
Note: Ensure that multiple snapshots and multiple filesets are not used together.
Snapshot
Specifies the name of the snapshot to be deleted.

The snapshot names are separated by a comma.

The snapshot specifier describes global and fileset snapshots. For example, Fileset1:Snapshot1 specifies a fileset snapshot named Snapshot1 for fileset Fileset1. If Fileset1 is empty, Snapshot1 is a global snapshot named Snapshot1.

Note: Ensure that the snapshot name does not include a colon (:), a comma (,), and whitespaces. If the snapshot name consists of a whitespace, the whitespace must be quoted and part of the snapshot name. For example, if the snap1 and snap A snapshots must be deleted, use the command 'mmdelsnapshot pk2 "snap A, snap1"'.
-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.
Note: When a list of snapshots separated by a comma (,) is used with the -j option, the fileset is applicable to each snapshot that does not use the colon (:) syntax. The fileset name must not consist of a white space.
-N{all | mount | 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.

--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. 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).

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 GPFS file system.

Examples

  1. To delete the snapshot snap1 for the file system fs1, run 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
  2. To delete the snap1 snapshot from the fset1, fset2, and fset3 filesets for the file system fs1, run the following command:
    mmdelsnapshot fs1 snap1 -j fset1,fset2,fset3
    The system displays the following output:
    Invalidating snapshot files in fset1:snap1 fset2:snap1 fset3:snap1 (1..3) of 3...
    Deleting files in snapshot fset1:snap1...
     100.00 % complete on Thu May 12 04:43:07 2016  ( 100032 inodes with total 0 MB data processed)
    Invalidating snapshot files in fset1:snap1/F/...
    Deleting files in snapshot fset2:snap1...
     100.00 % complete on Thu May 12 04:43:07 2016  ( 100032 inodes with total 0 MB data processed)
    Invalidating snapshot files in fset2:snap1/F/...
    Deleting files in snapshot fset3:snap1...
     100.00 % complete on Thu May 12 04:43:07 2016  ( 100032 inodes with total 0 MB data processed)
    Invalidating snapshot files in fset3:snap1/F/...
    Delete snapshot fset1:snap1 successful.
    Delete snapshot fset2:snap1 successful.
    Delete snapshot fset3:snap1 successful.
  3. To specify the snapshot names that must be deleted from each fileset in the file system fs1, run the following command:
    mmdelsnapshot fs1 fset1:snapA,fset2:snapB,fset3:snapC
    The system displays the following command:
    Invalidating snapshot files in fset3:snapC fset1:snapA fset2:snapB (1..3) of 3...
    Deleting files in snapshot fset1:snapA...
     100.00 % complete on Thu May 12 04:44:46 2016  (  100032 inodes with total  0 MB data processed)
    Invalidating snapshot files in fset1:snapA/F/...
    Deleting files in snapshot fset2:snapB...
     100.00 % complete on Thu May 12 04:44:46 2016  (  100032 inodes with total  0 MB data processed)
    Invalidating snapshot files in fset2:snapB/F/...
    Deleting files in snapshot fset3:snapC...
     100.00 % complete on Thu May 12 04:44:46 2016  (  100032 inodes with total  0 MB data processed)
    Invalidating snapshot files in fset3:snapC/F/...
    Delete snapshot fset1:snapA successful.
    Delete snapshot fset2:snapB successful.
    Delete snapshot fset3:snapC successful.

Location

/usr/lpp/mmfs/bin