chpv 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-chpv
핵심 정리
- 볼륨 그룹 안 물리 볼륨의 상태를 바꿉니다.
chpv -a n hdisk3: 더 이상 그 디스크에 PP를 할당하지 않습니다(기존 LV는 그대로 씀). 교체 예정 디스크에 씁니다.chpv -v r hdisk3/-v a: 디스크를 removed로 닫거나 다시 엽니다.varyonvg -f뒤 removed가 된 디스크를 되돌릴 때-v a를 씁니다.chpv -h y hdisk5: 할당된 파티션이 없는 디스크를 핫스페어로 지정합니다(chvg -h와 함께).chpv -c hdisk1: 부트 레코드를 지웁니다.-C는 다른 볼륨 관리자 소유 표시를 지웁니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 미러 풀용 -p, -P, -m이 더해지고, 동시 모드 제한 문구가 빠짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/sbin/chpv |
| 관련 명령어 | lspv, varyonvg, migratepv, chvg, extendvg |
목적
볼륨 그룹 안 물리 볼륨의 특성을 바꿉니다.
영어 원문
Changes the characteristics of a physical volume in a volume group.
구문
chpv [ -h Hotspare ] [ -a Allocation ] [ -v Availability ] [ -c ] [ -p MirrorPool ] [ -P ] [ -m MirrorPool ] PhysicalVolume ... [ -C HDiskName ]
설명
chpv 명령은 볼륨 그룹 안 물리 볼륨의 상태를 바꿉니다. 할당 권한(허용·금지)과 사용 가능 상태(사용 가능·제거됨)를 정합니다. 물리 볼륨의 부트 레코드를 지우는 데도 씁니다. 물리 볼륨의 특성은 해당 플래그로 명시적으로 바꾸기 전까지 유지됩니다.
참고: root 권한이 있거나 system 그룹 구성원이어야 합니다.
5.3 문서에는 "볼륨 그룹이 동시 모드로 varyon되어 있으면 쓸 수 없다"는 주의가 있습니다.
Web-based System Manager(wsm)의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit chpv로도 실행할 수 있습니다.
영어 원문
The chpv command changes the state of the physical volume in a volume group by setting allocation permission to either allow or not allow allocation and by setting the availability to either available or removed. This command can also be used to clear the boot record for the given physical volume. Characteristics for a physical volume remain in effect unless explicitly changed with the corresponding flag.
Note: To use this command, you must either have root user authority or be a member of the system group.
You can use the Volumes application in Web-based System Manager (wsm) to change volume characteristics. You can also use the System Management Interface Tool (SMIT) smit chpv fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-a Allocation |
물리 볼륨에 PP를 더 할당할 수 있는지 정합니다. y는 허용, n은 금지. 금지해도 그 위에 있는 논리 볼륨은 계속 쓸 수 있습니다. |
-c |
물리 볼륨의 부트 레코드를 지웁니다. |
-C HDiskName |
디스크의 소유 볼륨 관리자 표시를 지웁니다. root로만 쓸 수 있습니다. 가져온(imported) LVM 볼륨 그룹에 속한 디스크면 LVM 소유 표시를 지우지 못합니다. |
-h Hotspare |
물리 볼륨을 핫스페어로 쓸 수 있게 하고, PP 할당 권한도 정합니다. 미러하지 않은 논리 볼륨에는 의미가 없습니다. y는 그 볼륨 그룹의 핫스페어 디스크로 표시하고 PP 할당을 막습니다. 논리 볼륨에 할당된 파티션이 없어야 합니다. n은 핫스페어 풀에서 빼고 PP 할당을 허용합니다. |
-m MirrorPool |
(6.1) 디스크에 지정된 미러 풀의 이름을 바꿉니다. |
-p MirrorPool |
(6.1) 물리 볼륨을 미러 풀에 넣습니다. 미러 풀 이름은 15자까지입니다. 미러 풀을 켠 볼륨 그룹은 미러 풀을 지원하지 않는 AIX(6.1 이전)로 가져갈 수 없습니다. |
-P |
(6.1) 물리 볼륨을 지정된 미러 풀에서 뺍니다. |
-v Availability |
사용 가능 상태를 정합니다. 닫으면 물리 볼륨에 대한 논리 입출력이 멈추며, 운영에서 뺄 디스크에 씁니다. 파일 시스템과 가상 메모리 관리자의 접근은 멈추지만 시스템 관리 명령은 계속 쓸 수 있습니다. a는 논리 입출력에 쓸 수 있게(available), r은 쓸 수 없게(removed) 합니다. 볼륨 그룹 쿼럼을 지키는 데 그 디스크가 필요하면 오류가 나고 열린 상태로 남습니다. |
영어 원문
-aallocation — Sets the allocation permission for additional physical partitions on the physical volume specified by the physicalvolume parameter. Either allows (yes) the allocation of additional physical partitions on the physical volume, or prohibits (no) the allocation of additional physical partitions on the physical volume. The allocation variable can be either: y Allows the allocation of additional physical partitions on the physical volume. n Prohibits the allocation of additional physical partitions on the physical volume. The logical volumes that reside on the physical volume can still be accessed.-c— Clears the boot record of the given physical volume.-Chdiskname — Clears the owning volume manager from a disk. This flag is only valid when running as the root user. This command will fail to clear LVM as the owning volume manager if the disk is part of an imported LVM volume group.-hhotspare — Sets the sparing characteristics of the physical volume so that the physical volume can be used as a hot spare. Also sets the allocation permission for physical partitions on the physical volume specified by the physicalvolume parameter. This flag has no meaning for non-mirrored logical volumes. The hotspare variable can be either: y Marks the disk as a hot spare disk within the volume group it belongs to and prohibits the allocation of physical partitions on the physical volume. The disk must not have any partitions allocated to logical volumes to be successfully marked as a hot spare disk. n Removes the disk from the hot spare pool for the volume group in which it resides and allows allocation of physical partitions on the physical volume.-mmirrorpool — Changes the name of the mirror pool that is assigned to the specified disk to the value of the mirrorpool parameter.-pmirrorpool — Assigns the physical volume to a mirror pool. The name of a mirror pool can be up to 15 characters in length. After mirror pools are enabled in a volume group, the volume group can no longer be imported into a version of AIX (before AIX Version 6.1) that does not support mirror pools.-P— Removes the physical volume from the mirror pool that is being assigned. The physical volume can only be removed from the mirror pool if it has partitions that are allocated to a logical volume where mirror pools are enabled.-vavailability — Sets the availability of the physical volume. If you set the availability to closed, logical input and output to the physical volume are stopped. You should close a physical volume when the physical volume is removed from operation. Access to physical volume data by the file system or the virtual memory manager is stopped, but you can continue to use the system management commands. The availability variable can be either: a Makes a physical volume available for logical input and output. r Makes a physical volume unavailable (removed) for logical input and output. If the physical volume is required in order to maintain a volume group quorum, an error occurs and the physical volume remains open.
예제
| 명령 | 하는 일 |
|---|---|
chpv -v r hdisk3 |
hdisk3을 닫음. -v a를 쓸 때까지 논리 입출력을 하지 않음 |
chpv -v a hdisk3 |
hdisk3을 열어 논리 입출력을 다시 함 |
chpv -a n hdisk3 |
hdisk3에 PP를 할당하지 않음. -a y를 쓸 때까지 |
chpv -c hdisk3 |
hdisk3의 부트 레코드를 지움 |
영어 원문
- To close physical volume
hdisk3, enter:
chpv -v r hdisk3
The physical volume is closed to logical input and output until the -v a flag is used.
- To open physical volume
hdisk3, enter:
chpv -v a hdisk3
The physical volume is now open for logical input and output.
- To stop the allocation of physical partitions to physical volume
hdisk3, enter:
chpv -a n hdisk3
No physical partitions can be allocated until the -a y flag is used.
- To clear the boot record of a physical volume
hdisk3, enter:chpv -c hdisk3
파일
| 파일 | 설명 |
|---|---|
/usr/sbin |
chpv 명령이 있는 디렉터리 |
/tmp |
명령이 실행되는 동안 임시 파일을 두는 디렉터리 |
영어 원문
- /usr/sbin — Directory where the chpv command resides.
- /tmp — Directory where temporary files are stored while the command is running.
Related information:
- lspv 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로 만듭니다. chpv -a n에 해당하는 것은 pvchange -x n /dev/sdb(할당 금지)이고, 사라졌다 돌아온 디스크는 vgextend --restoremissing으로 되돌립니다.