How to create an LVM thin volume

When a storage pool must present more logical capacity than it has physically reserved, an LVM thin volume lets an application see a full block device while real blocks are allocated only as data is written. The thin volume depends on an existing thin pool, so the pool's data and metadata usage become part of the success check.

A thin volume is created with a virtual size and a thin pool reference instead of a normal --size allocation from the volume group. The new device appears under paths such as /dev/vgdata/appdata and /dev/mapper/vgdata-appdata, but its Data% starts near zero until writes consume pool space.

Thin provisioning can overcommit storage, and that overcommitment needs pool monitoring plus enough free extents to extend the pool before it fills. A full data or metadata area can pause writes to thin volumes, and the new block device remains raw storage until it is formatted, mounted, encrypted, or assigned to an application.

Steps to create an LVM thin volume:

  1. Check the target thin pool.
    $ sudo lvs --options lv_name,lv_size,lv_attr,data_percent,metadata_percent vgdata/thinpool
      LV       LSize   Attr       Data%  Meta%
      thinpool 100.00g twi-a-tz-- 0.00   10.94

    Replace vgdata/thinpool with the thin pool that should provide blocks for the new thin volume. The twi prefix in Attr identifies a thin pool, and Data% plus Meta% should leave room for expected writes.
    Related: How to create an LVM thin pool

  2. Create the thin volume.
    $ sudo lvcreate --type thin --virtualsize 200G --thinpool thinpool --name appdata vgdata
      WARNING: Sum of all thin volume sizes (200.00 GiB) exceeds the size of thin pool vgdata/thinpool.
      Logical volume "appdata" created.

    Use a virtual size larger than the pool only when thin-pool monitoring, alerts, and an extension plan are in place. Choose a virtual size at or below the pool size when overcommitment is not intended.

  3. List the new thin volume.
    $ sudo lvs --options lv_name,lv_size,lv_attr,pool_lv,data_percent vgdata/appdata
      LV      LSize   Attr       Pool     Data%
      appdata 200.00g Vwi-a-tz-- thinpool 0.00

    The V prefix in Attr identifies a thin volume, and Pool shows the thin pool that backs it.

  4. Confirm the active block device path.
    $ lsblk /dev/vgdata/appdata
    NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    vgdata-appdata  253:4    0   200G  0 lvm

    The empty MOUNTPOINTS column is expected until the thin volume is formatted and mounted or handed to another storage layer.

  5. Recheck thin pool usage after creation.
    $ sudo lvs --options lv_name,lv_size,data_percent,metadata_percent vgdata/thinpool
      LV       LSize   Data%  Meta%
      thinpool 100.00g 0.00   10.94

    Data% rises as thin volumes receive writes, not when virtual capacity is created. Extend the thin pool before Data% or Meta% approaches 100%.