<div dir="ltr"><div>Hi folks,</div><div><br></div><div>I currently do some experiments on the dm-thin-provisioning targets.</div><div>One of these experiments is trying to create/find-out the largest thin volumn on the pool.</div>
<div><br></div><div>As I Know, each time we provision blocks from the pool, the metadata is comsumed for recording the mapping information.</div><div>By executing the lvdisplay command, we can observe the status of the pool & metadata usage, such as</div>
<div>$ sudo lvdisplay | grep Allocated</div><div>  Allocated pool data    7.87%</div><div>  Allocated metadata    6.09%</div><div><br></div><div>And the following content is extracted from thin-provisioning.txt from Documentation\device-mapper in the source tree.</div>
<div>"As a guide, we suggest you calculate the number of bytes to use in the</div><div>metadata device as 48 * $data_dev_size / $data_block_size but round it up</div><div>to 2MB if the answer is smaller."</div><div>
<br></div><div>If the size of the metadata dev was fixed as 16G, and the block size of the pool dev was set as 64K, </div><div>then we may infer that the largest volumn size of the thin is 21.33TB.</div><div><br></div><div>
(48 * $data_dev_size / 64K = 16G</div><div> $data_dev_size = 16G * 64K / 48 = 21.33TB)</div><div><br></div><div>If this inference was not correct, please kindly let me know why.</div><div><br></div><div>Then I do the experiment with the following steps:</div>
<div>1. create a thin-pool with size 21.33T on my RAID0, say, the largest size we infered, and block size 64K, metadata size 16G</div><div>2. create a thin volumn with virtual size 21.33T.</div><div>3. dd data(/dev/uramdom) to the thin device</div>
<div><br></div><div>Finally, I observed that</div><div>  Allocated pool data    100.00%</div><div>  Allocated metadata     71.89%</div><div><br></div><div>It seemed that the pool data had already out of usage, but the metadata was not.</div>
<div>Did it means that, metadata 16G can be applied to record a thin dev with size bigger than 21.73T?</div><div><br></div><div>I did another experiment. In this time, I enlarged the size of pool/ thin dev as big as I could offer.</div>
<div><br></div><div>1. create a thin-pool on my RAID0 with size 36.20T, and block size 64K, metadata size 16G</div><div>2. create a thin volumn with virtual size 36.20T.</div><div>3. dd data to the thin device</div><div><br>
</div><div>Finally, I observed that</div><div>  Allocated pool data    84.52%</div><div>  Allocated metadata    99.99%</div><div><br></div><div>And these messages were shown in dmesge</div><div><span class="" style="white-space:pre">       </span>device-mapper: space map metadata: out of metadata space</div>
<div><span class="" style="white-space:pre">    </span>device-mapper: thin: pre_alloc_func: dm_thin_insert_block failed</div><div><span class="" style="white-space:pre">   </span>device-mapper: space map metadata: out of metadata space</div>
<div><span class="" style="white-space:pre">    </span>device-mapper: thin: commit failed, error = -28</div><div><span class="" style="white-space:pre">    </span>device-mapper: thin: switching pool to read-only mode</div><div>
<br></div><div>In this experiment, we run out of the metadata, and by the "Allocated pool data" field, we infered that the maximum thin device was about 30.59TB, was it correct?</div><div><br></div><div>Regards,</div>
<div>Burton</div><div><br></div>
</div>