Search code examples
filesystemslvmglusterfs

LVM Thinpool - How to resize a thinpool LV?


I have the following setup:

An LVM volume group over 12 drives on a hardware RAID with one thinpool and one logical volume on a Red Hat Gluster Server. It looks as follows:

root@server:pts/1 - [17:33]
~ % pvs
  PV         VG  Fmt  Attr PSize  PFree
  /dev/sdb   vg0 lvm2 a--  36.38t    0

root@server:pts/1 - [17:34]
~ % vgs
  VG  #PV #LV #SN Attr   VSize  VFree
  vg0   1   2   0 wz--n- 36.38t    0

root@server:pts/1 - [17:34]
~ % lvs
  LV      VG  Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  gluster vg0 Vwi-aot--- 30.02t tp0         7.06
  tp0     vg0 twi-aot--- 36.35t             5.83   0.36

And now the tricky part as with Googling I did not get any solution. I want to resize the LV "gluster" which is in a thinpool with the virtual size of 30 TB. I tried all the extend and resize functions and I did not see anything in the man pages of LVM. So maybe you know how to help here?


Solution

  • You can resize a thin pooled logical volume as follows to have it resized from 30TB to 35TB:

    lvextend -L 35T vg0/gluster
    

    This info was found in man lvmthin:

       Manually manage free data space of thin pool LV
    
           The available free space in a thin pool LV can be displayed with the lvs command.  Free space can be added by extending the thin pool LV.
    
           Command to extend thin pool data space:
           lvextend -L Size VG/ThinPoolLV
    
           Example
           1. A thin pool LV is using 26.96% of its data blocks.
           # lvs
             LV    VG           Attr       LSize   Pool  Origin Data%
             pool0 vg           twi-a-tz--  10.00g               26.96
    
           2. Double the amount of physical space in the thin pool LV.
           # lvextend -L+10G vg/pool0
    
           3. The percentage of used data blocks is half the previous value.
           # lvs
             LV    VG           Attr       LSize   Pool  Origin Data%
             pool0 vg           twi-a-tz--  20.00g               13.48
    
           Other methods of increasing free data space in a thin pool LV include removing a thin LV and its related snapsots, or running fstrim on the file system using a thin LV.