apt-get install -y lvm2 thin-provisioning-tools && reboot
export device=/dev/xvdf export vgname=docker export lvname=thinpool
pvcreate $device
vgcreate $vgname $device
Create logical volumes
lvcreate --wipesignatures y -n ${lvname} ${vgname} -l 95%VG lvcreate --wipesignatures y -n ${lvname}meta ${vgname} -l 1%VG
sudo lvconvert -y --zero n -c 512K --thinpool ${vgname}/${lvname} --poolmetadata ${vgname}/${lvname}meta
mkdir -p /etc/lvm/profile/ tee /etc/lvm/profile/${vgname}-${lvname}.profile << EOF activation { thin_pool_autoextend_threshold=80 thin_pool_autoextend_percent=20 } EOF lvchange --metadataprofile ${vgname}-${lvname} ${vgname}/${lvname} lvs -o+seg_monitor
Adding “-tpool” to dm.tinpooldev is important on debian systems.
{ "storage-driver": "devicemapper", "storage-opts": [ "dm.thinpooldev=/dev/mapper/docker-thinpool-tpool", "dm.use_deferred_removal=true", "dm.use_deferred_deletion=true", "dm.mountopt=mand" ] }