LVM thin provisioning allocates disk space as data is written, not when the volume is created. You can therefore carve volumes whose declared sizes add up to more than the physical space actually available, the well-known overcommit. This guide shows how to create a thin pool, provision volumes in it, watch how full it is with Data%, and set up automatic extension to avoid exhaustion. For intermediate Linux administrators, on Debian/Ubuntu and RHEL/AlmaLinux. All outputs come from a real test on AlmaLinux 10 (LVM 2.03.36).
What you will learn
- Tell a thin pool from a thin volume
- Create a pool and carve overcommitted volumes in it with
lvcreate --thin - Read
Data%to follow actual consumption - Set up automatic extension (
thin_pool_autoextend_threshold) - Understand the danger of a full pool and prevent it
Prerequisites
A working LVM stack (see the LVM guide) and the thin tools installed. On RHEL and AlmaLinux 10, lvm2 already pulls in device-mapper-persistent-data; on Debian 13, thin-provisioning-tools is only a recommendation of lvm2, missing from a minimal install:
sudo apt install thin-provisioning-tools lvm2sudo dnf install device-mapper-persistent-data lvm2Without these tools, LVM still creates the pool, but it can no longer check its metadata: at every activation, it prints "WARNING: Check is skipped, please install recommended missing binary /usr/sbin/thin_check!". A pool whose metadata is never checked is a pool whose corruption you will discover too late. The kernel must also load the dm-thin-pool module, present by default on all recent distributions.
Thin pool and thin volume: the model
Thin provisioning adds a level of indirection. Instead of carving a volume directly from the Volume Group, you first create a thin pool (a reservoir of real space), then provision thin volumes inside that pool. Each thin volume announces a size (its virtual size), but only consumes the pool's physical space when data is written to it.
The direct consequence is overcommit: the sum of the volumes' virtual sizes can exceed the pool's real size, exactly like a bank lends more money than it holds in cash, betting that not all customers will withdraw everything at the same time.
Create a thin pool and a thin volume
You create the pool with --type thin-pool, then a volume with --thin, giving its virtual size through -V:
-
Create the thin pool (1.5 GiB of real space here) in a VG named
vg_data:Terminal window sudo lvcreate --type thin-pool -L 1.5G -n pool0 vg_dataThin pool volume with chunk size 64.00 KiB can address at most <15.88 TiB of data.Logical volume "pool0" created. -
Provision a thin volume of 5 virtual GiB in this 1.5 GiB pool:
Terminal window sudo lvcreate --thin -V 5G -n thinvol vg_data/pool0WARNING: Sum of all thin volume sizes (5.00 GiB) exceeds the size ofthin pool vg_data/pool0 and the size of whole volume group (<2.00 GiB).WARNING: You have not turned on protection against thin pools running out of space.WARNING: Set activation/thin_pool_autoextend_threshold below 100 to triggerautomatic extension of thin pools before they get full.Logical volume "thinvol" created.
LVM explicitly warns about the overcommit and the lack of protection, and even names the setting that enables it. These warnings are not errors: they remind you that monitoring how full the pool gets is now your responsibility.
Overcommit in action
This is where thin provisioning makes sense. The Data% column shows the space actually consumed in the pool, regardless of the declared virtual sizes. Right after creation, everything is at zero:
sudo lvs -o lv_name,lv_size,pool_lv,data_percent vg_data LV LSize Pool Data% pool0 1.50g 0.00 thinvol 5.00g pool0 0.00thinvol shows 5 GiB while the pool only holds 1.5, and yet nothing is consumed. Let's write 500 MiB of real data to the volume, then look again:
sudo mkfs.xfs /dev/vg_data/thinvolsudo mount /dev/vg_data/thinvol /mnt/datasudo dd if=/dev/zero of=/mnt/data/bigfile bs=1M count=500sudo lvs -o lv_name,lv_size,data_percent vg_data LV LSize Data% pool0 1.50g 39.12 thinvol 5.00g 11.74The pool is now 39.12% full (the 500 MiB written, plus the XFS structures), and the thin volume 11.74% of its 5 virtual GiB. Only the space actually written is consumed: that is the whole point of thin provisioning.
The danger: a pool that fills up
An overcommitted thin pool ends up filling if its volumes all grow at the same time. The test pushed it to the limit: 1.5 GiB written to thinvol while the pool only holds 1.5 in total. After one minute, dd fails with "No space left on device", and lvs shows the pool full:
LV Attr Data% Meta% pool0 twi-aotzD- 100.00 25.20 thinvol Vwi-aotz-- 30.00The D in the attribute flags a pool out of data space. The kernel log tells the sequence: "switching pool to out-of-data-space (queue IO) mode", then 61 seconds later "(error IO) mode". That delay is the no_space_timeout parameter of the dm_thin_pool module, which is 60 seconds, and lvs -o lv_when_full shows queue, the default behaviour.
Overcommit is therefore not magic: if all the volumes fill up at the same time, the pool runs out. The rule is simple: watch Data% and Meta%, and grow the pool before reaching the limit.
sudo lvs -o lv_name,attr,data_percent,metadata_percent vg_dataGrow the pool automatically
Rather than watching by hand, you configure LVM to grow the pool by itself before it runs out. Two directives in /etc/lvm/lvm.conf, activation section:
activation { thin_pool_autoextend_threshold = 80 thin_pool_autoextend_percent = 20}thin_pool_autoextend_threshold: the trigger threshold. At 80, the pool grows as soon as it reaches 80% full. The value 100 disables automatic extension (minimum accepted: 50).thin_pool_autoextend_percent: the pool grows by this percentage of its size at each trigger.
The extension relies on the dmeventd daemon, which receives kernel notifications and runs lvextend automatically. The pool must still be monitored:
sudo lvchange --monitor y vg_data/pool0sudo lvs -o +seg_monitor vg_data/pool0 # must show "monitored"When to use thin provisioning
Thin provisioning shines when the declared space far exceeds the space used, or when you multiply volumes:
- Many cheap snapshots: thin snapshots share the pool's blocks instead of preallocating a fixed size.
- VM and container disks: you provision generously without tying up the disk. It is exactly what Proxmox VE does with its LVM-thin backend (in French), which supports native snapshots and clones.
- Controlled overallocation: give every service a comfortable volume without buying the total disk in advance.
The trade-off is always the same: monitoring is not optional. An unmonitored thin pool is an outage waiting for its time.
Troubleshooting
Thin provisioning failures show up in lvs and in the kernel log. Watch the pool's attribute (a D flags a full pool), the Data% and Meta% columns, and the device-mapper: thin messages from dmesg.
| Symptom | Likely cause | Fix |
|---|---|---|
| Required device-mapper target(s) not detected in your kernel | dm-thin-pool module missing | sudo modprobe dm-thin-pool |
| Check is skipped, please install recommended missing binary /usr/sbin/thin_check! | thin tools missing | install thin-provisioning-tools (Debian) or device-mapper-persistent-data (RHEL) |
| Writes stuck for a minute, then No space left on device | pool full (Data% or Meta% at 100, D attribute) | grow the pool (lvextend), add a disk to the VG |
| The pool does not grow by itself | pool not monitored or VG full | lvchange --monitor y, check vgs (VFree) |
Key points
- Thin provisioning allocates space on write, not on creation.
- A thin pool (real space) holds thin volumes (virtual size), with
lvcreate --type thin-poolthenlvcreate --thin -V. - Overcommit allows a sum of virtual sizes larger than the pool;
Data%shows the real usage. - A full pool corrupts data: watch
Data%andMeta%. - Enable automatic extension (
thin_pool_autoextend_threshold) and monitoring (lvchange --monitor y). - Autoextend needs free space in the VG: thin provisioning does not create disk.
Knowledge check
Check that the essentials of this guide are acquired. The questions only cover what has just been explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Migrate and remove an LVM disk with pvmove
A new full quiz with random questions
Work again only on the questions you missed
FAQ: frequently asked questions about LVM thin provisioning
These answers cover the most frequent questions about thin provisioning: overcommit, pool monitoring and its automatic extension.
Data% and growing the pool before it runs out.Data% or Meta% reaches 100%, writes are first queued (60 seconds in queue mode, the default) then fail with "No space left on device". A full pool risks corrupting the file system and calls for a repair (fsck/xfs_repair). Metadata exhaustion is especially nasty: the pool becomes unusable even if data space remains. Monitoring is therefore mandatory.lvs -o lv_name,attr,data_percent,metadata_percent
Data% follows the data space consumed, Meta% the metadata. To automate, you set thin_pool_autoextend_threshold (for instance 80) in /etc/lvm/lvm.conf and enable monitoring by dmeventd with lvchange --monitor y vg/pool. The pool then grows by itself, provided the Volume Group has free space.lvcreate --type thin-pool, then the volumes with lvcreate --thin -V. Several thin volumes thus share the same reservoir.