migratepv 명령어 (AIX 5.3·6.1)

핵심 정리

  • 원본 디스크에 할당된 PP와 데이터를 같은 볼륨 그룹의 다른 디스크로 옮깁니다. 서비스를 멈추지 않고 디스크를 교체할 때 씁니다: migratepv hdisk1 hdisk6.
  • 대상 디스크를 주지 않으면 볼륨 그룹의 모든 디스크가 대상이 됩니다. -l lv로 특정 LV만 옮길 수 있습니다.
  • 내부적으로 미러를 만들고 동기화한 뒤 원래 사본을 지우므로, 대상에 빈 PP가 충분해야 하고 시간이 걸립니다.
  • rootvg에서 hd5(부트 LV)를 옮겼으면 bosboot -ad /dev/hdiskN과 bootlist -m normal hdiskN을 실행합니다. 주 덤프 장치를 옮기는 동안에는 덤프를 받을 수 없습니다.
  • 옮긴 뒤 reducevg로 원본 디스크를 볼륨 그룹에서 뺍니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 펌웨어 지원 덤프 LV 참고가 더해지고, 부트 LV·동시 모드 제한 문구가 빠짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/sbin/migratepv
관련 명령어 reducevg, bosboot, bootlist, sysdumpdev, cplv, lspv

목적

할당된 물리 파티션을 한 물리 볼륨에서 다른 물리 볼륨으로 옮깁니다.

영어 원문

Moves allocated physical partitions from one physical volume to one or more other physical volumes.

구문

text
migratepv [ -i ] [ -l LogicalVolume ] SourcePhysicalVolume DestinationPhysicalVolume ...

설명

migratepv 명령은 SourcePhysicalVolume에 할당된 물리 파티션과 그 데이터를 하나 이상의 다른 물리 볼륨으로 옮깁니다. 특정 물리 볼륨으로만 옮기려면 DestinationPhysicalVolume에 이름을 주고, 주지 않으면 볼륨 그룹의 모든 물리 볼륨이 대상이 됩니다. 모든 물리 볼륨은 같은 볼륨 그룹에 있어야 하며, 원본 물리 볼륨을 대상 목록에 넣을 수 없습니다.

참고:

  1. root 권한이 있거나 system 그룹 구성원이어야 합니다.
  2. 스냅숏 볼륨 그룹이나 스냅숏 볼륨 그룹을 가진 볼륨 그룹에는 쓸 수 없습니다.
  3. (6.1) 활성 펌웨어 지원 덤프 논리 볼륨이 있는 물리 볼륨에 실행하면 덤프 장치 위치를 잠시 /dev/sysdumpnull로 바꿉니다. 옮기기에 성공하면 sysdumpdev -P를 불러 펌웨어 지원 덤프 LV를 원래 LV로 되돌립니다.

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

물리 볼륨을 옮길 때 부트 논리 볼륨은 온전해야 합니다. 연속된 물리 파티션 두 개와 새 부트 이미지를 새 부트 논리 볼륨에 만들어야 합니다.

부트 이미지가 있는 논리 볼륨을 지정하면 migratepv -l은 대상 물리 볼륨 하나에서 충분한 연속 파티션을 찾으려 합니다. 성공하면 부트 장치가 바뀌었음을 알리도록 bosboot를 실행하라는 메시지를 보여 줍니다. 연속 공간을 찾지 못하면 실패합니다.

5.3 문서에는 "원본과 대상 물리 볼륨을 함께 줄 때 원본에 부트 논리 볼륨이 있으면 실패한다", "동시 모드 볼륨 그룹은 enhanced concurrent 모드이거나 SSA 디스크에서 동시 모드일 때만 쓸 수 있다"는 참고가 있습니다.

참고: LVM의 이동 기능은 모두 관련 논리 볼륨의 미러를 만들고 다시 동기화한 뒤 원래 논리 볼륨을 지우는 방식입니다. 주 덤프 장치가 있는 논리 볼륨을 옮기면 명령이 실행되는 동안 접근할 수 있는 주 덤프 장치가 없어, 그동안의 덤프는 실패할 수 있습니다. 이를 피하려면 sysdumpdev로 주 덤프 장치를 바꾸거나, 실행 전에 보조 덤프 장치를 정의해 둡니다.

Web-based System Manager(wsm)의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit migratepv로도 실행할 수 있습니다.

영어 원문

The migratepv command moves allocated physical partitions and the data they contain from the SourcePhysicalVolume to one or more other physical volumes. To limit the transfer to specific physical volumes, use the names of one or more physical volumes in the DestinationPhysicalVolume parameter; otherwise, all the physical volumes in the volume group are available for the transfer. All physical volumes must be within the same volume group. The specified source physical volume cannot be included in the list of DestinationPhysicalVolume parameters.

Note:

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

  2. The migratepv command is not allowed on a snapshot volume group or a volume group that has a snapshot volume group.

  3. Running this command on a physical volume that has an active, firmware-assisted, dump logical volume temporarily changes the location of the dump device to /dev/sysdumpnull. After you have successfully migrated the logical volume, this command calls the following command to set the firmware-assisted, dump logical volume to the original logical volume.

sysdumpdev -P

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

When you migrate a physical volume, the boot logical volume must remain intact. Two contiguous physical partitions and the new boot image must be built on the new boot logical volume.

If you specify a logical volume that contains the boot image, the migratepv -l command attempts to find enough contiguous partitions on one of the target physical volumes. If the migration is successful, the migratepv command prints a message that recommends the user run the bosboot command to indicate a change in the boot device. The attempted migration fails if the migratepv -l command is unable to find enough contiguous space to satisfy the request.

Note: All Logical Volume Manager migrate functions work by creating a mirror of the logical volumes involved, then resynchronizing the logical volumes. The original logical volume is then removed. If the migratepv command is used to move a logical volume containing the primary dump device, the system will not have an accessible primary dump device during the execution of the command. Therefore, a dump taken during this execution may fail. To avoid this, reassign the primary dump device using the sysdumpdev command or ensure there is a secondary dump device defined before using migratepv.

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 migratepv fast path to run this command.

플래그

플래그 설명
-i DestinationPhysicalVolume 매개변수를 표준 입력에서 읽습니다.
-l LogicalVolume 지정한 논리 볼륨에 할당되고 원본 물리 볼륨에 있는 물리 파티션만 옮깁니다.
영어 원문
  • -i — Reads the DestinationPhysicalVolume parameter from standard input.
  • -l LogicalVolume — Moves only the physical partitions allocated to the specified logical volume and located on the specified source physical volume.

예제

명령 하는 일
migratepv hdisk1 hdisk6 hdisk7 hdisk1의 물리 파티션을 같은 볼륨 그룹의 hdisk6, hdisk7로 옮김
migratepv -l lv02 hdisk1 hdisk6 lv02에 속한 물리 파티션만 hdisk1에서 hdisk6으로 옮김

자주 쓰는 형태(rootvg 디스크 교체):

bash
extendvg rootvg hdisk2
migratepv hdisk0 hdisk2
bosboot -ad /dev/hdisk2
bootlist -m normal hdisk2
reducevg rootvg hdisk0
영어 원문
  1. To move physical partitions from hdisk1 to hdisk6 and hdisk7, enter:
migratepv hdisk1 hdisk6 hdisk7

Physical partitions are moved from one physical volume to two others within the same volume group.

  1. To move physical partitions in logical volume lv02 from hdisk1 to hdisk6, enter:
migratepv -l lv02 hdisk1 hdisk6

Only those physical partitions contained in lv02 are moved from one physical volume to another.

파일

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

Related information:

  • cplv command
  • Migrating the contents of a physical volume
  • Logical volume storage
  • 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로 만듭니다. migratepv에 해당하는 것은 pvmove /dev/sdb /dev/sdc(특정 LV만이면 -n lv)입니다.