lslv 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-lslv
핵심 정리
lslv datalv는 논리 볼륨의 유형, 사본 수(COPIES), LP·PP 수, 상태, 할당 정책,MAX LPs, 마운트 지점을 보여 줍니다.lslv -l datalv는 그 LV가 어느 디스크에 몇 개의 PP를 두었는지,lslv -m datalv는 LP마다 PP가 어느 디스크 몇 번에 있는지(미러 사본 포함) 보여 줍니다.lslv -p hdisk2는 디스크 전체의 PP 할당 맵(used,free,stale)입니다.- 파일 시스템을 늘리다
MAX LPs때문에 실패하면 여기서 값을 확인하고chlv -x로 늘립니다. LV STATE가opened/stale이면 미러가 맞지 않으니syncvg -l datalv를 실행합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 Infinite Retry 필드가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3 |
| 파일 | /usr/sbin/lslv |
| 관련 명령어 | lsvg, lspv, mklv, chlv, extendlv |
목적
논리 볼륨의 정보를 보여 줍니다.
영어 원문
Displays information about a logical volume.
구문
lslv [ -L ] [ -l | -m ] [ -n PhysicalVolume ] LogicalVolume
lslv [ -L ] [ -n PhysicalVolume ] -p PhysicalVolume [ LogicalVolume ]
첫째 형식은 논리 볼륨 정보, 둘째 형식은 논리 볼륨 할당 맵을 보여 줍니다.
설명
lslv 명령은 LogicalVolume의 특성과 상태를 보여 주거나, PhysicalVolume에 있는 물리 파티션의 논리 볼륨 할당 맵을 보여 줍니다. 논리 볼륨은 이름이나 식별자로 줍니다.
참고: 장치 구성 데이터베이스에서 어떤 필드의 정보를 찾지 못하면 값 자리에 물음표(?)를 넣습니다. 예를 들어 LABEL 정보가 없으면 LABEL: ?로 나옵니다.
논리 볼륨 식별자를 주면 기술 영역에서 가능한 한 많은 정보를 얻으려 합니다.
Web-based System Manager의 Volumes 응용 프로그램이나 SMIT 빠른 경로 smit lslv로도 실행할 수 있습니다.
영어 원문
The lslv command displays the characteristics and status of the LogicalVolume or lists the logical volume allocation map for the physical partitions on the PhysicalVolume. The logical volume can be a name or identifier.
Note: If the lslv command cannot find information for a field in the Device Configuration Database, it will insert a question mark (?) in the value field. As an example, if there is no information for the LABEL field, the following is displayed: LABEL: ?
The command attempts to obtain as much information as possible from the description area when it is given a logical volume identifier.
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 lslv fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-L |
볼륨 그룹 잠금을 기다리지 않습니다. 볼륨 그룹이 바뀌는 중이면 결과를 믿을 수 없습니다. |
-l |
논리 볼륨이 쓰는 물리 볼륨마다 다음을 보여 줍니다. PV(물리 볼륨 이름), Copies(이 PV에 PP가 하나 이상인(사본 없음) LP 수, 둘 이상인(사본 1) LP 수, 셋인(사본 2) LP 수의 세 값), In band(이 PV에서 그 LV의 PP 가운데 디스크 안 할당 정책이 정한 영역에 할당된 비율), Distribution(바깥 가장자리, 바깥 중간, 가운데, 안쪽 중간, 안쪽 가장자리 영역별 PP 수). |
-m |
LP마다 다음을 보여 줍니다. LPs(LP 번호), PV1·PP1(첫 PP가 있는 PV와 PP 번호), PV2·PP2(둘째 PP, 곧 첫 사본), PV3·PP3(셋째 PP, 곧 둘째 사본). |
-n PhysicalVolume |
지정한 물리 볼륨의 기술 영역에서 정보를 읽습니다. 검증되지 않은 정보라 최신이 아닐 수 있습니다. 쓰지 않으면 검증된 기술 영역을 읽으므로 최신입니다. 볼륨 그룹이 활성 상태가 아니어도 됩니다. |
-p PhysicalVolume |
물리 볼륨의 논리 볼륨 할당 맵을 보여 줍니다. LogicalVolume을 주면 그 LV에 할당된 파티션은 LP 번호로 나옵니다. 아니면 파티션 상태가 used(다른 LV에 할당됨), free(쓰지 않음), stale(다른 파티션과 일치하지 않음)로 나옵니다. stale인 파티션은 LP 번호에 물음표가 붙습니다. |
플래그 없이 실행하면 보여 주는 상태:
| 필드 | 설명 |
|---|---|
Logical volume |
논리 볼륨 이름. 시스템 전체에서 고유하며 1~15자 |
Volume group |
볼륨 그룹 이름. 시스템 전체에서 고유하며 1~15자 |
LV identifier |
논리 볼륨 식별자 |
Permission |
read-only 또는 read-write |
VG state |
varyonvg로 켰으면 active/complete(모든 PV 활성)나 active/partial(일부 PV 비활성), 아니면 inactive |
LV state |
Opened/stale은 열려 있지만 최신이 아닌 PP가 있음, Opened/syncd는 열려 있고 동기화됨, Closed는 열리지 않음 |
Type |
논리 볼륨 유형 |
Write verify |
쓰기 검증 on/off |
Mirror write consistency |
미러 쓰기 일관성 on/off |
Max LPs |
논리 볼륨에 둘 수 있는 최대 LP 수 |
PP size |
물리 파티션 크기 |
Copies |
할당할 때 LP마다 만드는 PP 수 |
Sched policy |
순차(sequential) 또는 병렬(parallel) 스케줄 정책 |
LPs |
지금 LP 수 |
PPs |
지금 PP 수 |
Stale partitions |
최신이 아닌 PP 수 |
BB policy |
불량 블록 재배치 정책 |
Inter-policy |
디스크 간 할당 정책 |
Intra-policy |
디스크 안 할당 정책 |
Upper bound |
super strict면 미러 사본 하나가 쓸 수 있는 최대 디스크 수 |
Relocatable |
파티션 할당을 재구성할 때 옮길 수 있는지 |
Mount point |
있으면 파일 시스템 마운트 지점 |
Label |
논리 볼륨의 레이블 |
Each LP copy on a separate PV? |
엄격성(strictness). strict는 한 LP의 사본을 같은 PV에 두지 않음, nonstrict는 그렇지 않음(같은 LP의 PP 둘이 한 PV에 있을 수 있음), superstrict는 한 미러 사본의 파티션이 다른 사본과 같은 디스크에 있지 않음 |
Serialize IO? |
겹치는 I/O를 직렬화하는지(yes/no). yes면 한 블록 범위에 I/O를 하나씩만 처리합니다. 파일 시스템과 데이터베이스 같은 대부분의 응용 프로그램이 스스로 직렬화하므로 no가 맞으며, 새 LV의 기본값입니다. |
Stripe width |
스트라이프하는 물리 볼륨 수 |
Stripe size |
스트라이프당 바이트 수 |
Infinite Retry |
(6.1) 무한 재시도 옵션 |
영어 원문
-L— Specifies no waiting to obtain a lock on the Volume group. Note: If the volume group is being changed, using the-Lflag gives unreliable date.-l— Lists the following fields for each physical volume in the logical volume:PVPhysical volume name.CopiesThe following three fields: • The number of logical partitions containing at least one physical partition (no copies) on the physical volume • The number of logical partitions containing at least two physical partitions (one copy) on the physical volume • The number of logical partitions containing three physical partitions (two copies) on the physical volumeIn bandThe percentage of physical partitions on the physical volume that belong to the logical volume and were allocated within the physical volume region specified by Intra-physical allocation policy.DistributionThe number of physical partitions allocated within each section of the physical volume: outer edge, outer middle, center, inner middle, and inner edge of the physical volume.-m— Lists the following fields for each logical partition:LPsLogical partition number.PV1Physical volume name where the logical partition's first physical partition is located.PP1First physical partition number allocated to the logical partition.PV2Physical volume name where the logical partition's second physical partition (first copy) is located.PP2Second physical partition number allocated to the logical partition.PV3Physical volume name where the logical partition's third physical partition (second copy) is located.PP3Third physical partition number allocated to the logical partition.-nPhysicalVolume — Accesses information from the specific descriptor area of PhysicalVolume variable. The information may not be current since the information accessed with the -n flag has not been validated for the logical volumes. If you do not use the -n flag, the descriptor area from the physical volume that holds the validated information is accessed and therefore the information that is displayed is current. The volume group need not be active when you use this flag.-pPhysicalVolume — Displays the logical volume allocation map for the PhysicalVolume variable. If you use the LogicalVolume parameter, any partition allocated to that logical volume is listed by logical partition number. Otherwise, the state of the partition is listed as one of the following:usedIndicates that the partition is allocated to another logical volume.freeIndicates that the specified partition is not being used on the system.staleIndicates that the specified partition is no longer consistent with other partitions. The computer lists the logical partitions number with a question mark if the partition is stale.
If no flags are specified, the following status is displayed:
Logical volume— Name of the logical volume. Logical volume names must be unique systemwide and can range from 1 to 15 characters.Volume group— Name of the volume group. Volume group names must be unique systemwide and can range from 1 to 15 characters.Logical volume identifier (LV identifier)— Identifier of the logical volume.Permission— Access permission;read-onlyorread-write.Volume group state (VG state)— State of the volume group. If the volume group is activated with the varyonvg command, the state is eitheractive/complete(indicating all physical volumes are active) oractive/partial(indicating all physical volumes are not active). If the volume group is not activated with the varyonvg command, the state isinactive.Logical volume state (LV state)— State of the logical volume. TheOpened/stalestatus indicates the logical volume is open but contains physical partitions that are not current.Opened/syncdindicates the logical volume is open and synchronized.Closedindicates the logical volume has not been opened.Type— Logical volume type.Write verify— Write verify state ofonoroff.Mirror write consistency— Mirror write consistency state ofonoroff.Max LPs— Maximum number of logical partitions the logical volume can hold.PP size— Size of each physical partition.Copies— Number of physical partitions created for each logical partition when allocating.Schedule policy (Sched policy)— Sequential or parallel scheduling policy.LPs— Number of logical partitions currently in the logical volume.PPs— Number of physical partitions currently in the logical volume.Stale partitions— Number of physical partitions in the logical volume that are not current.BB policy— Bad block relocation policy.Inter-policy— Inter-physical allocation policy.Intra-policy— Intra-physical allocation policy.Upper bound— If the logical volume is super strict, upper bound is the maximum number of disks in a mirror copy.Relocatable— Indicates whether the partitions can be relocated if a reorganization of partition allocation takes place.Mount point— File system mount point for the logical volume, if applicable.Label— Specifies the label field for the logical volume.Each LP copy on a separate PV?— The strictness value. Current state of allocation, strict, nonstrict, or superstrict. A strict allocation states that no copies for a logical partition are allocated on the same physical volume. If the allocation does not follow the strict criteria, it is called nonstrict. A nonstrict allocation states that at least one occurrence of two physical partitions belong to the same logical partition. A superstrict allocation states that no partition from one mirror copy may reside the same disk as another mirror copy.Serialize IO?— Serialization of overlapping IOs state ofyesorno. If serialization is turned on (yes), then overlapping IOs are not allowed on a block range, and only a single IO in a block range is processed at any one time. Most applications, such as file systems and databases, perform serialization; therefore, serialization should be turned off (no). The default setting for new logical volumes isno.Stripe width— The number of physical volumes being striped across.Stripe size— The number of bytes per stripe.Infinite Retry— Lists the infinite retry option of the logical volume.
예제
| 명령 | 하는 일 |
|---|---|
lslv lv03 |
lv03과 그 논리·물리 파티션, 속한 볼륨 그룹의 정보 |
lslv -p hdisk2 |
hdisk2의 할당 맵. LV를 주지 않았으므로 LP 번호 없이 각 파티션 상태만 보여 줌 |
lslv -l lv03 |
lv03의 특성과 상태를 물리 볼륨별로 |
lslv -n hdisk2 -p hdisk3 lv02 |
hdisk2의 기술 영역을 써서 hdisk3의 할당 맵을 보여 주며, LV를 주었으므로 lv02에 할당된 LP 번호가 맵에 나옴 |
lslv 00000256a81634bc.2 |
식별자로 지정한 논리 볼륨의 모든 특성과 상태 |
자주 쓰는 형태:
lslv datalv | grep -E "COPIES|MAX LPs|LPs|STALE"
lslv -m datalv | head # 미러 사본 위치
영어 원문
- To display information about logical volume
lv03, enter:lslv lv03
Information about logical volume lv03, its logical and physical partitions, and the volume group to which it belongs is displayed.
- To display the logical volume allocation map for
hdisk2, enter:
lslv -p hdisk2
An allocation map for hdisk2 is displayed, showing the state of each partition. Since no LogicalVolume parameter was included, the map does not contain logical partition numbers specific to any logical volume.
- To display information about logical volume
lv03by physical volume, enter:
lslv -l lv03
The characteristics and status of lv03 are displayed, with the output arranged by physical volume.
- To display information about physical volume
hdisk3gathered from the descriptor area onhdisk2, enter:
lslv -n hdisk2 -p hdisk3 lv02
An allocation map, using the descriptor area on hdisk2, is displayed. Because the LogicalVolume parameter is included, the number of each logical partition allocated to that logical volume is displayed on the map.
- To display information about a specific logical volume, using the identifier, enter:
lslv 00000256a81634bc.2
All available characteristics and status of this logical volume are displayed.
파일
| 파일 | 설명 |
|---|---|
/usr/sbin |
lslv 명령이 있는 디렉터리 |
영어 원문
- /usr/sbin — Contains the lslv command.
Related reference:
- lsvg Command
Related information:
- varyonvg 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로 만듭니다. lslv에 해당하는 것은 lvs -o +devices(LV가 놓인 디스크), lvdisplay -m /dev/vg/lv(세그먼트 배치)입니다.