How chunk_size works in LVM thin provisioning and why there is difference between RHEL7.3 and RHEL7.4
Issue
- Prior to RHEL7.4, the lvcreate command could create a thin-provisioned pool with a default chunk_size of 64KiB. After updating to RHEL7.4 and creating an identical thin pool the default chunk_size is different (larger) and value of Meta% is usually significantly smaller. Why does this difference occur?
-
When creating LVM2 thin pools and volumes the way things were calculated changed when RHEL 7.4 was released because the LVM2 version was rebased. This changed the calculation of chunk_size between RHEL 7.3 and 7.4.
This is with lvm2-2.02.166-1.el7_3.5.x86_64:
# lvcreate -L 3T -T testvg/mythinpool -V1T -n thinvolume Using default stripesize 64.00 KiB. Logical volume "thinvolume" created. # lvs -ao name,size,stripesize,chunksize,metadata_percent LV LSize Stripe Chunk Meta% home 72.02g 0 0 root 50.00g 0 0 swap 13.67g 0 0 lvol0 80.00m 0 0 [lvol1_pmspare] 96.00m 0 0 mythinpool 3.00t 0 64.00k 12.74 [mythinpool_tdata] 3.00t 0 0 [mythinpool_tmeta] 96.00m 0 0 thinvolume 1.00t 0 0
And this is with lvm2-2.02.171-8.el7.x86_64:
# lvcreate -L 3T -T testvg/mythinpool -V1T -n thinvolume Using default stripesize 64.00 KiB. Thin pool volume with chunk size 2.00 MiB can address at most 506.00 TiB of data. Logical volume "thinvolume" created. # lvs -ao name,size,stripesize,chunksize,metadata_percent LV LSize Stripe Chunk Meta% home 72.02g 0 0 root 50.00g 0 0 swap 13.67g 0 0 lvol0 80.00m 0 0 [lvol1_pmspare] 96.00m 0 0 mythinpool 3.00t 0 2.00m 0.44 [mythinpool_tdata] 3.00t 0 0 [mythinpool_tmeta] 96.00m 0 0 thinvolume 1.00t 0 0
In the first one the chunk_size was 64KiB and it was changed to 2MiB in the later version of LVM.
Note that some messages are different when creating the thin pool and volume.
Environment
- Red Hat Enterprise Linux 7.4
- lvm2-2.02.171-8.el7.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.