2

Background

I have a vg with 32G free space on Centos6.9.

When I use lvcreate -T vg/pool -L 30G --poolmetadatasize 2G to create a thin pool, it says insufficient free disk space.

When I reduce the metadatasize to 512MB(lvcreate -T vg/pool -L 30G --poolmetadatasize 512M), it is created without any error but cost 31G space.

When I use % to specify pool's size(lvcreate -T vg/pool -l 100%FREE --poolmetadatasize 2G), it is created successfully but pool's size is only 28G, even adding 2G metadatasize, there is 2G free space missing.

Question

So I have found that poolmetadata will cost double space(specify 512MB, cost 1G, specify 1G, cost 2G), could someone tell me why it cost double space?

1 Answer 1

3
+100

I guess what you're seeing is the so-called "Spare metadata LV", that gets created automatically when you create the first thinpool in a volume group.

You can double-check this with lvs -a to show you all volumes (i.e. also the hidden data/metadata volumes of your thinpool and the spare metadata lv). If you see any volume called lvol0_pmspare or generally something with _pmspare as a suffix that's the spare metadata lv.

You can disable its creation using --poolmetadataspare n when you create the thinpool, however please have a read of the lvmthin(7) manpage before you do so because this volume is required for metadata check and repair operations (i.e. if you don't have it your recovery options are very limited)

1
  • I have done a quick check, it seems true. After checking in detail, I will accept your answer. Thanks a lot.
    – Sraw
    Feb 8, 2018 at 1:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .