How to Convert Normal LV to ThinPool.

In this post, I am going to explain the steps to convert LV to ThinPool.

Step 1 : Here I have create new Volume named as testlv4-nt of size 100M on volume group testvg.

[root@localhost ~]# lvcreate -n testlv4-nt -L 100M testvg
Logical volume “testlv4-nt” created

Step 2 : Created xfs file system on the new created volume.

[root@localhost ~]# mkfs.xfs /dev/testvg/testlv4-nt
meta-data=/dev/testvg/testlv4-nt isize=256 agcount=4, agsize=6400 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=25600, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=4265, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

Step 3 : Created volume for metadata which is require for converstion of Logical Volume to Thin pool. Created file system on that Volume as well.

[root@localhost ~]# lvcreate -n testlv4md-nt -L 50M testvg
Rounding up size to full physical extent 52.00 MiB
Logical volume “testlv4md-nt” created

[root@localhost ~]# mkfs.xfs /dev/testvg/testlv4md-nt
meta-data=/dev/testvg/testlv4md-nt isize=256 agcount=2, agsize=6656 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=13312, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=4265, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

Formula for calculation of metadata size is Pool_LV_SIZE/Pool_LV_Chunk_size*64. Here I have taken the random value for creation.

Currently we are not having flexibility for changing the metadata size at later point of time.

Step 4 : Converted the Volume to thinpool. Name of Volume will not change but now it is thinpool you can check the attributes in below command to confirm the same.

[root@localhost ~]# lvconvert –thinpool testvg/testlv4-nt –poolmetadata testvg/testlv4md-nt
Converted testvg/testlv4-nt to thin pool.

[root@localhost ~]# lvs | egrep “LV|testlv4-nt”
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
testlv4-nt testvg twi-a-tz– 100.00m 0.00

Step 5 : Now we can use the thinpool to create Volumes on top of it.

[root@localhost ~]# lvcreate -V200M -T testvg/testlv4-nt -n testlv4-tp
Logical volume “testlv4-tp” created

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s