[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

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.

Notes:
  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.

You can use the Volumes application in Web-based System Manager to change volume characteristics. You could also use the System Management Interface Tool (SMIT) smit cplv fast path to run this command.

Flags

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

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

    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

/usr/sbin Directory where the cplv command resides.

Related Information

The chlv command, migratepv command, mklv command.

The Logical Volume Storage Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices explains the Logical Volume Manager, physical volumes, logical volumes, volume groups, organization, ensuring data integrity, and understanding the allocation characteristics.

For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.2 Web-based System Manager Administration Guide.

The System Management Interface Tool (SMIT): Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices explains the structure, main menus, and tasks that are done with SMIT.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]