이번 포스팅에서는 Linux 서버 LVM에서VG의 정보를 조회할 수 있는 “vgs” 명령어와 관련 vg 정보에 대해 자세히 알아보도록 하겠습니다.
이 포스팅은 아래의 버전에서 테스트한 내용을 기반으로 작성하였습니다
Linux : Red Hat Enterprise Linux release 8.6
1. Volume group (VG) 정보 조회
VG 정보를 조회하는 명령은 vgs 가 있습니다. 먼저 vgs를 수행해 보도록 하겠습니다.
vgs를 수행하면 현재 만들어져 있는 vg의 기본 정보를 표시합니다.
# vgs
# vgs
VG #PV #LV #SN Attr VSize VFree
testvg 1 2 0 wz--n- <15.00g 0
vsg의 각 필드의 정보는 아래와 같습니다.
VG : VG name
#PV : VG에 할당된 PV 개수
#LV : VG에 포함된 LV 개수
#SN : VG에 포함된 스냅숏 개수
Attr : VG의 상태(속성), VG Attr 은 아래의 속성을 나타냅니다.
- 첫 번째 속성 항목 : Permissions : (w)riteable, (r)ead-only
- 두 번째 속성 항목 : Resi(z)eable
- 세 번째 속성 항목 : E(x)ported
- 네 번째 속성 항목 : (p)atrial : 볼륨 그룹에 속하는 하나 이상의 물리적 볼륨이 시스템에서 누락된 경우
- 다섯 번째 속성 항목 : Allocation policy : (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere
- 여섯 번째 속성 항목 : (c)lustered, (s)hared
VSize : VG의 크기
VFree : VG에 남아있는 여유공간
“-o help” 옵션을 함께 수행하여 vg의 모든 필드 정보를 확인할 수 있습니다.
# vgs -o help
…
Volume Group Fields
-------------------
vg_all - All fields in this section.
vg_fmt - Type of metadata.
vg_uuid - Unique identifier.
vg_name - Name.
vg_attr - Various attributes - see man page.
vg_permissions - VG permissions.
vg_extendable - Set if VG is extendable.
vg_exported - Set if VG is exported.
vg_autoactivation - Set if VG autoactivation is enabled.
vg_partial - Set if VG is partial.
vg_allocation_policy - VG allocation policy.
vg_clustered - Set if VG is clustered.
vg_shared - Set if VG is shared.
vg_size - Total size of VG in current units.
vg_free - Total amount of free space in current units.
vg_sysid - System ID of the VG indicating which host owns it.
vg_systemid - System ID of the VG indicating which host owns it.
vg_lock_type - Lock type of the VG used by lvmlockd.
vg_lock_args - Lock args of the VG used by lvmlockd.
vg_extent_size - Size of Physical Extents in current units.
vg_extent_count - Total number of Physical Extents.
vg_free_count - Total number of unallocated Physical Extents.
max_lv - Maximum number of LVs allowed in VG or 0 if unlimited.
max_pv - Maximum number of PVs allowed in VG or 0 if unlimited.
pv_count - Number of PVs in VG.
vg_missing_pv_count - Number of PVs in VG which are missing.
lv_count - Number of LVs.
snap_count - Number of snapshots.
vg_seqno - Revision number of internal metadata. Incremented whenever it changes.
vg_tags - Tags, if any.
vg_profile - Configuration profile attached to this VG.
vg_mda_count - Number of metadata areas on this VG.
vg_mda_used_count - Number of metadata areas in use on this VG.
vg_mda_free - Free metadata area space for this VG in current units.
vg_mda_size - Size of smallest metadata area for this VG in current units.
vg_mda_copies - Target number of in use metadata areas in the VG.
…
“-v” 옵션을 사용하면 Ext, VProfile와 VG UUID 정보를 함께 표시합니다.
# vgs -v
# vgs -v
VG Attr Ext #PV #LV #SN VSize VFree VG UUID VProfile
testvg wz--n- 4.00m 1 2 0 <15.00g 0 AHZLvK-jFLY-v063-bn7D-xR3B-OFtm-f3ieGN
- Ext는 VG의 PV확장 영역의 크기입니다.
- VG UUID는 VG의 UUID입니다.
- VProfile은 VG에 연결된 profile입니다.
“-o” 옵션과 확인하고자 하는 필드를 “+”와 함께 지정하여 특정 필드 정보를 추가로 확인할 수 있습니다.
예를 들어 max_lv 필드 정보를 추가로 확인하고자 할 경우 아래와 같이 수행합니다.
# vgs -o +max_lv
# vgs -o +max_lv
VG #PV #LV #SN Attr VSize VFree MaxLV
testvg 1 2 0 wz--n- <15.00g 0 0
추가 필드를 여러 개 지정할 경우 “,” 구분하여 추가합니다.
# vgs -o +max_lv,max_pv
# vgs -o +max_lv,max_pv
VG #PV #LV #SN Attr VSize VFree MaxLV MaxPV
testvg 1 2 0 wz--n- <15.00g 0 0 0
vg 정보는 vgs 외에 “vgdisplay” 명령으로도 관련 정보를 확인할 수 있습니다.
# vgdisplay
# vgdisplay
--- Volume group ---
VG Name testvg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size <15.00 GiB
PE Size 4.00 MiB
Total PE 3839
Alloc PE / Size 3839 / <15.00 GiB
Free PE / Size 0 / 0
VG UUID AHZLvK-jFLY-v063-bn7D-xR3B-OFtm-f3ieGN
- Metadata Sequence No : 내부 메타데이터의 Revision number이며, 변경될 때마다 증가합니다.
- PE : physical extent의 약자로 PV의 볼륨의 확장 단위(chunk) 입니다.
지금까지 Linux 서버 LVM에서 VG 정보를 조회하는 방법에 대해 알아봤습니다.
감사합니다.
'IT > linux' 카테고리의 다른 글
Linux xfs 파일시스템 생성방법 (0) | 2022.10.18 |
---|---|
Linux LVM LV attr 정보 조회 (0) | 2022.10.18 |
LVM PV attr 정보 조회 (0) | 2022.10.12 |
Redhat Linux 8 LVM 볼륨 생성방법 (0) | 2022.10.05 |
Redhat Linux 8.6 ifup ifdown 사용하기 (0) | 2022.10.03 |
댓글