replacepv 명령어 (AIX 5.3·6.1)

핵심 정리

  • 볼륨 그룹의 디스크를 볼륨 그룹에 속하지 않은 새 디스크로 바꿉니다: replacepv hdisk1 hdisk6. extendvg → migratepv → reducevg를 한 번에 하는 셈입니다.
  • 새 디스크는 원래 디스크 이상의 크기여야 하고, 어느 볼륨 그룹에도 속하지 않아야 합니다.
  • 원래 디스크가 고장 나 이름이 없으면 PVID로 줄 수 있습니다. 그 디스크의 stale LV는 정상 미러가 있어야 바꿀 수 있습니다.
  • Ctrl-C, 시스템 장애, 쿼럼 손실로 중단되면 replacepv -R 디렉터리로 이어서 합니다.
  • root 권한이 필요하며, 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 펌웨어 지원 덤프 LV와 PV 유형 제한 참고가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4
파일 /usr/sbin/replacepv
관련 명령어 migratepv, extendvg, reducevg, rmlvcopy, sysdumpdev

목적

볼륨 그룹의 물리 볼륨을 다른 물리 볼륨으로 바꿉니다.

영어 원문

Replaces a physical volume in a volume group with another physical volume.

구문

text
replacepv [ -f ] { SourcePhysicalVolume | SourcePhysicalVolumeID } DestinationPhysicalVolume
replacepv [ -R ] dir_name [ DestinationPhysicalVolume ]

설명

replacepv 명령은 SourcePhysicalVolume에 할당된 물리 파티션과 그 데이터를 DestinationPhysicalVolume으로 옮겨 바꿉니다. 원본 물리 볼륨과 대상 물리 볼륨은 같을 수 없습니다.

참고:

  1. 대상 물리 볼륨은 볼륨 그룹에 속하면 안 됩니다.
  2. 대상 물리 볼륨은 원본 물리 볼륨 이상의 크기여야 합니다.
  3. 원본 물리 볼륨에 stale 논리 볼륨이 있으면, 그 논리 볼륨에 stale이 아닌 미러가 없는 한 바꿀 수 없습니다.
  4. 스냅숏 볼륨 그룹이나 스냅숏 볼륨 그룹을 가진 볼륨 그룹에는 쓸 수 없습니다.
  5. (6.1) 활성 펌웨어 지원 덤프 논리 볼륨이 있는 물리 볼륨에 실행하면 덤프 장치를 잠시 /dev/sysdumpnull로 바꿉니다. 논리 볼륨을 옮긴 뒤 sysdumpdev -P를 불러 펌웨어 지원 덤프 LV를 원래 LV로 되돌립니다.
  6. (6.1) 원본 물리 볼륨의 볼륨 그룹에 PV 유형 제한이 있으면 대상 물리 볼륨이 그 제한에 맞는지 확인하고, 맞지 않으면 실패합니다.

새 물리 파티션은 바꾸는 파티션을 가진 논리 볼륨의 할당 정책에 따라 할당합니다.

영어 원문

The replacepv command replaces allocated physical partitions and the data they contain from the SourcePhysicalVolume to DestinationPhysicalVolume. The specified source physical volume cannot be the same as DestinationPhysicalVolume.

Note:

  1. The DestinationPhysicalVolume must not belong to a volume group.

  2. The DestinationPhysicalVolume size must be at least the size of the SourcePhysicalVolume.

  3. The replacepv command cannot replace a SourcePhysicalVolume with stale logical volume unless this logical volume has a non-stale mirror.

  4. You cannot use the replacepv command on a snapshot volume group or a volume group that has a snapshot volume group.

  5. Running this command on a physical volume that has an active firmware assisted dump logical volume temporarily changes the dump device to /dev/sysdumpnull. After the migration of logical volume is successful, this command calls the sysdumpdev -P command to set the firmware assisted dump logical volume to the original logical volume.

  6. The VG corresponding to the SourcePhysicalVolume is examined to determine if a PV type restriction exists. If a restriction exists, the DestinationPhysicalVolume is examined to ensure that it meets the restriction. If it does not meet the PV type restriction, the command will fail.

The allocation of the new physical partitions follows the policies defined for the logical volumes that contain the physical partitions being replaced.

플래그

플래그 설명
-f 대상 물리 볼륨이 장치 구성 데이터베이스의 다른 볼륨 그룹이나 활성 볼륨 그룹에 속하지 않으면 강제로 바꿉니다.
-R dir_name Ctrl-C, 시스템 장애, 쿼럼 손실로 중단된 replacepv를 복구합니다. 처음 실행할 때 나온 디렉터리 이름을 줘야 하며, 대상 물리 볼륨을 바꿀 수도 있습니다.
영어 원문
  • -f — Forces to replace a SourcePhysicalVolume with the specified DestinationPhysicalVolume unless the DestinationPhysicalVolume is part of another volume group in the Device Configuration Database or a volume group that is active.
  • -R dir_name — Recovers replacepv if it is interrupted by <ctrl-c>, a system crash, or a loss of quorum. When using the -R flag, you must specify the directory name given during the initial run of replacepv. This flag also allows you to change the DestinationPhysicalVolume.

보안

접근 제어: root 권한이 있어야 실행할 수 있습니다.

영어 원문

Access Control: You must have root authority to run this command.

예제

hdisk1의 물리 파티션을 hdisk6으로 바꿉니다.

bash
replacepv hdisk1 hdisk6

자주 쓰는 형태:

bash
cfgmgr; lspv | grep None          # 새 디스크
replacepv hdisk1 hdisk6
rmdev -dl hdisk1                  # 옛 디스크 정의 삭제
영어 원문
  1. To replace physical partitions from hdisk1 to hdisk6, enter: replacepv hdisk1 hdisk6

파일

파일 설명
/usr/sbin replacepv 명령이 있는 디렉터리
/tmp 명령이 실행되는 동안 임시 파일을 두는 디렉터리
영어 원문
  • /usr/sbin — Directory where the replacepv command resides.
  • /tmp — Directory where the temporary files are stored while the command is running.

Related information:

  • migratepv command
  • Logical volume storage
  • System management interface tool
  • System Dump Facility

리눅스(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로 만듭니다. replacepv에 해당하는 것은 vgextend, pvmove, vgreduce를 차례로 쓰는 것입니다.