cplv Command

Purpose

Copies the contents of a logical volume to a new logical volume.

Syntax

To Copy to a New Logical Volume

cplv-v VolumeGroup ] [  -y NewLogicalVolume -Y Prefix ] SourceLogicalVolume

To Copy to an Existing Logical Volume

cplv  -e DestinationLogicalVolume-f ] SourceLogicalVolume

Description

Attention: Do not copy from a larger logical volume containing data to a smaller one. Doing so results in a corrupted file system because some data (including the superblock) is not copied. This command will fail if the cplv creates a new logical volume and the volume group is varied on in concurrent mode.
The cplv command copies the contents of SourceLogicalVolume to a new or existing DestinationLogicalVolume. The SourceLogicalVolume parameter can be a logical volume name or a logical volume ID. The cplv command creates a new logical volume with a system-generated name by using the default syntax. The system-generated name is displayed.
Note:
  1. If you are copying a striped logical volume and the destination logical volume does not exist, an identical copy, including the striped block size and striping width of the source logical volume is created and then the data is copied.
  2. If you are copying a striped logical volume and you have created the destination logical volume, with the mklv command using a different stripe block size and striping width, or the destination is not a striped logical volume, the new characteristics are maintained, and the data is copied from the source logical volume.
  3. To use this command, you must either have root user authority or be a member of the system group.
  4. The cplv command is not allowed on a snapshot volume group.
  5. If the SourceLogicalVolume is a jfs or jfs2 type, the file system must be successfully unmounted and fsck must be run successfully on the newly created file system before the cplv command can be run. If you run the fsck command before mounting the new file system, errors are returned because the log device contained in the superblock would still refer to the original file system. Mount the file system before running fsck so that a new log device is created.

You could also use the System Management Interface Tool (SMIT) smit cplv fast path to run this command.

Flags

Item Description
-e Specifies that the DestinationLogicalVolume exists and that a new logical volume should not be created. If the DestinationLogicalVolume is smaller than the SourceLogicalVolume, the extra logical partitions are not copied. When you use this flag, any data already in the DestinationLogicalVolume is destroyed. For this reason, user confirmation is required, unless the -f flag is added. The Type characteristic of the DestinationLogicalVolume must be copy to prevent inadvertently overwriting data. To change the Type characteristic, use the chlv command.
-f Copies to an existing logical volume without requesting user confirmation.
-v VolumeGroup Specifies the volume group where the new logical volume resides. If this is not specified, the new logical volume resides in the same volume group as the SourceLogicalVolume.
-y NewLogicalVolume Specifies the name to use, in place of a system-generated name, for the new logical volume. Logical volume names must be unique systemwide names, and can range from 1 to 15 characters.
-Y Prefix Specifies a prefix to use in building a system-generated name for the new logical volume. The prefix must be less than or equal to 13 characters. A name cannot begin with a prefix already defined in the PdDv class in the Device Configuration Database for other devices, or a name already used by another device.

Security

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To copy the contents of logical volume fslv03 to a new logical volume, type:
    cplv fslv03
    The new logical volume is created, placed in the same volume group as fslv03, and named by the system.
  2. To copy the contents of logical volume fslv03 to a new logical volume in volume group vg02, type:
    cplv  -v vg02 fslv03  where fslv03 is source logical volume name. It is mandatory field.
    The new logical volume is created, named, and added to volume group vg02.
  3. To copy the contents of logical volume lv02 to a smaller, existing logical volume, lvtest, without requiring user confirmation, type:
    cplv  -e lvtest  -f lv02

Files

Item Description
/usr/sbin Directory where the cplv command resides.