[linux-lvm] Converting existing thick LVs into thin LVs possible?

Jeremy Smith jeremy at esilo.com
Fri Feb 14 19:21:40 UTC 2014


I have a system currently using LVM2 that was originally set up on
RHEL5 (where thin provisioning was not supported).
This system would greatly benefit from the newer thin provisioning
features, and so I am investigating upgrading to RHEL6 so that I may
take advantage. My question is this: Can I convert existing LVM2
"thick" logical volumes into thinly-provisioned volumes on the fly?

This page:
 https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/thinly_provisioned_volume_creation.html

lead me to believe that it is possible:
 "You can use the --thinpool parameter of the lvconvert command to
convert an existing logical volume to a thin volume."

with the following:

 lvconvert --thinpool vg001/lv1 --poolmetadata vg001/lv2

However, I seem to not understand how that works. From the example, I
would assume that vg001/lv1 is the existing "thick" LV that I want to
convert and that vg001/lv2 is an existing LV with enough space to
become the metadata. So, I create a metadata LV with:

test at testbox:~$ sudo lvcreate  -L16G MyVG -n Metadata
  Logical volume "Metadata" created

But when I attempt the conversion, I do not get what I would expect:

test at testbox:~$ sudo lvconvert --thinpool  MyVG/OldThickLV1
--poolmetadata MyVG/Metadata
  Converted MyVG/OldThickLV1 to thin pool.

Then the OldThickLV1 disappears, leaving Metadata around:

test at testbox:~$ sudo lvdisplay
  --- Logical volume ---
  LV Name                Metadata
  VG Name                MyVG
  LV UUID                IZb6zP-D7iD-NswX-XcDZ-K5fN-sGBj-lCMiqO
  LV Write Access        read/write
  LV Creation host, time testbox, 2014-02-14 13:50:04 -0500
  LV Pool transaction ID 0
  LV Pool metadata       Metadata_tmeta
  LV Pool data           Metadata_tdata
  LV Pool chunk size     64.00 KiB
  LV Zero new blocks     no
  LV Status              available
  # open                 0
  LV Size                16.00 GiB
  Allocated pool data    0.00%
  Allocated metadata     0.01%
  Current LE             4096
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:5


Am I doing something wrong here?
Or am I going to have to create a new thin pool, new thin logical
volumes, and copy the data over?


Thanks,

-- 
Jeremy




More information about the linux-lvm mailing list