extendlv 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-extendlv
핵심 정리
- 논리 볼륨에 논리 파티션을 더합니다:
extendlv datalv 10(LP 10개),extendlv datalv 5G(크기). - 파일 시스템이 있는 LV는
extendlv가 아니라chfs -a size=+5G /data로 늘립니다.extendlv는 파일 시스템 크기를 바꾸지 않습니다. raw LV(데이터베이스)나 페이징 LV에 씁니다. - 기본 최대 LP 수는 512입니다. 넘으면 실패하므로 먼저
chlv -x로 늘립니다. - 디스크를 뒤에 적으면 그 디스크에서만 할당합니다. 미러 LV는 사본 수만큼 PP가 필요합니다.
- 스트라이프 LV는 스트라이프 폭의 배수로 늘려야 합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같고, 6.1 문서에 RBAC 안내가 더해지고 savebase 경고 문장이 빠짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 2, 6.1 Volume 2 |
| 파일 | /usr/sbin/extendlv |
| 관련 명령어 | chlv, chfs, lslv, mklv, lsvg |
목적
볼륨 그룹 안의 할당되지 않은 물리 파티션을 더해 논리 볼륨을 늘립니다.
영어 원문
Increases the size of a logical volume by adding deallocated physical partitions from within the volume group.
구문
extendlv [ -a Position ] [ -e Range ] [ -u Upperbound ] [ -s Strict ] LogicalVolume Partitions [ PhysicalVolume ... ]
extendlv [ -m MapFile ] LogicalVolume Partitions
첫째 형식은 쓸 수 있는 물리 파티션을, 둘째 형식은 지정한 물리 파티션을 더합니다.
설명
extendlv 명령은 Partitions 매개변수만큼 논리 파티션을 더 할당해 LogicalVolume을 늘립니다. LogicalVolume은 논리 볼륨 이름이나 ID입니다. 특정 물리 볼륨에만 할당하려면 PhysicalVolume에 이름을 주고, 주지 않으면 볼륨 그룹의 모든 물리 볼륨에서 새 물리 파티션을 할당합니다.
기본으로 lslv가 보여 주는 기존 특성대로 늘립니다. 새 파티션에만 다른 특성을 쓰려면 플래그로 값을 고릅니다.
논리 볼륨의 기본 최대 파티션 수는 512입니다. 512개를 넘게 늘리기 전에 chlv로 기본값을 늘립니다.
기본 할당 정책은 논리 볼륨 사본마다 물리 볼륨을 가장 적게 쓰고, 한 사본의 물리 파티션을 가능한 한 연속되게 두고, -a로 정한 영역에 둡니다. 또 기본으로 논리 파티션의 각 사본을 서로 다른 물리 볼륨에 둡니다.
크기는 512바이트 블록, KB, MB, GB로 줄 수 있습니다(예 참고).
참고:
- 스트라이프 논리 볼륨을 늘릴 때는 파티션 수가 스트라이프 폭의 배수여야 합니다.
- 파티션을 많이 쓰는(800MB 넘는) 논리 볼륨은 조금씩 나눠 늘리는 것이 좋습니다.
- 논리 볼륨을 바꿔도 파일 시스템에는 반영되지 않습니다. 파일 시스템 특성은
chfs로 바꿉니다. - root 권한이 있거나 system 그룹 구성원이어야 합니다.
- 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
5.3 문서에는 "root 권한이 없으면 savebase를 실행하지 못했다는 경고가 나오며, 재부팅 전에 root가 savebase를 실행해야 한다"는 문장이 있습니다.
Web-based System Manager의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit extendlv로도 실행할 수 있습니다.
영어 원문
The extendlv command increases the number of logical partitions allocated to the LogicalVolume by allocating the number of additional logical partitions represented by the Partitions parameter. The LogicalVolume parameter can be a logical volume name or a logical volume ID. To limit the allocation to specific physical volumes, use the names of one or more physical volumes in the PhysicalVolume parameter; otherwise, all the physical volumes in a volume group are available for allocating new physical partitions.
By default, the logical volume is expanded using the existing characteristics that are displayed when you use the lslv command. To override these existing characteristics for the new partitions only, choose different values for these characteristics by using the flags.
The default maximum number of partitions for a logical volume is 512. Before extending a logical volume more than 512 logical partitions, use the chlv command to increase the default value.
The default allocation policy is to use a minimum number of physical volumes per logical volume copy, to place the physical partitions belonging to a copy as contiguously as possible, and then to place the physical partitions in the desired region specified by the -a flag. Also, by default, each copy of a logical partition is placed on a separate physical volume.
You can specify logical volumes sizes in 512 Blocks/KB/MB/GB when using the extendlv command. (See Examples .)
Note:
When extending a striped logical volume, the number of partitions must be in an even multiple of the striping width.
It is recommended that a logical volume using a large number of partitions (more than 800MB) be extended gradually in sections.
Changes made to the logical volume are not reflected in the file systems. To change file system characteristics, use the chfs command.
You must either have root user authority or be a member of the system group to use this command.
The extendlv command is not allowed on a snapshot volume group.
You can use the Volumes application in Web-based System Manager to change volume characteristics. You could also use the System Management Interface Tool (SMIT) smit extendlv fast path to run this command.
플래그
참고: 스트라이프 논리 볼륨에는 -e와 -s를 쓸 수 없습니다.
| 플래그 | 설명 |
|---|---|
-a Position |
디스크 안 할당 정책. m은 바깥 중간(기본), c는 가운데, e는 바깥 가장자리, ie는 안쪽 가장자리, im은 안쪽 중간. |
-e Range |
디스크 간 할당 정책. -u의 Upperbound를 넘을 수 없습니다. x는 최대한 많은 물리 볼륨에, m은 최소한의 물리 볼륨에. |
-m MapFile |
할당할 물리 파티션을 정확히 지정합니다. 파일에 적힌 순서대로 쓰며, 한 사본을 모두 할당한 뒤 다음 사본을 할당합니다. 형식은 PVname:PPnum1[-PPnum2]이며 물리 파티션 하나나 연속 범위마다 한 줄입니다. 맵 파일은 LVM 할당 검사를 건너뛰므로 엄격성, upperbound, 스트라이프 폭을 직접 지켜야 합니다. |
-s Strict |
엄격 할당 정책. y는 한 LP의 사본이 같은 물리 볼륨을 공유하지 않음, n은 공유할 수 있음, s는 super strict. super strict로 바꿀 때는 물리 볼륨을 주거나 -u를 써야 합니다. |
-u Upperbound |
새로 할당할 때 쓸 최대 물리 볼륨 수(1부터 전체 물리 볼륨 수까지). super strict면 미러 사본마다의 최대 수이고, 스트라이프 LV면 스트라이프 폭의 배수여야 합니다. |
영어 원문
Note: The -e and -s flags are not valid with a striped logical volume.
-aPosition — Sets the intraphysical volume allocation policy (the position of the logical partitions on the physical volume). The Position variable can be one of the following: m Allocates logical partitions in the outer middle section of each physical volume. This is the default position. c Allocates logical partitions in the center section of each physical volume. e Allocates logical partitions in the outer edge section of each physical volume. ie Allocates logical partitions in the inner edge section of each physical volume. im Allocates logical partitions in the inner middle section of each physical volume.-eRange — Sets the interphysical volume allocation policy (the number of physical volumes to extend across, using the volumes that provide the best allocation). The value of the Range variable is limited by the Upperbound variable (set with the -u flag) and can be one of the following: x Allocates logical partitions across the maximum number of physical volumes. m Allocates logical partitions across the minimum number of physical volumes.-mMapFile — Specifies the exact physical partitions to allocate. Partitions are used in the order given by the file designated by the MapFile parameter. All physical partitions belonging to a copy are allocated before allocating for the next copy. The MapFile format is:PVname:PPnum1[-PPnum2]where PVname is a physical volume name (for example,hdisk0). It is one record per physical partition or a range of consecutive physical partitions.PVnameName of the physical volume as specified by the system.PPnumPhysical partition number. Important: When you use map files, you must understand and adhere to all LV-allocation parameters such as strictness, upperbound, and stripe width. Using map files bypasses the checks done in the LVM-allocation routines. This is important for striped LVs, which are assumed to have a typical striped allocation pattern conforming to the stripe width.-sStrict — Determines the strict allocation policy. Copies of a logical partition can be allocated to share or not to share the same physical volume. The Strict variable is represented by one of the following: y Sets a strict allocation policy, so copies for a logical partition cannot share the same physical volume. n Does not set a strict allocation policy, so copies for a logical partition can share the same physical volume. s Sets a super strict allocation policy, so that the partitions allocated for one mirror cannot share a physical volume with the partitions from another mirror. Note: When changing a non superstrict logical volume to a superstrict logical volume you must specify physical volumes or use the-uflag.-uUpperbound — Sets the maximum number of physical volumes for new allocation. The value of the Upperbound variable should be between one and the total number of physical volumes. When using super strictness, the upper bound indicates the maximum number of physical volumes allowed for each mirror copy. When using striped logical volumes, the upper bound must be multiple ofStripe_width.
보안
(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.
예제
| 명령 | 하는 일 |
|---|---|
extendlv lv05 3 |
lv05를 논리 파티션 3개만큼 늘림 |
extendlv lv05 10M |
lv05를 최소 10MB만큼 늘림. 필요한 파티션 수는 extendlv가 정함 |
크기 단위는 대소문자 모두 쓸 수 있습니다: B/b(512바이트 블록), K/k(KB), M/m(MB), G/g(GB).
자주 쓰는 형태:
lslv oralv01 | grep -E "MAX LPs|LPs"
chlv -x 2048 oralv01
extendlv oralv01 20G hdisk4
영어 원문
To increase the size of the logical volume represented by the
lv05directory by three logical partitions, type:extendlv lv05 3To request a logical volume named
lv05with a minimum size of 10MB, type:extendlv lv05 10M #The extendlv command will determine the number of partitions needed to create a logical volume of at least that size. You can use uppercase and lowercase letters as follows:
B/b 512 byte blocks
K/k KB
M/m MB
G/g GB
파일
| 파일 | 설명 |
|---|---|
/usr/sbin/ |
extendlv 명령이 있는 디렉터리 |
영어 원문
- /usr/sbin/ — Directory where the extendlv command resides.
Related information:
- chfs command
- lslv command
- Logical volume storage
- PowerHA SystemMirror Administration
리눅스(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로 만듭니다. extendlv에 해당하는 것은 lvextend -L +20G /dev/datavg/oralv01이며, 파일 시스템까지 늘리려면 -r을 줍니다.