rmlvcopy 명령어 (AIX 5.3·6.1)

핵심 정리

  • 논리 볼륨의 사본 수를 줄입니다: rmlvcopy datalv 1 hdisk3(사본 1개만 남기고 hdisk3의 사본을 지움).
  • Copies는 지운 뒤 남을 사본 수(LP당 최대 PP 수)입니다.
  • 디스크를 꼭 지정합니다. LVM이 고장을 아직 알아채지 못했으면 정상 디스크의 사본을 지울 수 있기 때문입니다.
  • 디스크 교체 절차: rmlvcopy(또는 unmirrorvg)로 그 디스크의 사본을 지우고 → reducevg → 교체 → extendvg → mklvcopy(또는 mirrorvg).
  • 볼륨 그룹 전체의 미러를 풀 때는 unmirrorvg가 편합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 펌웨어 지원 덤프 LV와 미러 풀 참고가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4
파일 /usr/sbin/rmlvcopy
관련 명령어 mklvcopy, unmirrorvg, reducevg, replacepv, lslv

목적

논리 볼륨에서 사본을 지웁니다.

영어 원문

Removes copies from a logical volume.

구문

text
rmlvcopy LogicalVolume Copies [ PhysicalVolume ... ]

설명

rmlvcopy 명령은 LogicalVolume의 논리 파티션마다 사본을 지웁니다. 사본은 원래 물리 파티션과 함께 논리 파티션을 이루는 물리 파티션입니다. 논리 볼륨에는 사본을 둘까지 둘 수 있습니다. Copies 매개변수는 남길 물리 파티션의 최대 수입니다. LogicalVolume은 논리 볼륨 이름이나 ID이고, PhysicalVolume은 물리 볼륨 이름이나 ID입니다. PhysicalVolume을 주면 그 물리 볼륨의 사본만 지웁니다.

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

참고:

  1. root 권한이 있거나 system 그룹 구성원이어야 합니다.
  2. LVM이 디스크 고장을 알아채지 못했으면 다른 미러를 지울 수 있습니다. 디스크가 고장 났는데 LVM이 missing으로 보여 주지 않으면 명령줄에 고장 디스크를 주거나, replacepv로 교체하거나 reducevg로 빼야 합니다.
  3. 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
  4. 스냅숏 볼륨 그룹을 가진 볼륨 그룹에는, 명령줄에 물리 볼륨을 주고 그 물리 볼륨이 스냅숏 볼륨 그룹에 속할 때만 쓸 수 있습니다.
  5. (6.1) 활성 펌웨어 지원 덤프 논리 볼륨에 실행하면 덤프 장치를 잠시 /dev/sysdumpnull로 바꿉니다. 사본을 지운 뒤 sysdumpdev -P를 불러 펌웨어 지원 덤프 LV를 원래 덤프 LV로 되돌립니다.
  6. (6.1) 첫 사본의 디스크를 지정해 첫 미러 풀 사본을 지울 때는 chlv로 논리 볼륨의 미러 풀 지정도 옮기는 것이 좋습니다. 예: chlv -m copy1=poolb -M 2 lv00
영어 원문

The rmlvcopy command removes copies from each logical partition in the LogicalVolume. Copies are the physical partitions which, in addition to the original physical partition, make up a logical partition. You can have up to two copies in a logical volume. The Copies parameter determines the maximum number of physical partitions that remain. The LogicalVolume parameter can be a logical volume name or logical volume ID. The PhysicalVolume parameter can be the physical volume name or the physical volume ID. If the PhysicalVolume parameter is used, then only copies from that physical volume will be removed.

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

Note:

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

  2. If LVM has not recognized that a disk has failed it is possible that LVM will remove a different mirror. Therefore if you know that a disk has failed and LVM does not show those disks as missing you should specify the failed disks on the command line or you should use replacepv to replace the disk or reducevg to remove the disk.

  3. The rmlvcopy command is not allowed on a snapshot volume group.

  4. The rmlvcopy command is allowed on a volume group that has a snapshot volume group only if the physical volume names are specified on the command line and the specified physical volumes belong to the snapshot volume group.

  5. Running the rmlvcopy command on an active firmware-assisted dump logical volume temporarily changes the dump device to the /dev/sysdumpnull file. After the successful removal of the logical volume copy, the rmlvcopy command calls the sysdumpdev -P command to set the firmware-assisted dump logical volume to the original dump logical volume.

  6. If you are removing the first mirror pool copy by specifying the disks in the first copy to remove, you might also want to move your logical volumes mirror pool assignments by running the chlv command. For example: chlv -m copy1=poolb -M 2 lv00

보안

(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.

예제

lv0112의 논리 파티션마다 사본 수를 줄여, 각 논리 파티션에 물리 파티션이 많아야 2개 남게 합니다.

bash
rmlvcopy lv0112 2

자주 쓰는 형태:

bash
lspv -l hdisk3                    # 그 디스크에 있는 LV
rmlvcopy datalv 1 hdisk3
unmirrorvg datavg hdisk3          # VG 전체를 한 번에
reducevg datavg hdisk3
영어 원문

To reduce the number of copies of each logical partition belonging to logical volume lv0112, enter: rmlvcopy lv0112 2

Each logical partition in the logical volume now has at most two physical partitions.

파일

파일 설명
/usr/sbin/rmlvcopy rmlvcopy 명령
/tmp/* 명령이 실행되는 동안 임시 파일을 두는 곳
영어 원문
  • /usr/sbin/rmlvcopy — Contains the rmlvcopy command.
  • /tmp/* — Directory where the temporary files are stored while the command is running.

Related information:

  • mklv command
  • mklvcopy 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로 만듭니다. rmlvcopy에 해당하는 것은 lvconvert -m0 datavg/datalv /dev/sdc(그 디스크의 사본을 지움)입니다.