mklvcopy 명령어 (AIX 5.3·6.1)

핵심 정리

  • 논리 볼륨의 사본 수를 늘려 미러를 만듭니다: mklvcopy datalv 2 hdisk3(사본 2개, 새 사본은 hdisk3에).
  • 새 사본은 -k를 주거나, varyonvg하거나, syncvg를 실행해야 동기화됩니다. 동기화 전까지 lsvg -l에 stale로 보입니다.
  • 사본 수는 최대 3입니다. 기본 엄격 정책이면 사본마다 다른 디스크에 있어야 하므로 디스크가 충분해야 합니다.
  • 볼륨 그룹 전체를 미러할 때는 mirrorvg가 편합니다. rootvg 미러는 mirrorvg rootvg hdisk1 뒤 bosboot, bootlist를 실행합니다.
  • 사본을 지우는 것은 rmlvcopy입니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -p(미러 풀)가 더해지고, 스트라이프 LV 사본의 AIX 4.3.3 참고가 빠짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/sbin/mklvcopy
관련 명령어 rmlvcopy, syncvg, mirrorvg, lslv, mklv

목적

논리 볼륨 안 데이터의 사본을 만듭니다.

영어 원문

Provides copies of data within the logical volume.

구문

text
mklvcopy [ -a Position ] [ -e Range ] [ -k ] [ -m MapFile ] [ -s Strict ] [ -u UpperBound ] [ -p copyn=MirrorPool ] LogicalVolume Copies [ PhysicalVolume ... ]

설명

mklvcopy 명령은 LogicalVolume의 논리 파티션마다 사본 수를 늘립니다. 논리 파티션마다 물리 파티션의 전체 수를 Copies로 늘리는 방식입니다. LogicalVolume은 논리 볼륨 이름이나 ID입니다. PhysicalVolume으로 새 사본의 물리 파티션을 (볼륨 그룹 안) 특정 물리 볼륨에 할당하게 할 수 있고, 주지 않으면 볼륨 그룹의 모든 물리 볼륨을 씁니다.

바꾼 논리 볼륨은 Copies를 새 사본 특성으로 씁니다. 새 사본의 데이터는 -k를 쓰거나, varyonvg로 볼륨 그룹을 활성화하거나, syncvg로 볼륨 그룹이나 논리 볼륨을 명시적으로 동기화하기 전까지 동기화되지 않습니다. 개별 논리 파티션은 쓰일 때 늘 갱신됩니다.

기본 할당 정책은 논리 볼륨 사본마다 물리 볼륨을 가장 적게 쓰고, 한 사본의 물리 파티션을 가능한 한 연속되게 두고, -a로 정한 영역에 둡니다. 또 기본으로 논리 파티션의 각 사본을 서로 다른 물리 볼륨에 둡니다.

참고:

  • root 권한이 있거나 system 그룹 구성원이어야 합니다.
  • 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
  • super strict 정책인 논리 볼륨의 사본을 만들면, 먼저 첫 미러 사본의 물리 파티션 배치를 볼륨 그룹의 다른 디스크들에 그대로 흉내 내려 합니다. 이때는 인수로 준 디스크 간·디스크 안 할당 정책도 무시합니다. 흉내 낼 수 없으면 그 정책을 쓰는 일반 할당 방식을 씁니다.

5.3 문서에는 "스트라이프 논리 볼륨의 사본을 만들려면 그 볼륨 그룹을 쓰는 활성 노드가 모두 AIX 4.3.3 이상이어야 하며, 더 오래된 버전은 미러 뒤에 그 볼륨 그룹을 쓸 수 없다"는 참고가 있습니다.

Web-based System Manager(wsm)의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit mklvcopy로도 실행할 수 있습니다.

영어 원문

The mklvcopy command increases the number of copies in each logical partition in logicalvolume. This is accomplished by increasing the total number of physical partitions for each logical partition to the number represented by Copies. The logicalvolume parameter can be a logical volume name or logical volume ID. You can request that the physical partitions for the new copies be allocated on specific physical volumes (within the volume group) with the physicalvolume parameter; otherwise, all the physical volumes within the volume group are available for allocation.

The logical volume modified with this command uses the copies parameter as its new copy characteristic. The data in the new copies are not synchronized until one of the following occurs: the -k option is used, the volume group is activated by the varyonvg command, or the volume group or logical volume is synchronized explicitly by the syncvg command. Individual logical partitions are always updated as they are written to.

The default allocation policy is to use minimum numbering of physical volumes per logical volume copy, to place the physical partitions belong to a copy as contiguously as possible, and then to place the physical partitions in the desired region specified by the -a flag. Also, by default, each copy of a logical partition is placed on a separate physical volume.

Notes:

  • To use this command, you must either have root user authority or be a member of the system group.

  • The mklvcopy command is not allowed on a snapshot volume group.

  • When you create a copy of a logical volume with a superstrict allocation policy, the mklvcopy command first attempts to mimic the physical-partition mapping of the first mirror copy onto another set of disks in the volume group. This algorithm ignores the interphysical and intraphysical volume allocation policies, even when the policies are specified as arguments to the mklvcopy command. If it is not possible to mimic the first copy's physical partition mapping, the usual allocation algorithm, which utilizes the interphysical and intraphysical volume allocation policies, is used.

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

플래그

참고: 스트라이프 논리 볼륨에는 -e와 -s를 쓸 수 없습니다.

플래그 설명
-a Position 디스크 안 할당 정책. m은 바깥 중간(기본), c는 가운데, e는 바깥 가장자리, ie는 안쪽 가장자리, im은 안쪽 중간.
-e Range 디스크 간 할당 정책. -u의 upperbound를 넘을 수 없습니다. x는 최대한 많은 물리 볼륨에, m은 최소한의 물리 볼륨에(기본).
-k 새 파티션의 데이터를 동기화합니다.
-m MapFile 할당할 물리 파티션을 정확히 지정합니다. 파일에 적힌 순서대로 쓰며, 한 사본을 모두 할당한 뒤 다음 사본을 할당합니다. 형식은 PVname:PPnum1[-PPnum2]이며 물리 파티션 하나나 연속 범위마다 한 줄입니다. 맵 파일은 LVM 할당 검사를 건너뛰므로 엄격성, upperbound, 스트라이프 폭을 직접 지켜야 합니다.
-p copyn=MirrorPool (6.1) 만드는 사본에 미러 풀을 지정합니다. 만드는 사본마다 지정하며, 여럿이면 -p를 여러 번 줍니다.
-s Strict 엄격 할당 정책. y는 한 LP의 사본이 같은 물리 볼륨을 공유하지 않음, n은 공유할 수 있음, s는 super strict(위 참고의 동작이 따름). super strict로 바꿀 때는 물리 볼륨을 주거나 -u를 써야 합니다.
-u UpperBound 새로 할당할 때 쓸 최대 물리 볼륨 수(1부터 볼륨 그룹당 최대 물리 볼륨 수까지). super strict면 미러 사본마다의 최대 수이고, 스트라이프 LV면 스트라이프 폭의 배수여야 합니다.
영어 원문

Note: The -e and -s flags are not valid with a striped logical volume.

  • -a position — Sets the intra-physical volume allocation policy (the position of the logical partitions on the physical volume). The position variable can be 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 Allocated logical partitions in the inner edge section of each physical volume. im Allocates logical partitions in the inner middle section of each physical volume.
  • -e range — Sets the inter-physical volume allocation policy (the number of physical volumes to extend across, using the volumes that provide the best allocation). The range value is limited by the upperbound variable (set with the -u flag), and can be one of the following: x Allocates across the maximum number of physical volumes. m Allocates logical partitions across the minimum number of physical volumes. This is the default for the -e flag.
  • -k — Synchronizes data in the new partitions.
  • -m mapfile — Specifies the exact physical partitions to allocate. Partitions are used in the order given by the file designated by the mapfile parameter. All physical partitions belonging to a copy are allocated before allocating for the next copy. The mapfile format is: PVname:PPnum1[-PPnum2] where pvname is a physical volume name (for example, hdisk0). It is one record per physical partition or a range of consecutive physical partitions. PVname Name of the physical volume as specified by the system. PPnum Physical partition number. Important: When you use map files, you must understand and adhere to all LV-allocation parameters such as strictness, upperbound, and stripe width. Using map files bypasses the checks done in the LVM-allocation routines. This is important for striped LVs, which are assumed to have a typical striped allocation pattern conforming to the stripe width.
  • -p copyn=mirrorpool — Assigns mirror pools to the copies being created. A mirror pool is assigned to a copy using the copyn=mirrorpool parameter. Specify a mirror pool for each copy being created. To specify more than one copyn=mirrorpool pair, provide multiple -p copyn=mirrorpool flags.
  • -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 for a logical partition cannot share the same physical volume. flag. n Does not set a strict allocation policy, so copies for 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. See Note 4 for other effects of the superstrict allocation policy on mklvcopy behavior. Note: When changing a nonsuper strict logical volume to a super strict logical volume, you must specify physical volumes or use the -u flag.
  • -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 maximum number of physical volumes per VG. 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.

보안

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

예제

lv01의 논리 파티션마다 물리 파티션을 더해 사본이 모두 3개가 되게 합니다.

bash
mklvcopy lv01 3

자주 쓰는 형태:

bash
mklvcopy -k datalv 2 hdisk3         # 사본 2개, 바로 동기화
lslv -m datalv | head               # 사본 위치
mirrorvg -S datavg hdisk3           # VG 전체 미러(백그라운드 동기화)
영어 원문

To add physical partitions to the logical partitions in the logical volume lv01, so that a total of three copies exists for each logical partition, enter: mklvcopy lv01 3

The logical partitions in the logical volume represented by directory lv01 have three copies.

파일

파일 설명
/usr/sbin/mklvcopy mklvcopy 명령
영어 원문
  • /usr/sbin/mklvcopy — Contains the mklvcopy command.

Related reference:

  • mklv Command

Related information:

  • syncvg command
  • varyonvg command

리눅스(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로 만듭니다. mklvcopy에 해당하는 것은 lvconvert --type raid1 -m1 datavg/datalv /dev/sdc입니다.