* [linux-lvm] Why does thinpool take 2*poolmetadatasize space?
@ 2020-10-20 16:33 Scott Moser
2020-10-20 17:02 ` Alasdair G Kergon
2020-10-20 18:02 ` Zdenek Kabelac
0 siblings, 2 replies; 3+ messages in thread
From: Scott Moser @ 2020-10-20 16:33 UTC (permalink / raw)
To: linux-lvm
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 VG Fmt 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 VG Attr LSize Pool 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Why does thinpool take 2*poolmetadatasize space?
2020-10-20 16:33 [linux-lvm] Why does thinpool take 2*poolmetadatasize space? Scott Moser
@ 2020-10-20 17:02 ` Alasdair G Kergon
2020-10-20 18:02 ` Zdenek Kabelac
1 sibling, 0 replies; 3+ messages in thread
From: Alasdair G Kergon @ 2020-10-20 17:02 UTC (permalink / raw)
To: Scott Moser; +Cc: linux-lvm
On Tue, Oct 20, 2020 at 12:33:41PM -0400, Scott Moser wrote:
> 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?
So that you have sufficient disk space to store a second copy of it
if you need to perform any work on the metadata in future.
Recovery operations, for example, create a recovered copy in that
'spare' space then swap to use it leaving the space used by the
original metadata as the new 'spare'.
Alasdair
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-lvm] Why does thinpool take 2*poolmetadatasize space?
2020-10-20 16:33 [linux-lvm] Why does thinpool take 2*poolmetadatasize space? Scott Moser
2020-10-20 17:02 ` Alasdair G Kergon
@ 2020-10-20 18:02 ` Zdenek Kabelac
1 sibling, 0 replies; 3+ messages in thread
From: Zdenek Kabelac @ 2020-10-20 18:02 UTC (permalink / raw)
To: LVM general discussion and development, Scott Moser
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-20 18:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 16:33 [linux-lvm] Why does thinpool take 2*poolmetadatasize space? Scott Moser
2020-10-20 17:02 ` Alasdair G Kergon
2020-10-20 18:02 ` Zdenek Kabelac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).