chlv Command

Purpose

Changes only the characteristics of a logical volume.

Syntax

To Change the Characteristics of a Logical Volume

chlv [ -a position ] [ -b badblocks ] [ -d schedule ] [ -e Range ] [ -L label ] [ -o y | n ] [ -p permission ] [ -r relocate ] [ -s strict ] [ -t type ] [ -u upperbound ] [ -v verify ] [ -w mirrorwriteconsistency ] [ -x maximum ] [ -T O | F ] [ -U userid ] [ -G groupid ] [ -P modes ] [ -m copyn=mirrorpool ] [ -M copyn ] [ -O { y | n }] logicalvolume ...

To Change the Name of a Logical Volume

chlv -n newlogicalvolume logicalvolume
Note:
  1. Changing the name of a log logical volume requires that you run the chfs -a log=LVName on each file system using that log.
  2. If the logical volume has a file system mounted, the file system is automatically updated with the new logical volume name only if it is a JFS2 file system. For all other file system types, the user have to run unmount and mount options after the completion of the chlv command to update the filesystem with the new logical volume name.

Description

The changes you make with the -a, -e, -s, and -u flags take effect only when new partitions are allocated or partitions are deleted. The other flags take effect immediately.

To change the name of a logical volume, use the -n flag and use the newlogicalvolume parameter to represent the new logical volume name. Do not use other flags with this syntax.

If the volume group which contains logical volume being changed is in big vg format, U, G, and P flags can be used to set the ownership, group and permissions respectively, of the special device files. Only root user will be able to set these values. If the volume group is exported, these values can be restored upon import if R flag is specified with importvg command.
Note:
  1. Changes made to the logical volume are not reflected in the file systems. To change file system characteristics, use the chfs command.
  2. To use this command, you must either have root user authority or be a member of the system group.
  3. Mirror Write Consistency (MWC) and Bad Block Relocation (BBR) are not supported in a concurrent setup with multiple active nodes accessing a disk at the same time. These two options must be disabled in this type of concurrent setup.

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

See the section "Administering a PowerHA® cluster" in the PowerHA SystemMirror Administration Guide, 7.1 or later, for a discussion of the behavior of this command in a PowerHA cluster.

Flags

Note:
  1. When changing the characteristics of a striped logical volume, the -d, and -e flags are not valid.
  2. When changing the characteristics of a logical volume in a snapshot volume group or in a volume group that has a snapshot volume group, the -a, -b, -r, -t, -v, -w, -x, -U, -G, -P, -o, -d, -e, -u and -s flags are not valid.
  3. The Logical Volume must be closed to run the chlv command with the -b, -d, -o, -p, -v, -w, -T, and -M flags.
Item Description
-a position Sets the intraphysical volume allocation policy (the position of the logical partitions on the physical volume). The position variable is represented by one of the following:
m
Allocates logical partitions in the outer middle section of each physical volume. This is the default position.
c
Allocates logical partitions in the center section of each physical volume.
e
Allocates logical partitions in the outer edge section of each physical volume.
ie
Allocates logical partitions in the inner edge section of each physical volume.
im
Allocates logical partitions in the inner middle section of each physical volume.
-b badblocks Sets the bad-block relocation policy. The badblocks variable is represented by one of the following:
y
Causes bad-block relocation to occur.
n
Prevents bad block relocation from occurring.
-d schedule Sets the scheduling policy when more than one logical partition is written. Must use parallel or sequential to mirror striped lv. The schedule variable is represented by one of the following:
p
Establishes a parallel scheduling policy.
ps
Parallel write with sequential read policy. All mirrors are written in parallel but always read from the first mirror if the first mirror is available.
pr
Parallel write round robin read. This policy is similar to the parallel policy except an attempt is made to spread the reads to the logical volume more evenly across all mirrors.
s
Establishes a sequential scheduling policy.

When specifying policy of parallel or sequential strictness, set to s for super strictness.

-e range Sets the interphysical volume allocation policy (the number of physical volumes to extend across, using the volumes that provide the best allocation). The value of the range variable is limited by the upperbound variable, set with the -u flag, and is represented by one of the following:
x
Allocates logical partitions across the maximum number of physical volumes.
m
Allocates logical partitions across the minimum number of physical volumes.
-G groupid Specifies group ID for the logical volume special file.
-L label Sets the logical volume label. The maximum size of the label variable is 127 characters.
-m copyn=mirrorpool Enables mirror pools to the copies of a logical volume. A mirror pool is assigned to a copy using the copyn=mirrorpool parameter. Specify a mirror pool for each copy of the logical volume. To specify more than one copyn=mirrorpool pair, provide multiple -m copyn=mirrorpool flags.
-M copyn Disables mirror pools on the specified copy for this logical volume. The copyn variable specifies which copy to disable mirror pools on. To disable mirror pools on more than one copy, provide multiple -M copyn flags.
-n newlogicalvolume Changes the name of the logical volume to that specified by the newlogicalvolume variable. Logical volume names must be unique system wide and can range from 1 to 15 characters.
-o y | n Turns on/off serialization of overlapping IOs. If serialization is turned on then overlapping IOs are not allowed on a block range, and only a single IO in a block range is processed at any one time. Most applications like file systems and databases do serialization, and hence serialization should be turned off. The default for new logical volumes is off.
-O y | n Changes the infinite retry option of the logical volume.
n
Disables the infinite retry option of the logical volume. The failing I/O on the logical volume is not retried.
y
Enables the infinite retry option of the logical volume. The failed I/O request is retried until it is successful.
Note:
  1. The infinite retry option is ignored for an LV when an active mirror write consistency is set. The infinite retry option must be enabled at the volume group level to work for a logical volume with active mirror write consistency turned on.
  2. Infinite retry is not supported in a GLVM environment.
-p permission Sets the access permission to read-write or read-only. The permission variable is represented by one of the following:
w
Sets the access permission to read-write.
r
Sets the access permission to read-only.
Note: Mounting a JFS file system on a read-only logical volume is not supported.
-P modes Specifies permissions (file modes) for the logical volume special file.
-r relocate Sets the reorganization flag to allow or prevent the relocation of the logical volume during reorganization. The relocate variable is represented by one of the following:
y
Allows the logical volume to be relocated during reorganization. If the logical volume is striped, the chlv command will not let you change the relocation flag to y.
n
Prevents the logical volume from being relocated during reorganization.
-s strict Determines the strict allocation policy. Copies of a logical partition can be allocated to share or not to share the same physical volume. The strict variable is represented by one of the following:
y
Sets a strict allocation policy, so copies of a logical partition cannot share the same physical volume.
n
Does not set a strict allocation policy, so copies of a logical partition can share the same physical volume.
s
Sets a super strict allocation policy, so that the partitions allocated for one mirror cannot share a physical volume with the partitions from another mirror
Note: When changing a non superstrict logical volume to a superstrict logical volume you must use the -u flag.
-t type Sets the logical volume type. The maximum size is 31 characters. If the logical volume is striped, you cannot change type to boot.
-T O | F For logical volumes in big and scalable volume groups, the -T flag changes the device subtype reported by the IOCINFO ioctl call. Use the -T O option for a subtype of DS_LVZ and the -T F option for a subtype of DS_LV.

Tip: The -T flag does not change any behavior of a logical volume beyond the reported subtype.

-U userid Specifies user ID for the logical volume special file.
-u upperbound Sets the maximum number of physical volumes for new allocation. The value of the upperbound variable should be between one and the total number of physical volumes. When using super strictness, the upper bound indicates the maximum number of physical volumes allowed for each mirror copy. When using striped logical volumes, the upper bound must be multiple of stripewidth.
-v verify Sets the write-verify state for the logical volume. Causes all writes to the logical volume either to be verified with a follow-up read or not to be verified with a follow-up read. The verify variable is represented by one of the following:
y
Causes all writes to the logical volume to be verified with a follow-up read.
n
Causes all writes to the logical volume not to be verified with a follow-up read.
-w mirrorwriteconsistency
y or a
Turns on active mirror write consistency which ensures data consistency among mirrored copies of a logical volume during normal I/O processing.
p
Turns on passive mirror write consistency which ensures data consistency among mirrored copies during volume group synchronization after a system interruption.
Note: This functionality is only available on Big Volume Groups.
n
No mirror write consistency. See the -f flag of the syncvg command.
-x maximum Sets the maximum number of logical partitions that can be allocated to the logical volume.

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 change the interphysical volume allocation policy of logical volume lv01, enter:
    chlv   -e m 
    lv01
    The interphysical volume allocation policy is set to minimum.
  2. To change the type of logical volume lv03, enter:
    chlv   -t copy  lv03
  3. To change the permission of logical volume lv03 to read-only, enter:
    chlv   -p r  lv03
    Logical volume lv03 now has read-only permission.
  4. To change the type to paging and the maximum number of physical volumes for logical volume lv03, enter:
    chlv  -t paging  -u 10 lv03
    The change in the type of logical volume takes effect immediately, but the change in the maximum number of physical volumes does not take effect until a new allocation is made.
  5. To change the allocation characteristics of logical volume lv07, enter:
    chlv  -a e  -e x  -r y  -s n  -u 5 lv07 

Files

Item Description
/usr/sbin Directory where chlv command resides.