본문 바로가기
IT/linux

LVM PV attr 정보 조회

by 방구석꼰머 2022. 10. 12.
반응형

이번 포스팅에서는 Linux 서버 LVM 에서 PV의 정보를 조회할 수 있는 “pvs” 명령어와 관련 pv 정보에 대해 자세히 알아보도록 하겠습니다.

 

이 포스팅은 아래의 버전에서 테스트한 내용을 기반으로 작성하였습니다
Linux : Red Hat Enterprise Linux release 8.6

1. Physical volume (PV) 정보 조회

PV 정보를 조회하는 명령은 pvs 가 있습니다. 먼저 pvs를 수행해 보도록 하겠습니다.

pvs를 수행하면 현재 만들어져 있는 pv의 기본 정보를 표시합니다.

 

# pvs

# pvs
  PV           VG     Fmt  Attr PSize   PFree
  /dev/nvme0n2 testvg lvm2 a--  <15.00g    0

pvs의 각 필드의 정보는 아래와 같습니다.

 

PV : PV name

VG : PV가 할당된 VG

Fmt : PV의 메타데이터 형식

Attr : PV의 상태(속성) , PV Attr 은 아래의 속성을 나타냅니다.

  • 첫 번째 속성 항목 : (d)uplicate, (a)llocatable, (u)sed
  • 두 번째 속성 항목 : e(x)ported
  • 세 번째 속성 항목 : (m)issing

PSize : PV의 크기

PFree : PV에 남아있는 여유공간

 

“-o help” 옵션을 함께 수행하여 pv의 모든 필드 정보를 확인할 수 있습니다.

# pvs -o help

…
Physical Volume Fields
  ----------------------
    pv_all                      - All fields in this section.
    pe_start                    - Offset to the start of data on the underlying device.
    pv_size                     - Size of PV in current units.
    pv_free                     - Total amount of unallocated space in current units.
    pv_used                     - Total amount of allocated space in current units.
    pv_attr                     - Various attributes - see man page.
    pv_allocatable              - Set if this device can be used for allocation.
    pv_exported                 - Set if this device is exported.
    pv_missing                  - Set if this device is missing in system.
    pv_pe_count                 - Total number of Physical Extents.
    pv_pe_alloc_count           - Total number of allocated Physical Extents.
    pv_tags                     - Tags, if any.
    pv_mda_count                - Number of metadata areas on this device.
    pv_mda_used_count           - Number of metadata areas in use on this device.
    pv_ba_start                 - Offset to the start of PV Bootloader Area on the underlying device in current units.
    pv_ba_size                  - Size of PV Bootloader Area in current units.
    pv_in_use                   - Set if PV is used.
    pv_duplicate                - Set if PV is an unchosen duplicate.
    pv_device_id                - Device ID such as the WWID.
    pv_device_id_type           - Type of device ID such as WWID.
…

 

 

“-v” 옵션을 사용하면 DevSize와 PV UUID 정보를 함께 표시합니다.

# pvs -v

# pvs -v
  PV           VG     Fmt  Attr PSize   PFree DevSize PV UUID
  /dev/nvme0n2 testvg lvm2 a--  <15.00g    0   15.00g 3hiCis-Gu16-xtrs-gEJh-IeVh-6ksr-KEiJ70
  • DevSize는 PV가 생성된 장치의 크기입니다.

 

“-o” 옵션과 확인하고자 하는 필드를 “+”와 함께 지정하여 특정 필드 정보를 추가로 확인할 수 있습니다.

예를 들어 pv_used 필드 정보를 추가로 확인하고자 할 경우 아래와 같이 수행합니다.

# pvs -o +pv_used

# pvs -o +pv_used
  PV           VG     Fmt  Attr PSize   PFree Used
  /dev/nvme0n2 testvg lvm2 a--  <15.00g    0  <15.00g

 

추가 필드를 여러 개 지정할 경우 “,” 구분하여 추가합니다.

# pvs -o +pv_used,pe_start

# pvs -o +pv_used,pe_start
  PV           VG     Fmt  Attr PSize   PFree Used    1st PE
  /dev/nvme0n2 testvg lvm2 a--  <15.00g    0  <15.00g   1.00m

 

 

pv 정보는 pvs 외에 “pvdisplay” 명령으로도 관련 정보를 확인할 수 있습니다.

# pvdisplay

pvdisplay
pvdisplay

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/nvme0n2
  VG Name               testvg
  PV Size               15.00 GiB / not usable 4.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              3839
  Free PE               0
  Allocated PE          3839
  PV UUID               3hiCis-Gu16-xtrs-gEJh-IeVh-6ksr-KEiJ70
  • PE는 physical extent의 약자로 PV의 볼륨의 확장 단위(chunk)입니다.

 

 

지금까지 Linux 서버 LVM 에서 PV 정보를 조회하는 방법에 대해 알아봤습니다.

 

감사합니다.

반응형

'IT > linux' 카테고리의 다른 글

Linux LVM LV attr 정보 조회  (0) 2022.10.18
Linux LVM VG attr 정보 조회  (0) 2022.10.14
Redhat Linux 8 LVM 볼륨 생성방법  (0) 2022.10.05
Redhat Linux 8.6 ifup ifdown 사용하기  (0) 2022.10.03
Redhat Linux 8 bonding 구성  (0) 2022.10.01

댓글