mklv 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-mklv
핵심 정리
- 볼륨 그룹에 논리 볼륨을 만듭니다:
mklv -y datalv -t jfs2 datavg 100(LP 100개), 크기로도 줄 수 있습니다:mklv -y datalv -t jfs2 datavg 10G. - 디스크를 뒤에 적으면 그 디스크에만 할당합니다:
mklv -y applv datavg 50 hdisk2. -c 2(미러 사본 2개),-s y(사본마다 다른 디스크, 기본),-S 64K(스트라이프),-t(유형: jfs2, jfs2log, paging, raw 등),-x(최대 LP 수, 기본 512)를 자주 씁니다.- LV만 만들고 파일 시스템은 만들지 않습니다. 그 위에
crfs -d datalv로 파일 시스템을 만들거나, raw 장치로 데이터베이스가 씁니다. 로그 LV를 직접 만들었으면logform이 필요합니다. - raw LV의 앞부분에는 LVCB(논리 볼륨 제어 블록)가 있으므로 직접 읽고 쓸 때 주의하며,
-T O로 만들면 LVCB가 첫 블록을 차지하지 않습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -O, -p와 4KB 블록 디스크 참고가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3 |
| 파일 | /usr/sbin/mklv |
| 관련 명령어 | chlv, extendlv, rmlv, lslv, crfs, logform, mkps |
목적
논리 볼륨을 만듭니다.
영어 원문
Creates a logical volume.
구문
mklv [ -a Position ] [ -b BadBlocks ] [ -c Copies ] [ -C StripeWidth ] [ -d Schedule ] [ -e Range ] [ -i ] [ -L Label ] [ -m MapFile ] [ -o y | n ] [ -r Relocate ] [ -s Strict ] [ -t Type ] [ -T O ] [ -u UpperBound ] [ -v Verify ] [ -w MirrorWriteConsistency ] [ -x Maximum ] [ -y NewLogicalVolume | -Y Prefix ] [ -S StripSize ] [ -U Userid ] [ -G Groupid ] [ -P Modes ] [ -p copyn=MirrorPool ] [ -O y | n ] VolumeGroup Number [ PhysicalVolume ... ]
설명
mklv 명령은 VolumeGroup 안에 새 논리 볼륨을 만듭니다. 예를 들어 파일 시스템은 모두 각자의 논리 볼륨에 있어야 합니다. Number만큼 논리 파티션을 할당합니다. PhysicalVolume에 물리 볼륨을 하나 이상 주면 그 물리 볼륨에만 물리 파티션을 할당하고, 주지 않으면 볼륨 그룹의 모든 물리 볼륨을 씁니다.
기본 설정은 가장 흔히 쓰는 특성이며, 플래그로 시스템에 맞게 바꿀 수 있습니다. 만든 뒤에는 chlv로 특성을 바꿉니다.
기본 할당 정책은 논리 볼륨 사본마다 물리 볼륨을 가장 적게 쓰고, 한 사본의 물리 파티션을 가능한 한 연속되게 두고, -a로 정한 영역에 둡니다. 또 기본으로 논리 파티션의 각 사본을 서로 다른 물리 볼륨에 둡니다.
-m은 논리 볼륨을 만들 때 쓸 물리 파티션을 정확히 지정합니다.
-U, -G, -P는 논리 볼륨 장치 특수 파일의 소유자, 그룹, 권한을 정합니다. root만 정할 수 있습니다. big·scalable 볼륨 그룹을 내보냈다가 가져올 때 importvg -R로 이 값을 복원합니다.
크기는 512바이트 블록, KB, MB, GB로 줄 수 있으며 정수여야 합니다.
물리 파티션 번호는 가장 바깥 가장자리에서 1부터 매깁니다.
참고:
- 논리 볼륨을 바꿔도 파일 시스템에는 반영되지 않습니다. 파일 시스템 특성은
chfs로 바꿉니다. - 논리 볼륨마다 제어 블록이 있습니다. 논리 볼륨의 처음 수백 바이트이므로, 논리 볼륨을 직접 읽고 쓸 때는 이를 고려해야 합니다. 논리 볼륨 데이터는 두 번째 512바이트 블록부터 시작합니다.
- root 권한이 있거나 system 그룹 구성원이어야 합니다.
-S로 스트라이프 논리 볼륨을 만들 때는 물리 볼륨을 둘 이상 주거나-C나-u를 써야 합니다.- 스트라이프 논리 볼륨의 파티션 수는 스트라이프 폭의 배수여야 합니다. 아니면 다음 올바른 값으로 올립니다.
- 스냅숏 볼륨 그룹에는 쓸 수 없습니다.
- 여러 활성 노드가 동시에 디스크에 접근하는 동시 구성에서는 미러 쓰기 일관성(MWC)과 불량 블록 재배치(BBR)를 지원하지 않으므로 꺼야 합니다.
- (6.1) 4KB 블록 물리 볼륨으로 만든 볼륨 그룹에서는 논리 볼륨의 불량 블록 재배치 정책을 지원하지 않습니다.
5.3 문서에는 "동시 모드 볼륨 그룹에서 사본이 둘 이상인 스트라이프 논리 볼륨을 만들려면 활성 노드가 모두 AIX 4.3.3 이상이어야 한다"는 참고가 있습니다.
SMIT 빠른 경로 smit mklv로도 실행할 수 있습니다.
영어 원문
The mklv command creates a new logical volume within the volumegroup. For example, all file systems must be on separate logical volumes. The mklv command allocates the number of logical partitions to the new logical volume. If you specify one or more physical volumes with the physicalvolume parameter, only those physical volumes are available for allocating physical partitions; otherwise, all the physical volumes within the volume group are available.
The default settings provide the most commonly used characteristics, but use flags to tailor the logical volume to the requirements of your system. After a logical volume is created, its characteristics can be changed with the chlv command.
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.
The -m flag specifies exact physical partitions to be used when creating the logical volume.
The -U, -G, and -P flags can be used to set the ownership, group, and permissions, respectively, of the logical volume device special files. Only root users can set these values. For scalable and big vg format volume groups that are exported, specify the -R flag with the importvg command to restore these values upon import.
You can specify logical volumes sizes in 512 Blocks/KB/MB/GB when using the mklv command. The logical volumes sizes must be integer values.
Physical partitions are numbered starting at the outermost edge with number one.
Note:
Changes made to the logical volume are not reflected in the file systems. To change file system characteristics use the chfs command.
Each logical volume has a control block. This logical volume control block is the first few hundred bytes within the logical volume. Care has to be taken when reading and writing directly to the logical volume to allow for the control block. Logical volume data begins on the second 512-byte block.
To use this command, you must either have root user authority or be a member of the system group.
When creating a striped logical volume using the
-Sflag, you must specify two or more physical volumes or use the-Cor-uflag.When creating a striped logical volume, the number of partitions must be an even multiple of the striping width. If not, the number of partitions will be rounded up to the next valid value.
The mklv command is not allowed on a snapshot volume group.
Mirror Write Consistency (MWC) and Bad Block Relocation (BBR) are not supported in a concurrent setup with multiple active nodes accessing a disk at the same time. These two options must be disabled in this type of concurrent setup.
Bad block relocation policy of a logical volume is not supported on a volume group that is created with 4 KB block physical volumes.
You can use the System Management Interface Tool (SMIT) smit mklv fast path to run this command.
File Systems on Striped Logical Volumes
스트라이프 논리 볼륨에 파일 시스템을 만들려면 crfs나 mkfs를 실행하기 전에 스트라이프 논리 볼륨을 먼저 만듭니다. 스트라이프 폭 안에서 디스크 공간을 가장 잘 쓰려면 같은 크기의 디스크를 고릅니다. 스트라이프 폭은 스트라이프 논리 볼륨을 이루는 디스크 수입니다.
영어 원문
If you want to create a file system on a striped logical volume, you should create the striped logical volume before you run the crfs command or mkfs command to create the file system. In order to maximize the use of disk space within the striping width, you should choose hard disks of the same size when creating the striped logical volume. The striping width is the number of hard disks that form the striped logical volume.
플래그
| 플래그 | 설명 |
|---|---|
-a Position |
디스크 안 할당 정책(물리 볼륨에서 논리 파티션의 위치). m은 바깥 중간(기본), c는 가운데, e는 바깥 가장자리, ie는 안쪽 가장자리, im은 안쪽 중간. |
-b BadBlocks |
불량 블록 재배치 정책. y는 재배치함(기본), n은 하지 않음. |
-c Copies |
논리 파티션마다 할당할 물리 파티션 수(1~3, 기본 1). |
-C StripeWidth |
스트라이프 폭. 주지 않으면 upperbound나 명령줄에 준 디스크 수로 봅니다. |
-d Schedule |
논리 파티션을 여러 개 쓸 때의 스케줄 정책. p는 병렬(기본), ps는 병렬 쓰기·순차 읽기(모든 미러에 병렬로 쓰고, 첫 미러를 쓸 수 있으면 늘 첫 미러에서 읽음), pr은 병렬 쓰기·라운드 로빈 읽기(읽기를 모든 미러에 고르게 분산), s는 순차. |
-e Range |
디스크 간 할당 정책(가장 좋은 할당을 주는 볼륨으로 몇 개의 물리 볼륨에 걸칠지). -u로 정한 upperbound를 넘을 수 없습니다. x는 최대한 많은 물리 볼륨에, m은 최소한의 물리 볼륨에(기본). |
-G Groupid |
논리 볼륨 특수 파일의 그룹 ID. |
-i |
PhysicalVolume 매개변수를 표준 입력에서 읽습니다. |
-L Label |
논리 볼륨 레이블. 기본 None이며 최대 127자입니다. JFS로 쓸 논리 볼륨이면 JFS가 이 필드에 파일 시스템의 마운트 지점을 저장합니다. |
-m MapFile |
할당할 물리 파티션을 정확히 지정합니다. 파일에 적힌 순서대로 쓰며, 한 사본의 물리 파티션을 모두 할당한 뒤 다음 사본을 할당합니다. 형식은 PVname:PPnum1[-PPnum2]이며, 물리 파티션 하나나 연속 범위마다 한 줄입니다. 맵 파일은 LVM 할당 검사를 건너뛰므로 엄격성, upperbound, 스트라이프 폭 같은 할당 매개변수를 직접 지켜야 합니다. 특히 스트라이프 LV는 스트라이프 폭에 맞는 할당 패턴이라고 가정합니다. |
-o y, n |
겹치는 I/O의 직렬화를 켜거나 끕니다. 켜면 한 블록 범위에 I/O를 하나씩만 처리합니다. 파일 시스템과 데이터베이스 같은 대부분의 응용 프로그램이 스스로 직렬화하므로 끄는 것이 맞으며, 새 논리 볼륨의 기본값은 끔입니다. |
-O y, n |
(6.1) 논리 볼륨의 무한 재시도 옵션. n은 실패한 I/O를 다시 시도하지 않음(기본), y는 성공할 때까지 다시 시도. 활성 미러 쓰기 일관성이 켜진 LV에는 무시되며, 그때는 볼륨 그룹 수준에서 켜야 합니다. GLVM 환경에서는 지원하지 않습니다. |
-p copyn=MirrorPool |
(6.1) 논리 볼륨에 미러 풀을 켭니다. 사본마다 copyn=mirrorpool로 미러 풀을 지정하며, 여럿이면 -p를 여러 번 줍니다. 미러 풀 이름은 15자까지이며 볼륨 그룹·논리 볼륨 이름과 같은 규칙을 따릅니다. |
-P Modes |
논리 볼륨 특수 파일의 권한(파일 모드). |
-r Relocate |
재구성할 때 옮길 수 있는지 정합니다. y는 옮길 수 있음(기본), n은 옮기지 않음. 스트라이프 논리 볼륨은 n이어야 하며 그것이 기본입니다. |
-s Strict |
엄격 할당 정책. y는 한 논리 파티션의 사본이 같은 물리 볼륨을 공유하지 않음(기본), n은 공유할 수 있음, s는 super strict로 한 미러의 파티션이 다른 미러의 파티션과 물리 볼륨을 공유하지 않음. |
-S StripSize |
strip당 바이트 수(strip 크기 × 어레이 디스크 수 = stripe 크기). 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, 64M, 128M을 쓸 수 있습니다. -S로 만들 때는 -d, -e, -s를 쓸 수 없습니다. |
-t Type |
논리 볼륨 유형. 표준 유형은 jfs, jfslog, jfs2, jfs2log, paging이며, 다른 유형을 정의할 수도 있습니다. boot 유형은 스트라이프로 만들 수 없습니다. 기본 jfs. 파일 시스템 로그를 직접 만들었으면 쓰기 전에 logform으로 정리해야 합니다(예: logform /dev/logdev). |
-T O |
논리 볼륨 제어 블록이 논리 볼륨의 첫 블록을 차지하지 않게 하여, 그 공간을 응용 프로그램 데이터에 쓸 수 있게 합니다. 응용 프로그램은 IOCINFO ioctl로 알아볼 수 있으며, 장치 하위 유형이 DS_LVZ입니다(이 옵션 없이 만들면 DS_LV). 5.3 문서는 이 옵션이 old·scalable 볼륨 그룹에서는 무시된다고 적었습니다. |
-U Userid |
논리 볼륨 특수 파일의 사용자 ID. |
-u UpperBound |
새로 할당할 때 쓸 최대 물리 볼륨 수. 1부터 전체 물리 볼륨 수 사이입니다. super strict면 미러 사본마다 쓸 최대 물리 볼륨 수를 뜻합니다. 스트라이프 논리 볼륨이면 스트라이프 폭의 배수여야 하고, 주지 않으면 스트라이프 폭으로 봅니다. |
-v Verify |
쓰기 검증. n은 검증하지 않음(기본), y는 쓸 때마다 다시 읽어 검증. |
-w MirrorWriteConsistency |
y나 a는 활성 미러 쓰기 일관성으로, 일반 I/O 중에 미러 사본 사이의 일관성을 보장합니다. p는 수동 미러 쓰기 일관성으로, 시스템이 중단된 뒤 볼륨 그룹을 동기화할 때 일관성을 보장하며 big·scalable 볼륨 그룹에서만 씁니다. n은 쓰지 않음(syncvg -f 참고). |
-x Maximum |
논리 볼륨에 할당할 수 있는 최대 논리 파티션 수. 기본 512. Number는 이 값 이하여야 합니다. |
-y NewLogicalVolume |
자동으로 만든 이름 대신 쓸 논리 볼륨 이름. 시스템 전체에서 고유하며 115자입니다. 동시 모드로 켠 볼륨 그룹이면 그 볼륨 그룹을 켠 모든 동시 노드에서 고유해야 합니다. 장치 구성 데이터베이스의 PdDv 클래스에 다른 장치용으로 정의된 접두어로 시작할 수 없습니다. 만든 이름은 표준 출력으로 나옵니다. AZ, az, 09, 밑줄(_), 빼기(-), 마침표(.)만 쓸 수 있습니다. |
-Y Prefix |
시스템이 만드는 이름의 접두어 대신 쓸 접두어. 13자 이하이며, PdDv 클래스에 정의된 접두어로 시작하거나 다른 장치가 쓰는 이름이면 안 됩니다. |
영어 원문
-aposition — Sets the intra-physical 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.-bbadblocks — Sets the bad-block relocation policy. The Relocation variable can be one of the following: y Causes bad-block relocation to occur. This is the default. n Prevents bad-block relocation from occurring.-ccopies — Sets the number of physical partitions allocated for each logical partition. The copies variable can be set to a value from 1 to 3; the default is 1.-Cstripewidth — Sets the Stripe width of the logical volume. If the Stripewidth is not entered it is assumed to be the upperbound or the total number of disks specified on the command line.-dschedule — Sets the scheduling policy when more than one logical partition is written. The schedule variable can be one of the following: p Establishes a parallel scheduling policy. This is the default for scheduling policy. ps Parallel write with sequential read policy. All mirrors are written in parallel but always read from the first mirror if the first mirror is available. pr Parallel write round robin read. This policy is similar to the parallel policy except an attempt is made to spread the reads to the logical volume more evenly across all mirrors. s Establishes a sequential scheduling policy.-erange — Sets the inter-physical volume allocation policy (the number of physical volumes to extend across, using the volumes that provide the best allocation). The Range value is limited by the upperbound variable, (set with the-uflag) and can be one of the following: x Allocates across the maximum number of physical volumes. m Allocates logical partitions across the minimum number of physical volumes. This is the default range.-Ggroupid — Specifies group ID for the logical volume special file.-i— Reads the physicalvolume parameter from standard input. Use the-iflag only when physicalvolume is entered through standard input.-L— Sets the logical volume label. The default label is None. The maximum size of the label file is 127 characters. Note: If the logical volume is going to be used as a journaled file system (JFS), then the JFS will use this field to store the mount point of the file system on that logical volume for future reference.-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.-oy / n — Turns on/off serialization of overlapping I/Os. If serialization is turned on then overlapping I/Os are not allowed on a block range and only a single I/O in a block range is processed at any one time. Most applications like file systems and databases do serialization so serialization should be turnedoff. The default for new logical volumes isoff.-Oy / n — Enables the infinite retry option of the logical volume. n The infinite retry option of the logical volume is not enabled. The failing I/O of the logical volume is not retried. This is the default value. y The infinite retry option of the logical volume is enabled. The failed I/O request is retried until it is successful. Note: The infinite retry option is ignored for a logical volume (LV) when active mirror write consistency is set. The infinite retry option must be enabled at the volume group level to work for a logical volume when active mirror write consistency is set. Note: The infinite retry option is not supported in the Geographic Logical Volume Manager (GLVM) environment.-pcopyn=mirrorpool — Enables mirror pools for the logical volume. A mirror pool is assigned to a copy using the copyn=mirrorpool parameter. Specify a mirror pool for each copy. To specify more than one copyn=mirrorpool pair, provide multiple-pcopyn=mirrorpool flags. Mirror pool names can be up to 15 characters and follow the same rules that apply to volume group names and logical volume names.-Pmodes — Specifies permissions (file modes) for the logical volume special file.-rrelocate — Sets the reorganization relocation flag. For striped logical volumes, the relocate parameter must be set to n (the default for striped logical volumes). The relocate parameter can be one of the following: y Allows the logical volume to be relocated during reorganization. This is the default for relocation. n Prevents the logical volume from being relocated during reorganization.-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 parameter 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. This is the default for allocation policy. 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.-SstripSize — Specifies the number of bytes per strip (the strip size multiplied by the number of disks in an array equals the stripe size). Valid values include 4K, 8K, 16K, 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, 64M, and 128M. Note: The-d,-e, and-sflags are not valid when creating a striped logical volume using the-Sflag.-ttype — Sets the logical volume type. The standard types are jfs (journaled file systems), jfslog (journaled file system logs), jfs2 (enhanced journaled file system), jfs2log (enhanced journaled file system logs), and paging (paging spaces), but a user can define other logical volume types with this flag. You cannot create a striped logical volume of type boot. The default is jfs. If a log is manually created for a file system, the user must run the logform command to clean out the new jfslog before the log can be used. For example, to format the logical volumelogdev, type:logform /dev/logdevwhere/dev/logdevis the absolute path to the logical volume.-T O— The-T Ooption indicates that the logical volume control block does not occupy the first block of the logical volume. Therefore, the space is available for application data. Applications can identify this type of logical volume with theIOCINFO ioctloperation. The logical volume has a device subtype ofDS_LVZ. A logical volume created without this option has a device subtype ofDS_LV.-Uuserid — Specifies user ID for logical volume special file.-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 of stripewidth. If upperbound is not specified it is assumed to be stripewidth for striped logical volumes.-vverify — Sets the write-verify state for the logical volume. Causes (y) all writes to the logical volume to either be verified with a follow-up read, or prevents (n) the verification of all writes to the logical volume. The verify parameter is represented by one of the following: n Prevents the verification of all write operations to the logical volume. This is the default for the-vflag. y Causes the verification of all write operations to the logical volume.-wmirrorwriteconsistency — y or a Turns on active mirror write consistency that ensures data consistency among mirrored copies of a logical volume during typical I/O processing. p Turns on passive mirror write consistency that ensures data consistency among mirrored copies during volume group synchronization after a system interruption. Note: This function is available only on big type and scalable type of volume groups. n No mirror write consistency. See the-fflag of the syncvg command.-xmaximum — Sets the maximum number of logical partitions that can be allocated to the logical volume. The default value is 512. The number represented by the number parameter must be equal to or less than the number represented by the maximum variable.-ynewlogicalvolume — Specifies the logical volume name rather than having the name generated automatically. Logical volume names must be unique system wide and can range from 1 to 15 characters. If the volumegroup is varied on in concurrent mode, the new logical volume name should be unique across all the concurrent nodes where the volumegroup is varied on. The name cannot begin with a prefix already defined in the PdDv class in the Device Configuration Database for other devices. The logical volume name created is sent to standard output. The logical volume name can only contain the following characters: • "A" through "Z" • "a" through "z" • "0" through "9" • "_" (the underscore) • "-" (the minus sign) • "." (the period) All other characters are considered not valid.-Yprefix — Specifies the prefix to use instead of the prefix in a system-generated name for the new logical volume. The prefix must be less than or equal to 13 characters. The name cannot begin with a prefix already defined in the PdDv class in the Device Configuration Database for other devices, nor be a name already used by another device.
보안
(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.
예제
| 명령 | 하는 일 |
|---|---|
mklv -c 2 vg02 1 |
vg02에 LP 1개, 데이터 사본 2개인 논리 볼륨 |
mklv -c 3 -u 2 -s n vg03 9 |
vg03에 LP 9개, 사본 3개를 최대 디스크 2개에 걸쳐 엄격하지 않은 정책으로 |
mklv -a c -t paging -b n vg04 5 |
vg04에 LP 5개를 가능하면 가운데 영역에, 불량 블록 재배치 없이, 유형 paging으로 |
mklv vg03 15 hdisk5 hdisk6 hdisk9 |
vg03에 LP 15개를 hdisk5, hdisk6, hdisk9에서 |
mklv -u 3 -S 64K vg05 12 |
vg05에 strip 크기 64K로 디스크 3개에 걸친 LP 12개 스트라이프 논리 볼륨 |
mklv -S 8K vg05 12 hdisk1 hdisk2 hdisk3 |
vg05에 strip 크기 8K로 hdisk1~hdisk3에 걸친 LP 12개 스트라이프 논리 볼륨 |
mklv VGNAME 10M |
최소 10MB인 논리 볼륨. 필요한 파티션 수는 mklv가 정함 |
크기 단위는 대소문자 모두 쓸 수 있습니다: B/b(512바이트 블록), K/k(KB), M/m(MB), G/g(GB).
자주 쓰는 형태:
mklv -y datalv -t jfs2 -c 2 datavg 10G hdisk2 hdisk3 # 미러 LV
mklv -y oralv01 -t raw -T O datavg 20G # DB용 raw LV
mklv -y loglv01 -t jfs2log datavg 1; logform /dev/loglv01
영어 원문
To make a logical volume in volume group
vg02with one logical partition and a total of two copies of the data, type:mklv -c 2 vg02 1To make a logical volume in volume group
vg03with nine logical partitions and a total of three copies spread across a maximum of two physical volumes, and whose allocation policy is not strict, type:mklv -c 3 -u 2 -s n vg03 9To make a logical volume in
vg04with five logical partitions allocated across the center sections of the physical volumes when possible, with no bad-block relocation, and whose type is paging, type:
mklv -a c -t paging -b n vg04 5
- To make a logical volume in
vg03with 15 logical partitions chosen from physical volumeshdisk5,hdisk6, andhdisk9, type:
mklv vg03 15 hdisk5 hdisk6 hdisk9
- To make a striped logical volume in
vg05with a strip size of 64K across 3 physical volumes and 12 logical partitions, type:
mklv -u 3 -S 64K vg05 12
- To make a striped logical volume in
vg05with a strip size of 8K across hdisk1, hdisk2, and hdisk3 and 12 logical partitions, type:
mklv -S 8K vg05 12 hdisk1 hdisk2 hdisk3
- To request a logical volume with a minimum size of 10MB, type:
mklv VGNAME 10M #
The mklv 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 |
mklv 명령이 있는 디렉터리 |
/tmp |
명령이 실행되는 동안 임시 파일을 두는 디렉터리 |
/dev |
논리 볼륨의 문자·블록 장치 항목을 만드는 디렉터리 |
영어 원문
- /usr/sbin — Directory where the mklv command resides.
- /tmp — Directory where the temporary files are stored while the command is running.
- /dev — Directory where the character and block device entries for the logical volume are created.
Related information:
- chfs command
- extendlv command
- chlv command
- Logical volume storage
리눅스(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로 만듭니다. mklv에 해당하는 것은 lvcreate -n datalv -L 10G datavg(미러는 --type raid1 -m1, 스트라이프는 -i 3 -I 64k)입니다.