[linux-lvm] [PATCH] man: document that 2 times poolmetadatasize is allocated for lvmthin

2020-10-20 Thread Scott Moser
diff --git a/man/lvmthin.7_main b/man/lvmthin.7_main
index ce2343183..e21e516c9 100644
--- a/man/lvmthin.7_main
+++ b/man/lvmthin.7_main
@@ -1101,6 +1101,11 @@ specified with the --poolmetadatasize option.
When this option is not
 given, LVM automatically chooses a size based on the data size and chunk
 size.

+The space allocated by creation of a thinpool will include
+a spare metadata LV by default (see "Spare metadata LV").  As a result,
+the VG must have enough space for the --size option plus twice
+the specified (or calculated) --poolmetadata value.
+
 It can be hard to predict the amount of metadata space that will be
 needed, so it is recommended to start with a size of 1GiB which should be
 enough for all practical purposes.  A thin pool metadata LV can later be

___
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



Re: [linux-lvm] Why does thinpool take 2*poolmetadatasize space?

2020-10-20 Thread Zdenek Kabelac

Dne 20. 10. 20 v 18:33 Scott Moser napsal(a):

When I create an lvmthinpool with size S and poolmetadatasize P,
it reduces the available freespace by S+2P. I expected that to
be S+P. Where did the extra poolmetadatasize get used?

See below for example.
before lvcreate we had 255868 free, after we had 254588.
The difference is 1280.  (1024 + 2*128).




lvm2 preallocated hidden _pmspare volume which has the size of
biggest metadata LV in a VG.

Such LV is used for automated 'lvconvert --repair'.

If you don't want this LV to be created you can add

--poolmetadataspare y|n

but in this case you are fully in your own to figure out,
where to take the space for repaired metadata.

You can also at any time lvremove _pmspare LV if necessary.

Regards

Zdenek

___
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



[linux-lvm] Why does thinpool take 2*poolmetadatasize space?

2020-10-20 Thread Scott Moser
When I create an lvmthinpool with size S and poolmetadatasize P,
it reduces the available freespace by S+2P. I expected that to
be S+P. Where did the extra poolmetadatasize get used?

See below for example.
before lvcreate we had 255868 free, after we had 254588.
The difference is 1280.  (1024 + 2*128).

# lvm vgcreate --metadatasize=128m myvg0 /dev/vda
  Physical volume "/dev/vda" successfully created.
  Volume group "myvg0" successfully created

# pvs --unit=m
  PV VGFmt  Attr PSize  PFree
  /dev/vda   myvg0 lvm2 a--  255868.00m 255868.00m

# vgs --unit=m
  VG#PV #LV #SN Attr   VSize  VFree
  myvg0   1   0   0 wz--n- 255868.00m 255868.00m

# lvm lvcreate --ignoremonitoring --yes --activate=y \
   --setactivationskip=n --size=1024m --poolmetadatasize=128m \
   --thinpool=mythinpool myvg0
  Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of da
ta.
  Logical volume "mythinpool" created.

# vgs --unit=m
  VG#PV #LV #SN Attr   VSize  VFree
  myvg0   1   1   0 wz--n- 255868.00m 254588.00m

# lvs --all --unit=m
  LV VGAttr   LSizePool Origin Data%
Meta%  Move Log Cpy%Sync Convert
  [lvol0_pmspare]myvg0 ewi---  128.00m
  mythinpool myvg0 twi-a-tz-- 1024.00m 0.00   10.03
  [mythinpool_tdata] myvg0 Twi-ao 1024.00m
  [mythinpool_tmeta] myvg0 ewi-ao  128.00m

___
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/