mmclone command
Creates and manages file clones.
Synopsis
mmclone snap SourceFile [CloneParentFile]
or
mmclone copy CloneParentFile TargetFile
or
mmclone split Filename [Filename...]
or
mmclone redirect Filename [Filename...]
or
mmclone show Filename [Filename...]
Availability
Available on all IBM Spectrum Scale™ editions. Available on AIX® and Linux.
Description
- snap
- Creates a read-only snapshot of an existing file for the purpose of cloning. This read-only snapshot becomes known as the clone parent.
- If only one file is specified with the mmclone snap command, it will convert that file to a clone parent without creating a separate clone parent file. When using this method to create a clone parent, the specified file cannot be open for writing or have hard links.
- copy
- Creates a file clone from a clone parent created with the mmclone snap command or from a file in a snapshot.
- split
- Splits a file clone from all clone parents.
- redirect
- Splits a file clone from the immediate clone parent only.
- show
- Displays the current status for one or more specified files. When
a file is a clone, the report will show the parent inode number. When
a file was cloned from a file in a snapshot, mmclone show displays
the snapshot and fileset information.
The Depth field in the mmclone show output denotes the distance of the file from the root of the clone tree of which it is a member. The root of a clone tree has depth 0. This field is blank if the file in question is not a clone. This field is not updated when a clone’s ancestor is redirected or split from the clone tree. However, even if a clone’s ancestor has been split or redirected, the depth of the clone should always be greater than that of each of its ancestors.
The maximum depth for a clone tree is 1000.
If a snapshot has file clones, those file clones should be deleted or split from their clone parents prior to deleting 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 will return an error. A policy file can be created to help determine if a snapshot has file clones.
For more information about file clones and policy files, see the IBM Spectrum Scale: Administration Guide.
Parameters
- SourceFile
- Specifies the name of a file to clone.
- CloneParentFile
- When CloneParentFile is specified with a mmclone snap command, it indicates the name of the read-only clone parent that will be created from SourceFile.
- When CloneParentFile is specified with a mmclone copy command, it indicates the name of a read-only clone parent. The CloneParentFile can be a clone parent created with the mmclone snap command or a file in a snapshot.
- TargetFile
- Specifies the name of the writable file clone that will be created from CloneParentFile.
- Filename
- Specifies the name of one or more files to split, redirect, or show.
Exit status
- 0
- Successful completion.
- nonzero
- A failure has occurred.
Security
To run the mmclone command, you must have read access to the source file that will be cloned, and write access to the directory where the file clone will be created.
Examples
- To create a clone parent called base.img from
a file called test01.img, issue this command:
To use this clone parent to create a file clone called test02.img, issue this command:mmclone snap test01.img base.img
After the file clone is created, use the mmclone show command to show information about all img files in the current directory:mmclone copy base.img test02.img
The system displays output similar to the following:mmclone show *.img
Parent Depth Parent inode File name ------ ----- -------------- --------- yes 0 base.img no 1 148488 test01.img no 1 148488 test02.img
- To create a file clone called file1.clone from
a file called file1 in the snap1 snapshot,
issue this command:
mmclone copy /fs1/.snapshots/snap1/file1 file1.clone