reducevg 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-reducevg
핵심 정리
- 볼륨 그룹에서 디스크를 뺍니다:
reducevg datavg hdisk4. 마지막 디스크를 빼면 볼륨 그룹도 없어집니다. - 뺄 디스크에 논리 볼륨이 남아 있으면 안 됩니다. 데이터를 살리려면
migratepv로 옮기거나 미러면rmlvcopy로 그 디스크의 사본을 지운 뒤 뺍니다. -d는 그 디스크의 LV 파티션을 지우고 빈 LV를 삭제합니다. LV가 여러 디스크에 걸쳐 있으면 LV 전체가 망가질 수 있으므로 조심합니다.- 고장 등으로 디스크 이름이 사라졌으면 이름 대신 PVID로 지웁니다:
reducevg datavg 00c8a1b2d4e5f702. - 뺀 뒤 디스크를 시스템에서 지우려면
rmdev -dl hdisk4.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 펌웨어 지원 덤프 LV 제한과 RBAC 안내가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4 |
| 파일 | /usr/sbin/reducevg |
| 관련 명령어 | extendvg, rmlv, migratepv, rmlvcopy, rmdev |
목적
볼륨 그룹에서 물리 볼륨을 뺍니다. 물리 볼륨을 모두 빼면 볼륨 그룹을 지웁니다.
영어 원문
Removes physical volumes from a volume group. When all physical volumes are removed from the volume group, the volume group is deleted.
구문
reducevg [ -d ] [ -f ] VolumeGroup PhysicalVolume ...
설명
주의: 볼륨 그룹이 동시 모드일 때도 reducevg를 쓸 수 있습니다. 그러나 동시 모드에서 실행해 결과적으로 볼륨 그룹이 지워지게 되면 실패합니다.
reducevg 명령은 PhysicalVolume 매개변수의 물리 볼륨을 하나 이상 VolumeGroup에서 뺍니다. 볼륨 그룹의 물리 볼륨을 모두 빼면 볼륨 그룹도 지웁니다. 볼륨 그룹은 varyon되어 있어야 합니다.
시작하기 전에 그 물리 볼륨에 있는 논리 볼륨을 모두 rmlv 명령이나 -d 플래그로 지워야 합니다.
참고:
- root 권한이 있거나 system 그룹 구성원이어야 합니다.
reducevg VolumeGroup PhysicalVolume을 먼저 실행하지 않고 디스크를 시스템에서 없애는 경우가 있습니다. 이때 VGDA는 아직 그 디스크를 기억하지만 물리 볼륨 이름은 없거나 다른 디스크에 다시 붙었습니다. 이 사라진 디스크의 참조를 지우려면 디스크 이름 대신 PVID로reducevg VolumeGroup PVID를 실행합니다.- 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
- (6.1) 활성 펌웨어 지원 덤프(firmware assisted dump) 논리 볼륨이 있는 볼륨 그룹에는 쓸 수 없습니다.
AIX 5.3에서 만들고 varyonvg -M 없이 켠 볼륨 그룹은, 필요하면 남은 물리 볼륨들의 공통 최대 전송 크기에 맞춰 LTG 크기를 동적으로 올립니다.
Web-based System Manager(wsm)의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit reducevg로도 실행할 수 있습니다.
영어 원문
Attention: You can use the reducevg command while the volume group is in concurrent mode. However, if you run this command while the volume group is in concurrent mode and the end result is the deletion of the volume group, then the reducevg command will fail.
The reducevg command removes one or more physical volumes represented by the PhysicalVolume parameter from the VolumeGroup. When you remove all physical volumes in a volume group, the volume group is also removed. The volume group must be varied on before it can be reduced.
All logical volumes residing on the physical volumes represented by the PhysicalVolume parameter must be removed with the rmlv command or the -d flag before starting the reducevg command.
Note:
To use this command, you must either have root user authority or be a member of the system group.
Sometimes a disk is removed from the system without first running reducevg VolumeGroup PhysicalVolume. The VGDA still has this removed disk in it's memory, but the PhysicalVolume name no longer exists or has been reassigned. To remove references to this missing disk you can still use reducevg, but with the Physical Volume ID (PVID) instead of the disk name: reducevg VolumeGroup PVID.
You cannot use the reducevg command on a snapshot volume group.
You cannot use the reducevg command on a volume group that has an active firmware assisted dump logical volume.
For volume groups created on AIX 5.3 and varied on without the varyonvg -M flag, reducevg will dynamically raise the logical track group size for the volume group if necessary to match the common max transfer size of the remaining physical volumes.
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 reducevg fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-d |
지정한 물리 볼륨에서 기존 논리 볼륨 파티션을 해제하고, 그 결과 비게 된 논리 볼륨을 지웁니다. -f가 없으면 사용자 확인을 받습니다. 주의: 물리 볼륨을 빼기 전에 그 위의 논리 볼륨 데이터를 모두 자동으로 지웁니다. 논리 볼륨이 여러 물리 볼륨에 걸쳐 있으면 그중 하나만 빼도 논리 볼륨 전체의 무결성이 깨질 수 있습니다. |
-f |
-d를 쓸 때 사용자 확인을 받지 않습니다. |
영어 원문
-d— Deallocates the existing logical volume partitions and then deletes resultant empty logical volumes from the specified physical volumes. User confirmation is required unless the-fflag is added. Attention: The reducevg command with the-dflag automatically deletes all logical volume data on the physical volume before removing the physical volume from the volume group. If a logical volume spans multiple physical volumes, the removal of any of those physical volumes may jeopardize the integrity of the entire logical volume.-f— Removes the requirement for user confirmation when the-dflag is used.
보안
(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.
예제
| 명령 | 하는 일 |
|---|---|
reducevg vg01 hdisk1 |
vg01에서 hdisk1을 뺌 |
reducevg -d -f vg01 hdisk1 |
hdisk1과 그 위의 모든 논리 볼륨을 확인 없이 vg01에서 뺌. 논리 볼륨 데이터를 자동으로 지우므로 주의 |
자주 쓰는 형태:
lspv -l hdisk4 # 남은 LV 확인
migratepv hdisk4 hdisk5 # 데이터를 다른 디스크로
reducevg datavg hdisk4
rmdev -dl hdisk4 # 장치 정의 삭제
영어 원문
- To remove physical volume
hdisk1from volume groupvg01, enter:
reducevg vg01 hdisk1
- To remove physical volume
hdisk1and all residing logical volumes from volume groupvg01without user confirmation, enter the following command. Attention: The reducevg command with the-dflag automatically deletes all logical volume data before removing the physical volume.
reducevg -d -f vg01 hdisk1
The physical volume hdisk1 and all residing logical volumes are removed.
파일
| 파일 | 설명 |
|---|---|
/usr/sbin/reducevg |
reducevg 명령 |
/tmp |
명령이 실행되는 동안 임시 파일을 두는 디렉터리 |
영어 원문
- /usr/sbin/reducevg — Directory where the reducevg command resides.
- /tmp — Directory where the temporary files are stored and while the command is running.
Related reference:
- rmlv Command
Related information:
- extendvg 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로 만듭니다. reducevg에 해당하는 것은 pvmove /dev/sdc 뒤 vgreduce datavg /dev/sdc이고, 사라진 디스크는 vgreduce --removemissing datavg로 지웁니다.