chlv 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-chlv
핵심 정리
- 논리 볼륨의 특성만 바꿉니다(크기는
extendlv나chfs). 가장 흔한 쓰임은chlv -x 2048 datalv로 최대 LP 수를 늘려 파일 시스템 확장 실패를 푸는 것입니다. - 이름 바꾸기:
chlv -n newlv oldlv. 다른 플래그와 함께 쓸 수 없고, 로그 LV면 그 로그를 쓰는 파일 시스템마다chfs -a log=를 실행합니다. (6.1) 마운트된 JFS2만 새 이름이 자동 반영되고, 나머지는 다시 마운트해야 합니다. -a,-e,-s,-u(배치 정책)는 새로 할당하거나 지울 때부터 적용되고, 나머지는 바로 적용됩니다. 이미 있는 배치를 바꾸려면reorgvg를 씁니다.-p r(읽기 전용),-w(미러 쓰기 일관성),-d(스케줄 정책),-t(유형) 등을 바꿀 수 있습니다. (6.1) 일부 플래그는 LV가 닫혀 있어야 합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -T, -m, -M, -O와 이름 변경 참고가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/sbin/chlv |
| 관련 명령어 | lslv, mklv, extendlv, chfs, reorgvg, syncvg |
목적
논리 볼륨의 특성만 바꿉니다.
영어 원문
Changes only 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 ...
chlv -n NewLogicalVolume LogicalVolume
첫째 형식은 특성을, 둘째 형식은 이름을 바꿉니다.
참고:
- 로그 논리 볼륨의 이름을 바꾸면 그 로그를 쓰는 파일 시스템마다
chfs -a log=LVName을 실행해야 합니다. - (6.1) 논리 볼륨에 파일 시스템이 마운트되어 있으면 JFS2일 때만 새 이름이 자동으로 반영됩니다. 다른 파일 시스템 유형은
chlv가 끝난 뒤 마운트를 풀고 다시 마운트해야 합니다. - (6.1) 4KB 블록 물리 볼륨으로 만든 볼륨 그룹에서는 논리 볼륨의 불량 블록 재배치 정책을 지원하지 않습니다.
설명
-a, -e, -s, -u로 바꾼 것은 새 파티션을 할당하거나 파티션을 지울 때만 적용됩니다. 다른 플래그는 바로 적용됩니다.
논리 볼륨 이름을 바꾸려면 -n과 NewLogicalVolume 매개변수를 씁니다. 이 형식에는 다른 플래그를 쓰지 않습니다.
바꾸는 논리 볼륨이 big 볼륨 그룹에 있으면 U, G, P 플래그로 특수 장치 파일의 소유자, 그룹, 권한을 정할 수 있습니다. root만 정할 수 있으며, 볼륨 그룹을 내보냈다가 가져올 때 importvg -R로 복원할 수 있습니다.
참고:
- 논리 볼륨을 바꿔도 파일 시스템에는 반영되지 않습니다. 파일 시스템 특성은
chfs로 바꿉니다. - root 권한이 있거나 system 그룹 구성원이어야 합니다.
- 여러 활성 노드가 동시에 디스크에 접근하는 동시 구성에서는 미러 쓰기 일관성(MWC)과 불량 블록 재배치(BBR)를 지원하지 않으므로 꺼야 합니다.
5.3 문서에는 "볼륨 그룹이 동시 모드로 varyon되어 있으면 이름 변경을 쓸 수 없다"는 주의가 있습니다.
Web-based System Manager(wsm)의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit chlv로도 실행할 수 있습니다. (6.1) PowerHA 클러스터에서의 동작은 PowerHA SystemMirror 관리 안내서(7.1 이후)의 "Administering a PowerHA cluster"를 봅니다.
영어 원문
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:
Changes made to the logical volume are not reflected in the file systems. To change file system characteristics, use the chfs command.
To use this command, you must either have root user authority or be a member of the system group.
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.
플래그
참고:
- 스트라이프 논리 볼륨의 특성을 바꿀 때는
-d,-e를 쓸 수 없습니다. - 스냅숏 볼륨 그룹이나 스냅숏 볼륨 그룹을 가진 볼륨 그룹의 논리 볼륨에는
-a,-b,-r,-t,-v,-w,-x,-U,-G,-P,-o,-d,-e,-u,-s를 쓸 수 없습니다. - (6.1)
-b,-d,-o,-p,-v,-w,-T,-M을 쓰려면 논리 볼륨이 닫혀 있어야 합니다.
| 플래그 | 설명 |
|---|---|
-a Position |
디스크 안 할당 정책. m은 바깥 중간(기본), c는 가운데, e는 바깥 가장자리, ie는 안쪽 가장자리, im은 안쪽 중간. |
-b BadBlocks |
불량 블록 재배치 정책. y는 재배치함, n은 하지 않음. |
-d Schedule |
논리 파티션을 여러 개 쓸 때의 스케줄 정책. 스트라이프 LV를 미러하려면 병렬이나 순차를 써야 합니다. p는 병렬, ps는 병렬 쓰기·순차 읽기(첫 미러를 쓸 수 있으면 늘 첫 미러에서 읽음), pr은 병렬 쓰기·라운드 로빈 읽기(읽기를 모든 미러에 고르게 분산), s는 순차. 병렬이나 순차 정책을 지정할 때 엄격성은 super strict(s)로 둡니다. |
-e Range |
디스크 간 할당 정책. -u의 upperbound를 넘을 수 없습니다. x는 최대한 많은 물리 볼륨에, m은 최소한의 물리 볼륨에. |
-G Groupid |
논리 볼륨 특수 파일의 그룹 ID. |
-L Label |
논리 볼륨 레이블(최대 127자). |
-m copyN=MirrorPool |
(6.1) 논리 볼륨 사본에 미러 풀을 켭니다. N은 사본 번호(1, 2, 3)이며 사본마다 지정합니다. 여럿이면 -m을 여러 번 줍니다. |
-M copyN |
(6.1) 지정한 사본의 미러 풀을 끕니다. 여럿이면 -M을 여러 번 줍니다. |
-n NewLogicalVolume |
논리 볼륨 이름을 바꿉니다. 시스템 전체에서 고유하며 1~15자입니다. |
-o y, n |
겹치는 I/O의 직렬화를 켜거나 끕니다. 대부분의 응용 프로그램이 스스로 직렬화하므로 끄는 것이 맞으며, 새 LV의 기본값은 끔입니다. |
-O y, n |
(6.1) 무한 재시도 옵션. n은 끔, y는 실패한 I/O를 성공할 때까지 다시 시도. 활성 미러 쓰기 일관성이 켜진 LV에는 무시되며, 그때는 볼륨 그룹 수준에서 켜야 합니다. GLVM 환경에서는 지원하지 않습니다. |
-p Permission |
접근 권한. w는 읽기·쓰기, r은 읽기 전용. 읽기 전용 LV에 JFS를 마운트하는 것은 지원하지 않습니다. |
-P Modes |
논리 볼륨 특수 파일의 권한(파일 모드). |
-r Relocate |
재구성할 때 옮길 수 있는지. y는 옮길 수 있음(스트라이프 LV는 y로 바꿀 수 없음), n은 옮기지 않음. |
-s Strict |
엄격 할당 정책. y는 한 LP의 사본이 같은 물리 볼륨을 공유하지 않음, n은 공유할 수 있음, s는 super strict로 한 미러의 파티션이 다른 미러와 물리 볼륨을 공유하지 않음. super strict로 바꿀 때는 -u도 줘야 합니다. |
-t Type |
논리 볼륨 유형(최대 31자). 스트라이프 LV는 boot로 바꿀 수 없습니다. |
-T O, F |
(6.1) O는 논리 볼륨 제어 블록이 첫 블록을 차지하지 않는 LV로 표시해 장치 하위 유형을 DS_LVZ로, F는 DS_LV로 합니다. IOCINFO ioctl로 알아볼 수 있으며, 알려 주는 하위 유형 말고 동작은 바뀌지 않습니다. |
-U Userid |
논리 볼륨 특수 파일의 사용자 ID. |
-u UpperBound |
새로 할당할 때 쓸 최대 물리 볼륨 수(1부터 전체 물리 볼륨 수까지). super strict면 미러 사본마다의 최대 수이고, 스트라이프 LV면 스트라이프 폭의 배수여야 합니다. |
-v Verify |
쓰기 검증. y는 쓸 때마다 다시 읽어 검증, n은 하지 않음. |
-w MirrorWriteConsistency |
y나 a는 활성 미러 쓰기 일관성(일반 I/O 중 사본 일관성 보장), p는 수동 미러 쓰기 일관성(시스템이 중단된 뒤 동기화할 때 일관성 보장, big·scalable 볼륨 그룹만), n은 쓰지 않음(syncvg -f 참고). |
-x Maximum |
논리 볼륨에 할당할 수 있는 최대 논리 파티션 수. |
영어 원문
Note:
When changing the characteristics of a striped logical volume, the
-d, and-eflags are not valid.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,-uand-sflags are not valid.The Logical Volume must be closed to run the chlv command with the
-b,-d,-o,-p,-v,-w,-T, and-Mflags.
-aposition — 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.-bbadblocks — 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.-dschedule — 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.-erange — 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-uflag, 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.-Ggroupid — Specifies group ID for the logical volume special file.-Llabel — Sets the logical volume label. The maximum size of the label variable is 127 characters.-mcopyN=mirrorpool — Enables mirror pools to the copies of a logical volume. N is the copy number (1, 2, or 3). A mirror pool is assigned to a copy by 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-mcopyN=mirrorpool flags.-Mcopyn — Disables mirror pools on the specified copy for this logical volume. The copyn variable is the copy number (1, 2, or 3). It specifies which copy to disable mirror pools on. To disable mirror pools on more than one copy, provide multiple-Mcopyn flags.-nnewlogicalvolume — 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 turnedoff. The default for new logical volumes isoff.-Oy|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.-ppermission — 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.-Pmodes — Specifies permissions (file modes) for the logical volume special file.-rrelocate — 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.-sstrict — 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-uflag.-ttype — 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— The-T Ooption indicates that the logical volume control block does not occupy the first block of the logical volume. Therefore, the space is available for application data. Applications can identify this type of logical volume with theIOCINFO ioctloperation. The logical volume has a device subtype ofDS_LVZ. A logical volume created without this option has a device subtype ofDS_LV. Tip: The-Tflag does not change any behavior of a logical volume beyond the reported subtype.-Uuserid — Specifies user ID for the logical volume special file.-uupperbound — 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.-vverify — 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.-wmirrorwriteconsistency — 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 function is available only on big type and scalable type of volume groups. n No mirror write consistency. See the-fflag of the syncvg command.-xmaximum — Sets the maximum number of logical partitions that can be allocated to the logical volume.
보안
(6.1) RBAC와 Trusted AIX 사용자: 이 명령은 특권 작업을 할 수 있으며 특권 사용자만 할 수 있습니다. 권한과 특권은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다.
영어 원문
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.
예제
| 명령 | 하는 일 |
|---|---|
chlv -e m lv01 |
lv01의 디스크 간 할당 정책을 최소로 |
chlv -t copy lv03 |
lv03의 유형을 copy로 |
chlv -p r lv03 |
lv03을 읽기 전용으로 |
chlv -t paging -u 10 lv03 |
유형을 paging으로, 최대 물리 볼륨 수를 10으로. 유형은 바로 바뀌지만 최대 물리 볼륨 수는 새로 할당할 때부터 적용 |
chlv -a e -e x -r y -s n -u 5 lv07 |
lv07의 할당 특성(위치, 범위, 재배치, 엄격성, upperbound)을 바꿈 |
자주 쓰는 형태:
lslv datalv | grep "MAX LPs"
chlv -x 4096 datalv # 최대 LP 수 늘리기
chfs -a size=+50G /data
umount /data; chlv -n applv datalv; mount /data
영어 원문
- 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.
To change the type of logical volume
lv03, enter:chlv -t copy lv03To change the permission of logical volume
lv03to read-only, enter:chlv -p r lv03
Logical volume lv03 now has read-only permission.
- To change the type to
pagingand the maximum number of physical volumes for logical volumelv03, 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.
- To change the allocation characteristics of logical volume
lv07, enter:
chlv -a e -e x -r y -s n -u 5 lv07
파일
| 파일 | 설명 |
|---|---|
/usr/sbin |
chlv 명령이 있는 디렉터리 |
영어 원문
- /usr/sbin — Directory where chlv command resides.
Related reference:
- chfs Command
Related information:
- extendlv command
- syncvg command
- Logical volume storage
- System Management Interface Tool (SMIT)
리눅스(GNU)와 다른 점
리눅스 LVM2도 물리 볼륨(PV), 볼륨 그룹(VG), 논리 볼륨(LV) 구조가 같지만 명령 이름이 다릅니다. AIX lspv·lsvg·lslv는 pvs/pvdisplay, vgs/vgdisplay, lvs/lvdisplay에, mkvg·extendvg·reducevg는 vgcreate·vgextend·vgreduce에, mklv·extendlv·rmlv는 lvcreate·lvextend·lvremove에, varyonvg·varyoffvg는 vgchange -ay/-an에, importvg·exportvg는 vgimport·vgexport에, migratepv는 pvmove에 해당합니다. AIX의 물리 파티션(PP)은 리눅스의 물리 익스텐트(PE)이고, 미러는 lvcreate --type raid1이나 lvconvert -m1로 만듭니다. 리눅스는 디스크마다 PVID 대신 PV UUID를 쓰며, 파일 시스템은 따로 mkfs로 만듭니다. chlv에 해당하는 것은 lvchange(권한 -p r, 활성화 등)와 lvrename(이름)이며, 리눅스 LVM에는 최대 LP 수 제한이 없습니다.