exportvg 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-exportvg
핵심 정리
- 볼륨 그룹의 정의(ODM,
/dev장치 파일,/etc/filesystems항목)를 시스템에서 지웁니다. 디스크의 사용자 데이터는 바꾸지 않습니다. - 디스크를 다른 시스템으로 옮기거나, 두 시스템이 공유하는 디스크의 소유를 바꿀 때
importvg와 짝으로 씁니다. - 순서:
umount→varyoffvg datavg→exportvg datavg→ (디스크 이동) → 다른 시스템에서importvg -y datavg hdiskN. - 볼륨 그룹 단위로만 내보낼 수 있고 디스크 하나만은 안 됩니다. 활성 페이징 공간이 있으면 내보낼 수 없습니다.
- 128자보다 긴 마운트 지점은 LVCB에 남지 않으므로 미리 적어 두고 가져온 뒤
/etc/filesystems를 직접 고칩니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같고, 6.1 문서에 RBAC 안내가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 2, 6.1 Volume 2 |
| 파일 | /usr/sbin/exportvg |
| 관련 명령어 | importvg, varyoffvg, lsvg, rmdev |
목적
물리 볼륨 묶음에서 볼륨 그룹 정의를 내보냅니다.
영어 원문
Exports the definition of a volume group from a set of physical volumes.
구문
exportvg VolumeGroup
설명
exportvg 명령은 VolumeGroup 매개변수의 볼륨 그룹 정의를 시스템에서 지웁니다. 볼륨 그룹과 그 내용에 대한 시스템 정보가 모두 지워지므로 내보낸 볼륨 그룹에는 더 이상 접근할 수 없습니다. 볼륨 그룹의 사용자 데이터는 바꾸지 않습니다.
볼륨 그룹은 시스템 안에서 공유하지 않는 자원입니다. 지금 프로세서에서 명시적으로 내보내고 다른 프로세서에서 가져오기 전에는 다른 프로세서가 접근하면 안 됩니다. exportvg는 importvg와 함께 이동식 볼륨을 프로세서 사이에서 주고받는 데 주로 씁니다. 볼륨 그룹 전체만 내보낼 수 있고 물리 볼륨 하나만은 내보낼 수 없습니다.
exportvg와 importvg로 두 프로세서가 공유하는 물리 볼륨의 데이터 소유를 바꿀 수도 있습니다.
참고: root 권한이 있거나 system 그룹 구성원이어야 합니다.
Web-based System Manager의 Volumes 응용 프로그램(wsm lvm)이나 SMIT 빠른 경로 smit exportvg로도 실행할 수 있습니다.
참고:
- 페이징 공간 볼륨이 있는 볼륨 그룹은 그 페이징 공간이 활성인 동안 내보낼 수 없습니다. 내보내기 전에 그 페이징 공간이 시스템 초기화 때 자동으로 활성화되지 않게 한 뒤 시스템을 다시 시작합니다.
- 논리 볼륨의 마운트 지점이 128자보다 길면 LVCB(논리 볼륨 제어 블록)에 남지 않습니다. 이런 마운트 지점은 적어 두었다가,
importvg로 가져온 뒤/etc/filesystems를 직접 고쳐야 볼륨 그룹을 완전히 가져올 수 있습니다.
영어 원문
The exportvg command removes the definition of the volume group specified by the VolumeGroup parameter from the system. Since all system knowledge of the volume group and its contents are removed, an exported volume group can no longer be accessed. The exportvg command does not modify any user data in the volume group.
A volume group is a nonshared resource within the system; it should not be accessed by another processor until it has been explicitly exported from its current processor and imported on another. The
primary use of the exportvg command, coupled with the importvg command, is to allow portable volumes to be exchanged between processors. Only a complete volume group can be exported, not individual physical volumes.
Using the exportvg command and the importvg command, you can also switch ownership of data on physical volumes shared between two processors.
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 use the Web-based System Manager Volumes application (wsm lvm fast path) to run this command. You could also use the System Management Interface Tool (SMIT) smit exportvg fast path to run this command.
Notes:
A volume group that has a paging space volume on it cannot be exported while the paging space is active. Before exporting a volume group with an active paging space volume, ensure that the paging space is not activated automatically at system initialization, and then reboot the system.
The mount point information of a logical volume would be missing from the LVCB (logical volume control block) if it is longer than 128 characters. Please make a note of the mount points that are longer than 128 characters as you will need to edit the /etc/filesystems file manually upon executing importvg command to import this volume group completely.
종료 상태
| 값 | 뜻 |
|---|---|
| 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.
예제
볼륨 그룹 vg02를 시스템에서 지웁니다. 먼저 varyoff해야 합니다. vg02의 정의가 시스템에서 지워지고 접근할 수 없게 됩니다.
exportvg vg02
자주 쓰는 형태:
umount /data
varyoffvg datavg
exportvg datavg
rmdev -dl hdisk2 # 디스크를 떼어 낼 때
영어 원문
To remove volume group vg02 from the system, enter: exportvg vg02
Note: The volume group must be varied off before exporting.
The definition of vg02 is removed from the system and the volume group cannot be accessed.
파일
| 파일 | 설명 |
|---|---|
/usr/sbin |
exportvg 명령이 있는 디렉터리 |
영어 원문
- /usr/sbin — Directory where the exportvg command resides.
Related information:
- importvg command
- varyonvg command
- Logical volume storage
- System management interface tool
리눅스(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로 만듭니다. exportvg에 해당하는 것은 vgchange -an datavg 뒤 vgexport datavg입니다. 리눅스는 /etc/fstab 항목을 따로 지워야 합니다.