varyonvg 명령어 (AIX 5.3·6.1)

핵심 정리

  • 볼륨 그룹과 그 논리 볼륨을 활성화해 쓸 수 있게 합니다: varyonvg datavg. 활성화할 때 최신이 아닌(stale) 파티션을 동기화하며, -n이면 하지 않습니다.
  • 과반수(쿼럼)의 디스크에 접근할 수 없으면 실패합니다. 쿼럼을 꺼 두어도 마찬가지이며, 그때는 -f로 강제 활성화합니다(무결성 책임은 사용자에게). 접근 못 한 디스크는 removed 상태가 되고 chpv -v a hdiskN으로 되돌립니다.
  • 디스크와 ODM 정보가 어긋나면 디스크 상태 목록을 보여 주므로 꼼꼼히 확인합니다. -t는 시간 기록을 비교해 다르면 synclvodm으로 맞춥니다.
  • PowerHA 동시 모드는 -c, 읽기 전용은 -r, 관리 전용(LV를 열지 않음)은 -s입니다.
  • -b(예약 해제), -u(잠그지 않음)는 여러 노드가 같은 디스크를 쓰게 되어 데이터가 깨질 수 있으므로 주의합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 GLVM용 -d, -k, -o와 다중 노드 보호용 -O가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 6, 6.1 Volume 6
파일 /usr/sbin/varyonvg
관련 명령어 varyoffvg, lsvg, chvg, importvg, chpv, synclvodm

목적

볼륨 그룹을 활성화합니다.

영어 원문

Activates a volume group.

구문

text
varyonvg [ -b ] [ -c ] [ -f ] [ -M LTGSize ] [ -n ] [ -p ] [ -r ] [ -s ] [ -t ] [ -u ] [ -k loc | rem ] [ -d ] [ -o ] [ -O ] VolumeGroup

5.3의 구문에는 -k, -d, -o, -O가 없습니다.

설명

varyonvg 명령은 VolumeGroup 매개변수의 볼륨 그룹과 그에 딸린 모든 논리 볼륨을 활성화합니다. 활성화한 볼륨 그룹은 쓸 수 있습니다. 활성화할 때 최신이 아닌 물리 파티션을 동기화합니다. PVMISSING 상태였다가 교체된 물리 볼륨은 PVACTIVE 상태로 되돌립니다.

참고: 물리 볼륨이 덤프 장치의 일부이면 PVACTIVE로 되돌리지 못합니다. 덤프 장치를 잠시 바꾼 뒤 실행합니다.

장치 구성 데이터베이스와 LVM에 저장된 정보가 어긋나면 모든 물리 볼륨과 그 상태 목록을 표준 출력으로 보여 줍니다. 볼륨 그룹은 활성화될 수도, 안 될 수도 있습니다. 시스템 무결성을 지키려면 목록을 꼼꼼히 보고 상태마다 알맞게 조치해야 합니다.

동시 모드로 활성화할 때 시스템이 모르던 논리 볼륨을 찾으면 그 정의를 가져옵니다. 새 장치 특수 파일의 권한과 소유자는 볼륨 그룹 특수 파일과 같게 합니다. LV를 만든 노드에서 장치 특수 파일의 권한이나 소유자를 바꿨다면 이 노드에서도 똑같이 바꿔야 합니다.

제한: AIX 5.3부터 Classic Concurrent 모드는 지원하지 않습니다.

물리 볼륨 과반수를 잃어 활성화하지 못하면 모든 물리 볼륨과 상태 목록을 보여 줍니다. 이때 활성화하려면 강제 옵션을 써야 합니다.

물리 볼륨 과반수에 접근할 수 없으면(쿼럼 없음) 활성화하지 못합니다. 쿼럼 검사를 꺼도 마찬가지입니다. 쿼럼 검사를 끄면 쿼럼을 잃어도 활성 상태가 유지될 뿐입니다.

쿼럼 검사를 끈 상태에서 PV_MISSING인 물리 볼륨이 있으면, 쿼럼 디스크가 있어도 활성화하지 않습니다. 이때는 강제 옵션을 쓰거나 환경 변수 MISSINGPV_VARYON을 TRUE로 정합니다(부팅할 때 디스크가 빠진 채로 활성화해야 하면 /etc/environment에 정함).

위의 경우(강제 활성화, MISSINGPV_VARYON)에는 볼륨 그룹 무결성을 사용자가 전적으로 책임집니다.

요구 사항: root 권한이 있거나 system 그룹 구성원이어야 합니다.

SMIT로도 실행할 수 있습니다: smit varyonvg

영어 원문

The varyonvg command activates the volume group specified by the volumegroup parameter and all associated logical volumes. A volume group that is activated is available for use. When a volume group is activated, physical partitions are synchronized if they are not current. Physical volumes that are in the PVMISSING state and that have been replaced will be returned to the PVACTIVE state by the varyonvg command.

Note: If a physical volume is part of a dump device, the varyonvg command cannot return it to the PVACTIVE state. To run the command effectively, temporarily change the dump device.

A list of all physical volumes with their status is displayed to standard output whenever there is some discrepancy between the Device Configuration Database and the information stored in the Logical Volume Manager (LVM). The volume group may or may not be varied on. You must carefully examine the list and take proper action depending on each reported status to preserve your system integrity.

While varying on in concurrent mode, if the varyon process detects that there are logical volumes which are not previously known to the system, their definitions are imported. The permissions and ownership of the new device special files are duplicated to those of the volume group special file. If you have changed the permissions and/or ownership of the device special files of the logical volume on the node it was created, you will need to perform the same changes on this node.

Restriction: Classic Concurrent mode is not supported in AIX 5.3.

If the volume group cannot be varied on due to a loss of the majority of physical volumes, a list of all physical volumes with their status is displayed. To vary on the volume group in this situation, you will need to use the force option.

The varyonvg command fails to vary on the volume group if a majority of the physical volumes are not accessible (no Quorum). This condition is true even if the quorum checking is disabled. Disabling the quorum checking will only ensure that the volume group stays varied on even in the case of loss of quorum.

The volume group will not vary on if any physical volumes are in the PV_MISSING state and the quorum checking is disabled. This condition is true even if a quorum of disks are available. To vary on in this situation either use the force option or set an environment variable MISSINGPV_VARYON to TRUE (set this value in /etc/environment if the volume group needs to be varied with missing disks at the boot time).

In the above cases (using the force vary on option and using the MISSINGPV_VARYON variable), you take full responsibility for the volume group integrity.

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

You can use the System Management Interface Tool (SMIT) to run this command. To use SMIT, enter: smit varyonvg

플래그

플래그 설명
-b 일반 varyonvg로 잠긴 디스크의 예약(reservation)을 풉니다. 이미 활성화한 볼륨 그룹에 씁니다. 볼륨 그룹의 모든 디스크 잠금을 풀고, SC_FORCED_OPEN으로 디스크를 엽니다. SCSI·FC 디스크는 그 디스크가 있는 대상 주소의 모든 LUN을 강제로 열므로, -b를 쓸 때는 볼륨 그룹끼리 대상 주소를 공유하면 안 됩니다. 활성 페이징 공간이 있는 볼륨 그룹에 쓰면 시스템이 멈출 수 있습니다.
-c Enhanced Concurrent 모드로 활성화합니다. 볼륨 그룹이 Concurrent Capable이나 Enhanced Concurrent Capable이고 PowerHA SystemMirror(5.3은 HACMP)가 설치되어 쓸 수 있을 때만 됩니다. 아니면 실패합니다. Enhanced Concurrent 볼륨 그룹은 Group Services를 쓰며, 이 모드로 활성화하기 전에 구성해야 합니다.
-d (6.1) 데이터 분기(divergence)를 허용합니다. 반대편 사이트의 캐시에 미러되지 않은 갱신이 있을 수 있는데 그 캐시에 접근할 수 없을 때 볼륨 그룹을 온라인으로 가져오려 할 때만 효과가 있습니다. 이전 수준 데이터를 쓸 수 있다고 판단했는데 -d가 없으면 오류 메시지와 함께 실패합니다. GLVM 비동기 미러링은 PowerHA SystemMirror Enterprise Edition의 GLVM 문서를 봅니다.
-f 쿼럼 디스크가 없어도 활성화합니다. 활성 상태로 만들 수 없는 디스크는 removed 상태가 됩니다. 디스크가 적어도 하나는 있어야 합니다. 쿼럼을 잃지 않았으면 무시합니다. removed가 된 디스크는 chpv -v a PVname으로 활성 상태로 되돌립니다.
-k loc, rem (6.1) 로컬 미러 사본(loc)이나 원격 미러 사본(rem)의 데이터를 남깁니다. 로컬은 주 사이트가 아니라 로컬 물리 볼륨을, 원격은 원격 사이트가 아니라 원격 물리 볼륨을 뜻합니다.
-M LTGSize LTG 크기를 고정으로 정합니다. 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, 128M을 쓸 수 있습니다. 최대 전송 크기가 이 값보다 작은 디스크가 있으면 실패합니다.
-n 볼륨 그룹 안 stale 물리 파티션의 동기화를 하지 않습니다.
-o (6.1) 고른 사본에서는 stale이지만 다른 사본에서는 최신인 파티션의 데이터를 쓰게 합니다. 데이터 분기 상황에서 -k로 고른 사본의 일부 파티션이 최신이 아니라 전체를 보존할 수 없으면 실패하는데, -o로 그 실패를 넘깁니다. -k와 함께만 씁니다.
-O (6.1) 다른 노드에서 활성화되어 있어도 강제로 활성화합니다. AIX 6.1 TL8부터, 여러 노드에서 비동시 모드로 활성화할 수 없게 만든 볼륨 그룹(mkvg -N n)은 활성화 상태를 LVM 메타데이터와 ODM에 기록하고, 다른 노드에서 이미 활성화되어 있으면 실패합니다. varyoffvg가 이 상태를 지우는데, varyoff 전에 시스템이 멈췄거나 강제로 꺼졌으면 재부팅 뒤 varyonvg가 실패하므로 -O로 강제합니다.
-p 모든 물리 볼륨을 쓸 수 있어야 활성화합니다.
-r 읽기 전용 모드로 활성화합니다. 논리 볼륨 쓰기, LVM 메타데이터 갱신, stale 파티션 동기화를 막습니다. 읽기 전용 LV에 JFS를 마운트하는 것은 지원하지 않으며, LVM 메타데이터를 갱신해야 하는 상위 LVM 명령은 모두 실패합니다.
-s 시스템 관리 모드로만 쓸 수 있게 합니다. 논리 볼륨 명령은 볼륨 그룹을 다룰 수 있지만 논리 볼륨을 입출력용으로 열 수 없습니다. 논리 볼륨 명령도 LV를 읽거나 쓸 수 없으므로, LV에 쓰려는 명령(chvg, mklvcopy 등)은 읽기·쓰기 실패 메시지를 보여 줄 수 있습니다.
-t 장치 구성 데이터베이스와 LVM의 시간 기록을 확인하고, 다르면 synclvodm으로 데이터베이스를 맞춥니다. 동시 모드로 활성화할 때는 늘 이 확인을 합니다.
-u 볼륨 그룹을 활성화하되 디스크는 잠그지 않습니다. 쉬고 있는 볼륨 그룹을 처음 활성화할 때 씁니다.

주의: LVM은 기본적으로 한 이니시에이터만 볼륨 그룹에 접근한다고 가정합니다. PowerHA SystemMirror는 LVM과 함께 공유 볼륨 그룹의 다중 노드 접근을 맞춥니다. 그러나 -b와 -u를 쓰면 PowerHA 없이도 여러 노드가 쉽게 볼륨 그룹에 접근할 수 있습니다. 이 두 플래그로 디스크 보호(잠금)를 건너뛰면 볼륨 그룹 상태 정보가 손상되거나 알 수 없게 바뀔 수 있으며, 데이터와 상태 출력의 일관성을 보장할 수 없습니다.

영어 원문
  • -b — Breaks disk reservations on disks locked as a result of a normal varyonvg command. Use this flag on a volume group that is already varied on. Notes: • This flag unlocks all disks in a given volume group. • The -b flag opens the disks in the volume group using SC_FORCED_OPEN flag. For SCSI and FC disks this forces open all LUNS on the target address that this disk resides on. Volume groups should therefore not share target addresses when using the varyon -b option. • The -b flag can cause a system to hang if used on a volume group that contains an active paging space.
  • -c — Varies the volume group on Enhanced Concurrent mode. This is only possible if the volume group is Concurrent Capable or Enhanced Concurrent Capable and the system has the PowerHA® SystemMirror® product loaded and available. If neither is true, the volume group fails the varyon operation. Requirement: Enhanced Concurrent volume groups use Group Services. Group Services must be configured prior to activating a volume group in this mode.
  • -d — Allows data divergence. The -d flag only takes effect when you try to bring the volume group online while the cache at the opposite site might contain nonmirrored data updates and that cache is not accessible. If the varyonvg command detects that you might use back-level data and you do not specify the -d flag, the command fails with a meaningful error message. For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.
  • -f — Allows a volume group to be made active that does not currently have a quorum of available disks. All disks that cannot be brought to an active state will be put in a removed state. At least one disk must be available for use in the volume group. The -f flag (used to override quorum loss) is ignored if the volume group has not lost quorum. If a disk is put into removed state, use the chpv -v a PVname command to bring the disk back to active state.
  • -k loc | rem — Keeps data from the local mirror copy or remote mirror copy. You can specify the following attributes with the -k flag: loc Retains the local mirror copy data. Local means local physical volumes and not primary site rem Retains the remote mirror copy data. Remote means remote physical volumes and not remote site. For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.
  • -M ltgsize — Statically sets the ltgsize of the volume group. Valid values for ltgsize include 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, and 128M. If any disk in the volume group is not configured with a maximum transfer of ltgsize or greater, the varyonvg command will fail.
  • -n — Disables the synchronization of the stale physical partitions within the volumegroup parameter.
  • -o — Allows using data from partitions that are stale in the copy you selected but fresh in the other copy. The varyonvg command fails if you specify the -k flag to preserve either local copy or remote copy in the data divergence case and the varyonvg command cannot preserve the complete copy because some partitions are not fresh in the local or remote copy that you selected. You can override the failure by specifying the -o flag to use data from partitions that are stale in the copy that you selected but fresh in the other copy. The -o flag is only valid with the -k flag. For more information about asynchronous mirroring of geographic LVM, see Geographic Logical Volume Manager for PowerHA SystemMirror Enterprise Edition.
  • -p — All physical volumes must be available to use the varyonvg command.
  • -r — Varies on the volume group in read-only mode. This mode prevents: • Write operations to logical volumes • LVM metadata updates • Stale partitions synchronization Restriction: Mounting a JFS file system on a read-only logical volume is not supported. Restriction: All LVM high-level commands that require the LVM metadata update will fail the request in this mode.
  • -s — Makes the volume group available in System Management mode only. Logical volume commands can operate on the volume group, but no logical volumes can be opened for input or output. Restriction: Logical volume commands also cannot read or write to or from logical volumes in a volume group varied on with the -s flag. Logical volumes that attempt to write to a logical volume in a volume group varied on with the -s flag (such as chvg or mklvcopy) may display error messages indicating that they were unable to write to and/or read from the logical volume.
  • -t — Checks the timestamps in the Device Configuration Database and the Logical Volume Manager. If there is a discrepancy in the timestamps, the synclvodm command is issued to synchronize the database. Tip: This check is always done if the Volume Group is varied on in concurrent mode.
  • -u — Varies on a volume group, but leaves the disks that make up the volume group in an unlocked state. Use this flag as part of the initial varyon operation of a dormant volume group.
  • -O — Force a varyon operation of the volume group even if it is varied on in some other node. Note: In AIX 61 TL8 and later releases, if the volume group created is not allowed to varyon in non-concurrent mode in more than one node then the varyonvg command updates LVM metadata and ODM with the varyon state of the volume group. During varyon time, the varyonvg command reads this data and fails if the volume group is already varied on in another node. The varyoffvg command will reset the varyon state of the volume group during the varyoff time. If the system crashes before varying off the volume group or the volume group is forced off, the varyonvg command fails after you reboot the system. In this scenario, use –O flag to force a varyon operation of the volume group.
  • Attention: The base design of LVM assumes that only one initiator can access a volume group. The

PowerHA SystemMirror product does work with LVM in order to synchronize multi-node accesses of a shared volume group. However, multi-initiator nodes can easily access a volume group with the -b and -u flags without the use of PowerHA SystemMirror. You must be aware that volume group status information might be compromised or inexplicably altered as a result of disk protect (locking) being bypassed with these two flags. If you use the -b and -u flags, data and status output cannot be guaranteed to be consistent.

종료 상태

값 뜻
0 성공
0보다 큼 오류
영어 원문

This command returns the following exit values:

  • 0 — Successful completion.
  • >0 — An error occurred.

보안

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

예제

명령 하는 일
varyonvg vg03 vg03을 활성화
varyonvg -n vg03 최신이 아닌 파티션을 동기화하지 않고 vg03을 활성화

자주 쓰는 형태:

bash
lsvg -o                        # 활성 VG
varyonvg datavg
mount all                      # 그 위 파일 시스템 마운트
varyonvg -f datavg             # 쿼럼 없이 강제(주의)
chpv -v a hdisk3               # removed 디스크 되돌리기
영어 원문
  1. To activate volume group vg03, enter: varyonvg vg03

  2. To activate volume group vg03 without synchronizing partitions that are not current, enter: varyonvg -n vg03

파일

파일 설명
/usr/sbin varyonvg 명령이 있는 디렉터리
/tmp 명령이 실행되는 동안 임시 파일을 두는 곳
영어 원문
  • /usr/sbin — Contains the varyonvg command directory.
  • /tmp — Stores the temporary files while the command is running.

Related information:

  • chvg command
  • lspv command
  • lslv command
  • lsvg command
  • RBAC
  • Trusted AIX

리눅스(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로 만듭니다. varyonvg에 해당하는 것은 vgchange -ay datavg이고, 디스크가 빠진 상태로 활성화하는 것은 vgchange -ay --activationmode partial입니다. 클러스터 공유 볼륨 그룹은 lvmlockd나 시스템 ID(vgchange --systemid)로 보호합니다.