9.2. LVM caching components
LVM provides support for adding a cache to LVM logical volumes. LVM caching uses the following LVM logical volume types:
- Main LV
- The larger, slower, and original volume.
- Cache pool LV
-
A composite LV that you can use for caching data from the main LV. It has two sub-LVs: data for holding cache data and metadata for managing the cache data. You can configure specific disks for data and metadata. You can use the cache pool only with
dm-cache
. - Cachevol LV
-
A linear LV that you can use for caching data from the main LV. You cannot configure separate disks for data and metadata.
cachevol
can be only used with eitherdm-cache
ordm-writecache
.
All of these associated LVs must be in the same volume group.
You can combine a main logical volume (LV) with a faster, usually smaller, LV that holds the cached data. The fast LV is created from fast block devices, such as SSD drives. When you enable caching for a logical volume, LVM renames and hides the original volumes, and presents a new logical volume that is composed of the original logical volumes. The composition of the new logical volume depends on the caching method and whether you are using the cachevol
or cachepool
option.
The cachevol
and cachepool
options expose different levels of control over the placement of the caching components:
-
With the
cachevol
option, the faster device stores both the cached copies of data blocks and the metadata for managing the cache. With the
cachepool
option, separate devices can store the cached copies of data blocks and the metadata for managing the cache.The
dm-writecache
method is not compatible withcachepool
.
In all configurations, LVM exposes a single resulting device, which groups together all the caching components. The resulting device has the same name as the original slow logical volume.
Ressources supplémentaires
-
lvmcache(7)
man page - Creating and managing thin provisioned volumes (thin volumes)