How to create Thin LVM Pool On Second Drive

We have choosen Linux distro Ubuntu 20.04 in order to create Thin LVM Pool. However, you can select any other distro as the setup is almost same …atleast for CentOS distro. You can simply following these steps to create Thin LVM pool and then add it under virtualizor panel for provisioning of VPS. It is pertinent to mention here that Think LVM pool allows you to oversell disk space.

  1. In order to create Thin LVM Pool first check your Disks using command “lsblk”
  2. Then Enter fdisk for partition of required disk
    fdisk /dev/sdb
  3. Press “n” for new partition or “d” for deleting partition if it is already in use. To check partition layout use fdisk -l
  4. Then created primariy parition by pressing “p”
  5. The keep entering until the all the default options are selected like starting sector, ending sector and default partition number i.e. 1. If it has been previously written as xfs the system will show following error:

Created a new partition 1 of type ‘Linux’ and of size 931.5 GiB.
Partition #1 contains a xfs signature.
Do you want to remove the signature? [Y]es/[N]o:

  1. Just type yes and move on.
  2. Now type wq to execute the above operations.
    Note: (w for just peroforming write and q for quite. If you deleted parition above in step 3 then first perform write command using “w” and then reboot before you can create pritions on it.)
  3. Now reboot after creating partition to start creating volumes on it.
  4. pvcreate /dev/sdb1 [If it already has partition then pvcreate /dev/sda3 or For second drive vg2 pvcreate /dev/sdb1]
  5. root@ice:/home/user#lsblk will show nothing new.

11. vgcreate vg2 /dev/sdb1

Volume group "vg2" successfully created

12. lvs

13. vgs
create Thin LVM Pool

14. Use command lvcreate with disk size to create thinpool

lvcreate --size 931G --type thin-pool --thinpool thin_pool vg2

Thin pool volume with chunk size 512.00 KiB can address at most 126.50 TiB of data.
WARNING: Pool zeroing and 512.00 KiB large chunk size slows down thin provisioning.
WARNING: Consider disabling zeroing (-Zn) or using smaller chunk size (<512.00 KiB).
Logical volume "thin_pool" created.
create Thin LVM Pool

Another example

lvcreate –size 1600G –type thin-pool –thinpool thin_pool vg

create Thin LVM Pool

Another Example:

lvcreate --size 776.3G --type thin-pool --thinpool thin_pool vg
[root@mail-f67-mail ~]#  lvcreate --size 776.3G --type thin-pool --thinpool thin_pool vg  
Rounding up size to full physical extent 776.30 GiB  
Thin pool volume with chunk size 512.00 KiB can address at most 126.50 TiB of data.
WARNING: Pool zeroing and 512.00 KiB large chunk size slows down thin provisioning.
WARNING: Consider disabling zeroing (-Zn) or using smaller chunk size (<512.00 KiB).
Volume group "vg" has insufficient free space (198709 extents): 198733 required.
Try Whole Number 776 instead of Points
lvcreate --size 776G --type thin-pool --thinpool thin_pool vg

You can verify the addition of Thin LVM by command LVS

Now Add the newly created Thin LVM Pool storage in virtualizor

Now upon creation of a new VPS on this Thin LVM we can again check the usage using command LVS

Here we can see a new VPS has been created with 200 GB space under thin_pool group. The data% is also mentioned which is about 2%.

In order to VPS based on thin LVM pool using virtualizor panel go to HostMayo.com. We also suggest to read our article on checking disk speed if you intersted in selling vps.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments