LVCONVERT(8)
โจ NAME โจ
lvconvert โ Change logical volume layout ๐
okay so bestie, this page is from the System Manager's Manual, section 8, and it's literally all about changing your LV's whole vibe. periodt.
๐ธ SYNOPSIS ๐ธ
here's how you call it, no cap:
lvconvert option_args position_args
[ option_args ]
[ position_args ]
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-b|--background
-H|--cache
--cachedevice PV
--cachemetadataformat auto|1|2
--cachemode writethrough|writeback|passthrough
--cachepolicy String
--cachepool LV
--cachesettings String
--cachesize Size[m|UNIT]
--cachevol LV
-c|--chunksize Size[k|UNIT]
--commandprofile String
--compression y|n
--config String
-d|--debug ...
--deduplication y|n
--devices PV
--devicesfile String
--discards passdown|nopassdown|ignore
--driverloaded y|n
--errorwhenfull y|n
-f|--force ...
-h|--help
--integritysettings String
-i|--interval [+]Number
--journal String
--lockopt String
--longhelp
--merge
--mergemirrors
--mergesnapshot
--mergethin
--metadataprofile String
--mirrorlog core|disk
-m|--mirrors [+|-]Number
-n|--name String
--nohints
--nolocking
--noudevsync
--originname LV
--pooldatavdo y|n
--poolmetadata LV
--poolmetadatasize Size[m|UNIT]
--poolmetadataspare y|n
--profile String
-q|--quiet ...
--raidintegrity y|n
--raidintegrityblocksize Number
--raidintegritymode String
-r|--readahead auto|none|Number
-R|--regionsize Size[m|UNIT]
--repair
--replace PV
-k|--setactivationskip y|n
-s|--snapshot
--splitcache
--splitmirrors Number
--splitsnapshot
--startpoll
--stripes Number
-I|--stripesize Size[k|UNIT]
--swapmetadata
-t|--test
-T|--thin
--thinpool LV
--trackchanges
--type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|
vdo-pool|cache|cache-pool|writecache
--uncache
--usepolicies
--vdopool LV
--vdosettings String
-v|--verbose ...
--version
-V|--virtualsize Size[m|UNIT]
-W|--wipesignatures y|n
-y|--yes
-Z|--zero y|n
I know, it's a lot. But you got this, bestie. ๐
๐ฆ DESCRIPTION ๐ฆ
okay so like, lvconvert changes the LV type and also has a bunch of utilities for LV data maintenance. The LV type controls data layout and redundancy. It's also called the segment type or segtype. slay.
To see what your current LV type is, run this iconic command:
lvs -o name,segtype LV
Sometimes an LV is just a single device mapper (dm) layer sitting above physical devices. Other times, there are hidden LVs (dm devices) layered between the visible LV and the physical devices. Those LVs in the middle layers? They're called sub LVs. And here's the tea: a command you run on a visible LV might actually operate on a sub LV instead of the LV you specified. In other cases, you have to specify the sub LV directly on the command line. no cap.
You can show sub LVs with:
lvs -a
Now, the linear type is equivalent to the striped type when there's only one stripe. In that case, the types can sometimes be used interchangeably. lowkey convenient.
In most cases, the mirror type is deprecated and you should use the raid1 type instead. They're both implementations of mirroring, just so you know.
Striped raid types are: raid0/raid0_meta, raid5 (which is an alias for raid5_ls), raid6 (an alias for raid6_zr), and raid10 (an alias for raid10_near).
As opposed to mirroring, raid5 and raid6 stripe data and calculate parity blocks. Those parity blocks can be used for data block recovery if devices fail. A maximum of one device in a raid5 LV may fail, and two in the case of raid6. Striped raid types typically rotate the parity and data blocks for performance reasons, so they avoid contention on a single device. Specific arrangements of parity and data blocks (aka layouts) can be used to optimize I/O performance, or to convert between raid levels. See lvmraid(7) for more info.
Layouts of raid5 rotating parity blocks can be:
- left-asymmetric (
raid5_la) - left-symmetric (
raid5_lswith aliasraid5) - right-asymmetric (
raid5_ra) - right-symmetric (
raid5_rs) raid5_n, which doesn't rotate parity blocks.
Layouts of raid6 are:
- zero-restart (
raid6_zrwith aliasraid6) - next-restart (
raid6_nr) - next-continue (
raid6_nc)
Layouts including _n allow for conversion between raid levels (raid5_n to raid6 or raid5_n to striped/raid0/raid0_meta). Also, special raid6 layouts for raid level conversions between raid5 and raid6 are: raid6_ls_6, raid6_rs_6, raid6_la_6 and raid6_ra_6. Those correspond to their raid5 counterparts (e.g. raid5_rs can be directly converted to raid6_rs_6 and vice-versa). iykyk.
raid10 (an alias for raid10_near) is currently limited to one data copy and an even number of sub LVs. This is a mirror group layout, so a single sub LV may fail per mirror group without data loss. bestie, that's kinda iconic.
Striped raid types support converting the layout, their stripesize and their number of stripes.
The striped raid types combined with raid1 allow for conversion from linear โ striped/raid0/raid0_meta and vice-versa, e.g. via linear โ raid1 โ raid5_n (then adding stripes) โ striped/raid0/raid0_meta. the way that works is so satisfying fr fr.
๐ USAGE ๐
okay bestie, this is the whole menu of things lvconvert can do to your LV, and yeah it is A LOT. every single one of these is a different little transformation. find yours, copy the shape, go off. ๐ซถ
Each one below shows the exact synopsis, so keep an eye on which flags are allowed with which move โ the tool is picky and honestly, same. ๐
๐ธ Convert LV to linear
the glow-down, but make it useful โ you're turning your LV into <pink>linear`.
lvconvert --type linear LV
[ COMMON_OPTIONS ]
[ PV ... ]
๐ฆ Convert LV to striped
spread that data across PVs, main character energy across the whole VG.
lvconvert --type striped LV
[ -i|--interval [+]Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ --stripes Number ]
[ COMMON_OPTIONS ]
[ PV ... ]
๐ Convert LV to type mirror (also see type raid1),
mirror me, baby. (and yeah, <hotpink>also see type raid1` โ they're besties.)
lvconvert --type mirror LV
[ -i|--interval [+]Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -m|--mirrors [+|-]Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ --mirrorlog core|disk ]
[ --stripes Number ]
[ COMMON_OPTIONS ]
[ PV ... ]
๐ Convert LV to raid or change raid layout (a specific raid level must be used, e.g. raid1).
heads up bestie: a specific raid level must be used, like raid1. you cannot just vibe with a generic raid and hope.
lvconvert --type raid LV
[ -i|--interval [+]Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -m|--mirrors [+|-]Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ --stripes Number ]
[ COMMON_OPTIONS ]
[ PV ... ]
โจ Convert LV to raid1 or mirror, or change number of mirror images
same command, three different moods: go raid1, go mirror, or just change how many mirror images you have.
lvconvert -m|--mirrors [+|-]Number LV
[ -i|--interval [+]Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ --mirrorlog core|disk ]
[ COMMON_OPTIONS ]
[ PV ... ]
๐ Convert raid LV to change number of stripe images
resizing your stripe count, iconic.
lvconvert --stripes Number LV1
[ -i|--interval [+]Number ]
[ -I|--stripesize Size[k|UNIT] ]
[ -R|--regionsize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: raid
ngl, this one only works onraidโ that's whatLV1 types: raidmeans. if your LV isn't raid, it's not the moment. ๐
๐ Convert raid LV to change the stripe size
tiny stripe, big stripe, whatever โ just change the size.
lvconvert -I|--stripesize Size[k|UNIT] LV1
[ -i|--interval [+]Number ]
[ -R|--regionsize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: raid
๐ Split images from a raid1 or mirror LV and use them to create a new LV
taking some of the images and giving them their own little life. so brave of them.
lvconvert --splitmirrors Number -n|--name LV_new LV1
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: cache mirror raid1
๐ง Split images from a raid1 LV and track changes to origin for later merge
splitting them off but keeping receipts, so you can merge back later.
lvconvert --splitmirrors Number --trackchanges LV1
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: cache raid1
๐ Merge LV images that were split from a raid1 LV
reunited and it feels so good.
lvconvert --mergemirrors VG|LV1|Tag ...
[ COMMON_OPTIONS ]
LV1 types: linear raid
๐ Convert LV to a thin LV, using the original LV as an external origin
the original LV becomes the external origin, which is a very fancy title for it to hold.
lvconvert --thinpool LV --type thin LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -T|--thin ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --metadataprofile String ]
[ --originname LV ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped cache raid thin zero error
๐ฆ Convert LV to a thin LV, using LV as thin-pool data volume
here the LV itself becomes the thin-pool data volume. multitasking queen.
lvconvert --type thin LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -T|--thin ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --metadataprofile String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped cache raid vdo writecache zero error
๐ฅ Attach a cache pool to an LV, converting the LV to type cache
your LV gets a cache pool and levels up to <purple>type cache`.
lvconvert --cachepool LV --type cache LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -H|--cache ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --metadataprofile String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped raid thin thinpool thinpooldata vdo
vdopool vdopooldata zero error
โญ Attach a writecache to an LV, converting the LV to type writecache
writecache time. the LV becomes <cyan>type writecache`.
lvconvert --cachevol LV --type writecache LV1
[ --cachesettings String ]
[ COMMON_OPTIONS ]
LV1 types: linear striped raid thinpool
๐ Attach a cache to an LV, converting the LV to type cache
cache from a cachevol, and boom: <purple>type cache`.
lvconvert --cachevol LV --type cache LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -H|--cache ]
[ -Z|--zero y|n ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --poolmetadatasize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: linear striped raid thinpool
๐ Add a writecache to an LV, using a specified cache device
you point at a specific PV to be the cache device.
lvconvert --cachedevice PV --type writecache LV1
[ --cachesettings String ]
[ --cachesize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: linear striped raid thinpool
๐บ Add a cache to an LV, using a specified cache device
same idea, but cache instead of writecache.
lvconvert --cachedevice PV --type cache LV1
[ -c|--chunksize Size[k|UNIT] ]
[ --cachesettings String ]
[ --cachesize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: linear striped raid thinpool
๐จ Convert LV to type thin-pool (existing data on LV will be erased).
STOP. READ THIS. BESTIE, PLEASE. โ<red>existing data on LV will be erased</red>.LV.<red>ERASED.</red>like gone gone. ๐ญ
lvconvert --type thin-pool LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -I|--stripesize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --compression y|n ]
[ --deduplication y|n ]
[ --discards passdown|nopassdown|ignore ]
[ --errorwhenfull y|n ]
[ --metadataprofile String ]
[ --pooldatavdo y|n ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ --stripes Number ]
[ --vdosettings String ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped cache raid vdo writecache zero error
โ ๏ธ Convert LV to type cache-pool (existing data on LV will be erased).
again:<red>existing data on LV will be erased</red>. no take-backs. ๐
lvconvert --type cache-pool LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --metadataprofile String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped raid zero error
โ ๏ธ Convert LV to type vdopool (existing data on LV will be erased).
one more time for the people in the back:<red>existing data on LV will be erased</red>. ๐ซ
lvconvert --type vdo-pool LV1
[ -n|--name String ]
[ -r|--readahead auto|none|Number ]
[ -V|--virtualsize Size[m|UNIT] ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --compression y|n ]
[ --deduplication y|n ]
[ --metadataprofile String ]
[ --vdosettings String ]
[ COMMON_OPTIONS ]
LV1 types: linear striped cache raid
๐ช Detach a cache from an LV
breaking up with the cache. it's not you, it's the architecture.
lvconvert --splitcache LV1
[ --cachesettings String ]
[ COMMON_OPTIONS ]
LV1 types: cache cachepool thinpool vdopool writecache
๐ซ Merge thin LV into its origin LV
thin LV goes home to its origin. ๐ฅน
lvconvert --mergethin LV1 ...
[ COMMON_OPTIONS ]
LV1 types: thin
๐ซ Merge COW snapshot LV into its origin
the classic snapshot merge.
lvconvert --mergesnapshot LV1 ...
[ -i|--interval [+]Number ]
[ COMMON_OPTIONS ]
LV1 types: snapshot
๐ Combine a former COW snapshot (second arg) with a former origin LV (first arg) to reverse a splitsnapshot command.
okay this one is literally an undo button: <hotpink>a former COW snapshot (second arg)</hotpink> plus <hotpink>a former origin LV (first arg)</hotpink> = a reversed splitsnapshot. order matters, don't mix them up. ๐
lvconvert --type snapshot LV LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -s|--snapshot ]
[ -Z|--zero y|n ]
[ COMMON_OPTIONS ]
LV1 types: linear striped
๐ ๏ธ Replace failed PVs in a raid or mirror LV. Repair a thin pool. Repair a cache pool.
the fix-it-yourself section. three jobs in one:
<mint>replace failed PVs</mint>in a raid or mirror LV<mint>repair a thin pool</mint><mint>repair a cache pool</mint>
lvconvert --repair LV1
[ -i|--interval [+]Number ]
[ -k|--setactivationskip y|n ]
[ --poolmetadataspare y|n ]
[ --usepolicies ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: cache cachepool mirror raid thinpool
๐ Replace specific PV(s) in a raid LV with another PV
swapping out a specific PV for a different one, raid only.
lvconvert --replace PV LV1
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: raid
โณ Poll LV to continue conversion
for when you need to poke it and be like "finish the conversion please".
lvconvert --startpoll LV1
[ COMMON_OPTIONS ]
LV1 types: mirror raid
๐งฎ Add or remove data integrity checksums to raid images
checksums on or checksums off, your call.
lvconvert --raidintegrity y|n LV1
[ --integritysettings String ]
[ --raidintegrityblocksize Number ]
[ --raidintegritymode String ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: raid
๐งฐ Common options for command:
the shared little extras that go with the commands above:
-b,--background-f,--forceโฆ (the...means it's repeatable, bestie)--alloccontiguous|cling|cling_by_tags|normal|anywhere|inherit--noudevsync
๐งฐ Common options for lvm:
and these are the ones that belong to lvm as a whole (iykyk):
-d,--debugโฆ-h,--help-q,--quietโฆ-t,--test-v,--verboseโฆ-y,--yes--commandprofile String--config String--devices PV--devicesfile String--driverloaded y|n--journal String--lockopt String--longhelp--nohints--nolocking--profile String--version
more coming, don't go anywhere ๐
โจ OPTIONS โจ
Okay bestie, this is the big one โ every flag, every arg, every little default. Buckle up, no skipping. ๐
--alloc contiguous|cling|cling_by_tags|normal|anywhere|inheritโ okay so when a command needs to allocate Physical Extents (PEs) from the VG, this determines the allocation policy. Every VG and LV has an allocation policy which can be changed withvgchange/lvchange, or overridden on the command line.normalapplies common sense rules such as not placing parallel stripes on the same PV.inheritapplies the VG policy to an LV.contiguousrequires new PEs to be placed adjacent to existing PEs.clingplaces new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, butnormaldoes not use them,anywherewill use them even if it reduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. Seelvm(8)for more information about allocation. ๐-b,--backgroundโ If the operation requires polling, this option causes the command to return before the operation is complete, and polling is done in the background. go do your thing, bestie, it'll keep working. โจ-H,--cacheโ Specifies the command is handling a cache LV or cache pool. See--type cacheand--type cache-pool. Seelvmcache(7)for more information about LVM caching. ๐--cachedevice PVโ The name of a device to use for a cache. ๐--cachemetadataformat auto|1|2โ Specifies the cache metadata format used by cache target. no notes, just vibes. โจ--cachemode writethrough|writeback|passthroughโ Specifies when writes to a cache LV should be considered complete.writebackconsiders a write complete as soon as it is stored in the cache pool.writethroughconsiders a write complete only when it has been stored in both the cache pool and on the origin LV. Whilewritethroughmay be slower for writes, it is more resilient if something should happen to a device associated with the cache pool LV. Withpassthrough, all reads are served from the origin LV (all reads miss the cache) and all writes are forwarded to the origin LV; additionally, write hits cause cache block invalidates. Seelvmcache(7)for more information. ๐ฆ--cachepolicy Stringโ Specifies the cache policy for a cache LV. Seelvmcache(7)for more information. ๐--cachepool LVโ The name of a cache pool. simple. iconic. ๐--cachesettings Stringโ Specifies tunable kernel options fordm-cacheordm-writecacheLVs. Use the form'option=value'or'option1=value option2=value', or repeat--cachesettingsfor each option being set. These settings override the default kernel behaviors which are usually adequate. To remove cachesettings and revert to the default kernel behaviors, use--cachesettings 'default'for dm-cache or an empty string--cachesettings ''for dm-writecache. Seelvmcache(7)for more information. ๐ญ--cachesize Size[m|UNIT]โ The size of cache to use. ๐--cachevol LVโ The name of a cache volume. โจ-c,--chunksize Size[k|UNIT]โ The size of chunks in a snapshot, cache pool or thin pool. For snapshots, the value must be a power of 2 between4 KiBand512 KiBand the default value is4. For a cache pool the value must be between32 KiBand1 GiBand the default value is64. For a thin pool the value must be between64 KiBand1 GiBand the default value starts with64and scales up to fit the pool metadata size within128 MiB, if the pool metadata size is not specified. The value must be a multiple of64 KiB. Seelvmthin(7)andlvmcache(7)for more information. ๐--commandprofile Stringโ The command profile to use for command configuration. Seelvm.conf(5)for more information about profiles. ๐--compression y|nโ Controls whether compression is enabled or disabled for VDO volume. Seelvmvdo(7)for more information about VDO usage. โจ--config Stringโ Config settings for the command. These overridelvm.conf(5)settings. TheStringarg uses the same format aslvm.conf(5), or may use section/field syntax. Seelvm.conf(5)for more information about config. ๐-d,--debug ...โ Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). not me spamming-dfor the drama. ๐ญ--deduplication y|nโ Controls whether deduplication is enabled or disabled for VDO volume. Seelvmvdo(7)for more information about VDO usage. ๐ฆ--devices PVโ Restricts the devices that are visible and accessible to the command. Devices not listed will appear to be missing. This option can be repeated, or accepts a comma-separated list of devices. This overrides the devices file. ๐--devicesfile Stringโ A file listing devices that LVM should use. The file must exist in/etc/lvm/devices/and is managed with thelvmdevices(8)command. This overrides thelvm.conf(5)devices/devicesfileanddevices/use_devicesfilesettings. ๐--discards passdown|nopassdown|ignoreโ Specifies how the device-mapper thin pool layer in the kernel should handle discards.ignorecauses the thin pool to ignore discards.nopassdowncauses the thin pool to process discards itself to allow reuse of unneeded extents in the thin pool.passdowncauses the thin pool to process discards itself (likenopassdown) and pass the discards to the underlying device. Seelvmthin(7)for more information. ๐ธ--driverloaded y|nโ If set to no, the command will not attempt to use device-mapper. For testing and debugging. ๐ง--errorwhenfull y|nโ Specifies thin pool behavior when data space is exhausted. When yes, device-mapper will immediately return an error when a thin pool is full and an I/O request requires space. When no, device-mapper will queue these I/O requests for a period of time to allow the thin pool to be extended. Errors are returned if no space is available after the timeout. (Also see "dm_thin_pool" kernel module optionno_space_timeout.) Seelvmthin(7)for more information. ๐ฅ-f,--force ...โ Override various checks, confirmations and protections. Use with extreme caution. ๐-h,--helpโ Display help text. ๐--integritysettings Stringโ Specifies tunable kernel options fordm-integrity. Seelvmraid(7)for more information. โจ-i,--interval [+]Numberโ Report progress at regular intervals. With a+prefix, the first check is delayed by the given number of seconds, allowing background operations to start before polling begins. ๐--journal Stringโ Record information in the systemd journal. This information is in addition to information enabled by thelvm.conflog/journalsetting.command: record information about the command.output: record the default command output.debug: record full command debugging. ๐--lockopt Stringโ Used to pass options for special cases tolvmlockd. Seelvmlockd(8)for more information. ๐--longhelpโ Display long help text. ๐--mergeโ An alias for--mergethin,--mergemirrors, or--mergesnapshot, depending on the type of LV. shape-shifter energy. โจ--mergemirrorsโ Merge LV images that were split from a raid1 LV. See--splitmirrorswith--trackchanges. ๐--mergesnapshotโ Merge COW snapshot LV into its origin. When merging a snapshot, if both the origin and snapshot LVs are not open, the merge will start immediately. Otherwise, the merge will start the first time either the origin or snapshot LV are activated and both are closed. Merging a snapshot into an origin that cannot be closed, for example a root filesystem, is deferred until the next time the origin volume is activated. When merging starts, the resulting LV will have the origin's name, minor number and UUID. While the merge is in progress, reads or writes to the origin appear as being directed to the snapshot being merged. When the merge finishes, the merged snapshot is removed. Multiple snapshots may be specified on the command line or a@tagmay be used to specify multiple snapshots be merged to their respective origin. ๐ญ--mergethinโ Merge thin LV into its origin LV. The origin thin LV takes the content of the thin snapshot, and the thin snapshot LV is removed. Seelvmthin(7)for more information. ๐ฆ--metadataprofile Stringโ The metadata profile to use for command configuration. Seelvm.conf(5)for more information about profiles. ๐--mirrorlog core|diskโ Specifies the type of mirror log for LVs with the"mirror"type (does not apply to the"raid1"type.)diskis a persistent log and requires a small amount of storage space, usually on a separate device from the data being mirrored.coreis not persistent; the log is kept only in memory. In this case, the mirror must be synchronized (by copying LV data from the first device to others) each time the LV is activated, e.g. after reboot.mirroredis a persistent log that is itself mirrored, but should be avoided. Instead, use the raid1 type for log redundancy. ๐-m,--mirrors [+|-]Numberโ Specifies the number of mirror images in addition to the original LV image, e.g.--mirrors 1means there are two images of the data, the original and one mirror image. Optional positional PV args on the command line can specify the devices the images should be placed on. There are two mirroring implementations:"raid1"and"mirror". These are the names of the corresponding LV types, or"segment types". Use the--typeoption to specify which to use (raid1is default, andmirroris legacy). Uselvm.conf(5)global/mirror_segtype_defaultandglobal/raid10_segtype_defaultto configure the default types. The plus prefix+can be used, in which case the number is added to the current number of images, or the minus prefix-can be used, in which case the number is subtracted from the current number of images. Seelvmraid(7)for more information. ๐-n|--name Stringโ names your brand new LV. Don't feel like naming it? LVM will just hand you a defaultlvol#, where that#is literally a number LVM makes up for you. no thoughts, head empty, name given ๐--nohintsโ tells it to NOT use the hints file to find devices for PVs. Heads up: a command might read way more devices tryna find your PVs when hints aren't in play. It's still gonna do the standard hint file invalidation where it's appropriate, so don't worry about that part.--nolockingโ disables locking, periodt.
โ ๏ธ bestie, use this with caution: concurrent commands can produce incorrect results. this is a read-the-room moment.
--noudevsyncโ disables udev synchronization. The process will NOT wait for a notification from udev, it just keeps going regardless of whatever udev might be doing in the background. Only reach for this if udev isn't running, or it has rules that ignore the devices LVM creates.--originname LVโ picks the name for the external origin LV when you're converting an LV into a thin LV. The LV being converted becomes a read-only external origin with this name. glow up with a new identity โจ--pooldatavdo y|nโ use a VDO type volume for the pool data volume.--poolmetadata LVโ the name of an LV you wanna use for storing pool metadata.--poolmetadatasize Size[m|UNIT]โ sets the size of the new pool metadata LV.--poolmetadataspare y|nโ turn the automatic creation and management of a spare pool metadata LV in the VG on or off. That spare metadata LV is reserved space you can use when repairing a pool. it's the emergency stash ๐ซถ--profile Stringโ an alias for--commandprofileor--metadataprofile, depending on the command. it's giving "whichever one fits, babe".-q|--quiet ...โ suppress output and log messages. It overrides--debugand--verbose. Repeat it once and it also suppresses any prompts with answer'no'. shhh, we're being mysterious ๐คซ--raidintegrity y|nโ enable or disable data integrity checksums for raid images.--raidintegrityblocksize Numberโ the block size to use for dm-integrity on raid images. The integrity block size should usually match the device logical block size, or the file system block size. It can be less than the file system block size, but not less than the device logical block size. Possible values:512,1024,2048,4096.--raidintegritymode Stringโ use a journal (the default) or a bitmap for keeping integrity checksums consistent if there's a crash. Bitmap areas get recalculated after a crash, so corruption in those areas would not be detected ๐. A journal doesn't have this problem. The journal mode doubles writes to storage, but it can improve performance for scattered writes packed into a single journal write. bitmap mode can, in theory, achieve full write throughput of the device, but it wouldn't get the potential scattered write optimization. it's a tradeoff, bestie, choose your fighter.-r|--readahead auto|none|Numberโ sets the read ahead sector count of an LV.autois the default, and it lets the kernel choose a suitable value automatically.noneis equivalent to zero.-R|--regionsize Size[m|UNIT]โ the size of each raid or mirror synchronization region.lvm.conf(5)activation/raid_region_sizecan be used to configure a default.--repairโ replaces failed PVs in a raid or mirror LV, or runs a repair utility on a thin pool. Seelvmraid(7)andlvmthin(7)for more info. it's the fix-it arc ๐ง--replace PVโ swaps a specific PV in a raid LV out for another PV. The new PV you wanna use can optionally be specified after the LV. You can replace multiple PVs by repeating this option. Seelvmraid(7)for more.-k|--setactivationskip y|nโ persistently sets (yes) or clears (no) the "activation skip" flag on an LV. An LV with this flag set is not activated unless the--ignoreactivationskipoption is used by the activation command. This flag is set by default on new thin snapshot LVs. The flag is not applied to deactivation. The current value of the flag is indicated in thelvslv_attrbits.-s|--snapshotโ combines a former COW snapshot LV with a former origin LV to reverse a previous--splitsnapshotcommand. undoing the split, iconic behavior ๐ซ--splitcacheโ separates a cache pool from a cache LV, and keeps the unused cache pool LV. Before the separation, the cache gets flushed. Also peep--uncache.--splitmirrors Numberโ splits the specified number of images off a raid1 or mirror LV and uses them to make a new LV. If--trackchangesis also specified, changes to the raid1 LV are tracked while the split LV stays detached. If--nameis specified, then the images are permanently split from the original LV and changes are not tracked. choose your destiny ๐ฆ--splitsnapshotโ separates a COW snapshot from its origin LV. The LV that gets split off contains the chunks that differ from the origin LV, along with metadata describing them. This LV can be wiped and then destroyed withlvremove.--startpollโ starts polling an LV so it can continue processing a conversion. keep the momentum going ๐ฅ--stripes Numberโ the number of stripes in a striped LV. This is the number of PVs (devices) that a striped LV is spread across. Data that appears sequential in the LV gets spread across multiple devices in units of the stripe size (see--stripesize). This does not apply to existing allocated space โ only newly allocated space can be striped.-I|--stripesize Size[k|UNIT]โ how much data gets written to one device before moving on to the next in a striped LV.--swapmetadataโ extracts the metadata LV from a pool and replaces it with another specified LV. The extracted LV is preserved and given the name of the LV that replaced it. Use for repair only. Once the metadata LV is swapped out of the pool, it can be activated directly and used with thin provisioning tools:cache_dump(8),cache_repair(8),cache_restore(8),thin_dump(8),thin_repair(8),thin_restore(8).-t|--testโ run in test mode. Commands will not update metadata. It's implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. gaslight gatekeep girlboss ๐-T|--thinโ says the command is handling a thin LV or thin pool. See--type thin,--type thin-pool, and--virtualsize. Seelvmthin(7)for more about LVM thin provisioning.--thinpool LVโ the name of a thin pool LV.--trackchangesโ can be used with--splitmirrorson a raid1 LV. This causes changes to the original raid1 LV to be tracked while the split images remain detached. It's a temporary state that lets the read-only detached image be merged efficiently back into the raid1 LV later. Only the regions with changed data get resynchronized during the merge. While a raid1 LV is tracking changes, operations on it are limited to merging the split image (see--mergemirrors) or permanently splitting the image (see--splitmirrorswith--name).--type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|cache|cache-pool|writecacheโ the LV type, also known as "segment type" or "segtype". See the usage descriptions for the specific ways to use these types. For more info about redundancy and performance (raid<N>,mirror,striped,linear) seelvmraid(7). For thin provisioning (thin,thin-pool) seelvmthin(7). For performance caching (cache,cache-pool) seelvmcache(7). For copy-on-write snapshots (snapshot) see the usage definitions. For VDO (vdo) seelvmvdo(7). Several commands omit an explicit type option because the type gets inferred from other options or shortcuts (e.g.--stripes,--mirrors,--snapshot,--virtualsize,--thin,--cache,--vdo).
โ ๏ธ Use inferred types with care, because it can lead to unexpected results. no cap, don't let the vibes decide your segtype.
--uncacheโ separates a cache pool from a cache LV, and deletes the unused cache pool LV. Before the separation, the cache gets flushed. Also see--splitcache.--usepoliciesโ perform an operation according to the policy configured inlvm.conf(5)or a profile.--vdopool LVโ the name of a VDO pool LV. Seelvmvdo(7)for more about VDO usage.--vdosettings Stringโ specifies tunable VDO options for VDO LVs. Use the form'option=value'or'option1=value option2=value', or repeat--vdosettingsfor each option being set. These settings override the default VDO behaviors. To remove vdosettings and revert to the default VDO behaviors, use--vdosettings 'default'. Seelvmvdo(7)for more.-v|--verbose ...โ sets the verbose level. Repeat from 1 to 4 times to crank up the detail of messages sent to stdout and stderr. it's giving narrator mode ๐--versionโ display version information.-V|--virtualsize Size[m|UNIT]โ the virtual size of a new thin LV. Seelvmthin(7)for more about LVM thin provisioning. Using virtual size (-V) and actual size (-L) together creates a sparse LV.lvm.conf(5)global/sparse_segtype_defaultdetermines the default segment type used to create a sparse LV. Anything written to a sparse LV will be returned when reading from it. Reading from other areas of the LV will return blocks of zeros. When using a snapshot to create a sparse LV, a hidden virtual device is created using the zero target, and the LV has the suffix_vorigin. Snapshots are less efficient than thin provisioning when creating large sparse LVs (GiB).-W|--wipesignatures y|nโ this is the babysitter for signatures on brand-new LVs, bestie. It handles detecting them and wiping them. Every time one gets spotted, you get a little prompt asking you to confirm the wipe (unless you passed--yes, which just bulldozes past every confirmation ๐). If you don't say anything at all, the default is: signatures get wiped whenever zeroing happens (peep--zerofor that). You can also set this behaviour permanently inlvm.conf(5)atallocation/wipe_signatures_when_zeroing_new_lvs. Now, IF blkid wiping is what's being used (that'slvm.conf(5)allocation/use_blkid_wiping) AND your LVM was compiled with blkid wiping support, then it's theblkid(8)library doing the detecting โ runblkid -kto see the list of signatures it actually recognizes. Otherwise, native LVM code does the detecting, and in that case only MD RAID, swap and LUKS signatures get detected. Oh and heads up: if the read only flag is set, the LV does not get wiped. Nope. Not happening. ๐-y|--yesโ no interactive prompt, no waiting around, it just always assumes the answer is yes. Use with extreme caution. Like, EXTREME extreme. ๐ญ (If you want an automatic no instead, go look at-qq.)-Z|--zero y|nโ for snapshots, this is what controls zeroing of the first4 KiBof data in the snapshot. If the LV is read-only, the snapshot will not be zeroed, periodt. For thin pools, this controls zeroing of provisioned blocks. Real talk though: provisioning large zeroed chunks negatively impacts performance. It's giving โจexpensiveโจ.
๐ธ VARIABLES ๐ธ
- VG โ Volume Group name. Valid names live in
lvm(8). - LV โ Logical Volume name. Valid names are also in
lvm(8). An LV positional arg generally has the VG name and the LV name in it, likeVG/LV. When you see LV1, that means the LV has to be a specific type, and the accepted LV types get listed right there. (raidstands in forraid<N>type.) - PV โ Physical Volume name, aka a device path under
/dev. For the commands that manage physical extents, a PV positional arg generally accepts a suffix showing a range (or several ranges) of physical extents (PEs). Leave off the first PE and it defaults to the start of the device; leave off the last PE and it defaults to the end. The forms:
Start and end range (inclusive): PV[:PE-PE] ...
Start and length range (counting from 0): PV[:PE+PE] ...
- Tag โ Tag name.
lvm(8)has the whole story on tag names and on using tags in place of a VG, LV or PV. ๐ - String โ just look at that option's description to find out what kind of string it wants.
- Size[UNIT] โ Size is an input number that can have an optional unit hanging off it. Input units are always treated as base two values no matter how you capitalize them, so
kandKboth mean1024. The default input unit is specified by letter, followed by|UNIT. AndUNITis where the other possible input units live:b|Bis bytes,s|Sis sectors of512bytes,k|Kis KiB,m|Mis MiB,g|Gis GiB,t|Tis TiB,p|Pis PiB,e|Eis EiB. (Do not mix this up with the output control--units, where capital letters mean multiples of 1000. Different vibe entirely, iykyk.)
๐ ENVIRONMENT VARIABLES ๐
lvm(8) has the tea on the environment variables lvm uses. For example, LVM_VG_NAME can generally be swapped in for a required VG parameter. Handy. ๐
๐ ADVANCED USAGE ๐
Alternate command forms, advanced command usage, and a listing of all valid syntax, because completeness is the moment.
Change the region size of an LV.
lvconvert -R|--regionsize Size[m|UNIT] LV1
[ COMMON_OPTIONS ]
LV1 types: raid
Change the type of mirror log used by a mirror LV.
lvconvert --mirrorlog core|disk LV1
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: mirror
Convert LV to a thin LV, using the original LV as an external origin.
lvconvert --thinpool LV -T|--thin LV1
[ --type thin ] (implied)
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --metadataprofile String ]
[ --originname LV ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped cache raid thin zero error
Convert LV to a thin LV, using LV as thin-pool data volume.
lvconvert -T|--thin LV1
[ --type thin ] (implied)
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --metadataprofile String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped cache raid vdo writecache zero error
Attach a cache pool to an LV.
lvconvert --cachepool LV -H|--cache LV1
[ --type cache ] (implied)
[ -c|--chunksize Size[k|UNIT] ]
[ -r|--readahead auto|none|Number ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --metadataprofile String ]
[ --poolmetadata LV ]
[ --poolmetadatasize Size[m|UNIT] ]
[ --poolmetadataspare y|n ]
[ COMMON_OPTIONS ]
[ PV ... ]
LV1 types: linear striped raid thin thinpool thinpooldata vdo vdopool vdopooldata zero error
Attach a cache to an LV, converting the LV to type cache.
lvconvert --cachevol LV -H|--cache LV1
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ --cachemetadataformat auto|1|2 ]
[ --cachemode writethrough|writeback|passthrough ]
[ --cachepolicy String ]
[ --cachesettings String ]
[ --poolmetadatasize Size[m|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: linear striped raid thinpool
Convert LV to type vdopool (variant: use --type vdo-pool, and jsyk the existing data on the LV will be erased ๐).
lvconvert --vdopool LV1
[ --type vdo-pool ] (implied)
[ -n|--name String ]
[ -r|--readahead auto|none|Number ]
[ -V|--virtualsize Size[m|UNIT] ]
[ -W|--wipesignatures y|n ]
[ -Z|--zero y|n ]
[ --compression y|n ]
[ --deduplication y|n ]
[ --metadataprofile String ]
[ --vdosettings String ]
[ COMMON_OPTIONS ]
LV1 types: linear striped cache raid
Detach and delete a cache from an LV.
lvconvert --uncache LV1
[ --cachesettings String ]
[ COMMON_OPTIONS ]
LV1 types: cache thinpool vdopool writecache
Swap metadata LV in a thin pool or cache pool (for repair only, bestie โ this is a surgery situation ๐ฅ).
lvconvert --poolmetadata LV --swapmetadata LV1
[ -c|--chunksize Size[k|UNIT] ]
[ COMMON_OPTIONS ]
LV1 types: cachepool thinpool
Merge LV that was split from a mirror (variant, use --mergemirrors). Merge thin LV into its origin LV (variant, use --mergethin). Merge COW snapshot LV into its origin (variant, use --mergesnapshot).
lvconvert --merge VG|LV1|Tag ...
[ -i|--interval [+]Number ]
[ COMMON_OPTIONS ]
LV1 types: linear striped snapshot raid thin
Separate a COW snapshot from its origin LV.
lvconvert --splitsnapshot LV1
[ COMMON_OPTIONS ]
LV1 types: snapshot
Combine a former COW snapshot (second arg) with a former origin LV (first arg) to reverse a splitsnapshot command.
lvconvert -s|--snapshot LV LV1
[ --type snapshot ] (implied)
[ -c|--chunksize Size[k|UNIT] ]
[ -Z|--zero y|n ]
[ COMMON_OPTIONS ]
LV1 types: linear striped
Poll LV to continue conversion (also peek at --startpoll) or wait until conversion/mirror syncing is finished.
lvconvert LV1
[ COMMON_OPTIONS ]
LV1 types: mirror raid
๐ NOTES ๐
Okay so this is the part where we talk about the old syntax being a littleโฆ ambiguous. ๐
This previous command syntax would perform two different operations:
lvconvert --thinpool LV1 --poolmetadata LV2
If LV1 was not a thin pool, the command would convert LV1 to a thin pool, optionally using a specified LV for metadata. But if LV1 was already a thin pool, the command would swap the current metadata LV with LV2 (for repair purposes). Same command, two completely different main character arcs. ๐ญ
And in the same way, this previous command syntax would perform two different operations:
lvconvert --cachepool LV1 --poolmetadata LV2
If LV1 was not a cache pool, the command would convert LV1 to a cache pool, optionally using a specified LV for metadata. But if LV1 was already a cache pool, the command would swap the current metadata LV with LV2 (for repair purposes). Not me having to check what type my LV already is before running anything ๐ซถ
๐ EXAMPLES ๐
Okay bestie, this is the part where it all clicks. Real commands, real vibes, go off ๐
Turn a linear LV into a two-way mirror LV.
lvconvert --type mirror --mirrors 1 vg/lvol1
Turn a linear LV into a two-way RAID1 LV.
lvconvert --type raid1 --mirrors 1 vg/lvol1
Make a mirror LV use an in-memory log.
lvconvert --mirrorlog core vg/lvol1
Make a mirror LV use a disk log.
lvconvert --mirrorlog disk vg/lvol1
Turn a mirror or raid1 LV back into a boring little linear LV.
lvconvert --type linear vg/lvol1
Turn a mirror LV into a raid1 LV, keeping the same number of images.
lvconvert --type raid1 vg/lvol1
Turn a linear LV into a two-way mirror LV, but pull the new extents from specific PV ranges.
lvconvert --mirrors 1 vg/lvol1 /dev/sda:0-15 /dev/sdb:0-15
Turn a mirror LV into a linear LV, freeing up physical extents from a specific PV.
lvconvert --type linear vg/lvol1 /dev/sda
Split one image off a mirror or raid1 LV and make it its own brand new LV.
lvconvert --splitmirrors 1 --name lv_split vg/lvol1
Split one image off a raid1 LV and keep tracking changes made to the raid1 LV while that split image is still detached.
lvconvert --splitmirrors 1 --trackchanges vg/lvol1
Mash an image back into the original raid1 LV (this is the image you made earlier with --splitmirrors and --trackchanges, bestie, the reunion arc ๐ซถ).
lvconvert --mergemirrors vg/lvol1_rimage_1
Swap PV /dev/sdb1 out for PV /dev/sdf1 inside a raid1/4/5/6/10 LV.
lvconvert --replace /dev/sdb1 vg/lvol1 /dev/sdf1
Swap 3 PVs /dev/sd[b-d]1 out for PVs /dev/sd[f-h]1 inside a raid1 LV.
lvconvert --replace /dev/sdb1 --replace /dev/sdc1 --replace /dev/sdd1 vg/lvol1 /dev/sd[fgh]1
Swap a maximum of 2 PVs /dev/sd[bc]1 out for PVs /dev/sd[gh]1 inside a raid6 LV.
lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lvol1 /dev/sd[gh]1
Turn a thick LV into a thin-pool data volume, keep using this LV through thinLV, and set the pool metadata size to 1GiB while you're at it.
lvconvert --type thin --poolmetadatasize 1G vg/lvol1
Turn an LV into a thin-pool with VDO deduplication and compression handling its data. fancy โจ
lvconvert --type thin-pool --pooldatavdo y vg/lvol1
Turn an LV into a thin LV inside the thin pool you name. The existing LV becomes an external read-only origin for the new thin LV.
lvconvert --type thin --thinpool vg/tpool1 vg/lvol1
Same as above but the existing LV becomes an external read-only origin AND gets renamed external.
lvconvert --type thin --thinpool vg/tpool1 --originname external vg/lvol1
Turn an LV into a cache pool LV, using another LV you specify for the cache pool metadata.
lvconvert --type cache-pool --poolmetadata vg/poolmeta1 vg/lvol1
Turn an LV into a cache LV using the cache pool and chunk size you specify.
lvconvert --type cache --cachepool vg/cpool1 -c 128 vg/lvol1
Detach the cache pool from a cache LV and KEEP it.
lvconvert --splitcache vg/lvol1
Detach the cache pool from a cache LV and DELETE it. bye girl ๐
lvconvert --uncache vg/lvol1
๐ SEE ALSO ๐
Squad. The whole friend group. Go read these next, no cap:
lvm(8),lvm.conf(5),lvmconfig(8),lvmdevices(8),pvchange(8),pvck(8),pvcreate(8),pvdisplay(8),pvmove(8),pvremove(8),pvresize(8),pvs(8),pvscan(8),vgcfgbackup(8),vgcfgrestore(8),vgchange(8),vgck(8),vgcreate(8),vgconvert(8),vgdisplay(8),vgexport(8),vgextend(8),vgimport(8),vgimportclone(8),vgimportdevices(8),vgmerge(8),vgmknodes(8),vgreduce(8),vgremove(8),vgrename(8),vgs(8),vgscan(8),vgsplit(8),lvcreate(8),lvchange(8),lvconvert(8),lvdisplay(8),lvextend(8),lvreduce(8),lvremove(8),lvrename(8),lvresize(8),lvs(8),lvscan(8),lvm-fullreport(8),lvm-lvpoll(8),blkdeactivate(8),lvmdump(8),dmeventd(8),lvmpolld(8),lvmlockd(8),lvmlockctl(8),lvmdbusd(8),fsadm(8),lvmsystemid(7),lvmreport(7),lvmcache(7),lvmraid(7),lvmthin(7),lvmvdo(7),lvmautoactivation(7)
That's the whole page, bestie. You made it to the end. Genuinely iconic behavior, no notes ๐
And that's a wrap! This page came to you from Red Hat, Inc. and it's LVM TOOLS 2.03.44(2), dated 2026-10-27, and it lives at the bottom of LVCONVERT(8) like a lil signature. Go convert something responsibly, mwah ๐๐ฆโจ
๐ฆ where this page comes from
- arch rolling: lvm2 2.03.44-1 ยท GPL-2.0-only AND LGPL-2.1-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms