Question & Answer
Question
Readvgda output displays the volume group physical partition (PP) size as a value from 20-30. How can I translate this value into an actual PP size in megabytes?
Answer
While reviewing readvgda output, you can determine the PP size of a vg from the LVMREC using the following method...
eg:
From a Regular VG:
*****************************************
LVMREC at block 7
*****************************************
lvmid: 1598838349 (5f4c564d)
vgid: 00ce8c5d00004c000000010051f03ee6
lvmarea_len: 18000
vgda_len: 8744
vgda_psn[0]: 384
vgda_psn[1]: 9384
reloc_psn: 134217471
pv_num: 1
pp_size: 26 <<<<<<<<<<
vgsa_len: 256
vgsa_psn[0]: 128
vgsa_psn[1]: 9128
version: 9
vg_type: 0
ltg_shift: 0(128K)
From a Scalable VG:
============= B: LVM REC 0x7 (0xe00) =============
lvm_id: _LVM
vgid: 00050a850000d6000000011f85f7a332
pv_num: 1
version: 30
pp_size: 26 <<<<<<<<<<
ltg_shift: 0
lvmarea_len: 000045d4 (008ba800)
vgsa_psn[0]: 00000080 (00010000) vgsa_len: 00000100 (00020000)
vgda_psn[0]: 00000180 (00030000) vgda_len: 000021ea (0043d400)
vgsa_psn[1]: 0000236a (0046d400) vgsa_len: 00000100 (00020000)
vgda_psn[1]: 0000246a (0048d400) vgda_len: 000021ea (0043d400)
reloc_psn: 013ffeff (7ffdfe00) reloc_len: 00000100 (00020000)
============= E: LVM REC =============
The pp_size value is defined as:
From /usr/include/lvmrec.h
/* Partition size. (2 to the power pp_size) */
short int pp_shift;
So 2^26 = 67108864 (bytes)
67108864 / 1024 = 65536 (Kb)
65536 / 1024 = 64 (Mb)
As shown, doing the calculation will give you the size in mb but this matrix makes it a little easier...
pp_size index = size_in_mb
30 = 1024mb (1gb)
29 = 512mb
28 = 256mb
27 = 128mb
26 = 64mb
25 = 32mb
24 = 16mb
23 = 8 mb
22 = 4mb
21 = 2mb
20 = 1mb
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
isg3T1011022