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_ls with alias raid5)
  • right-asymmetric (raid5_ra)
  • right-symmetric (raid5_rs)
  • raid5_n, which doesn't rotate parity blocks.

Layouts of raid6 are:

  • zero-restart (raid6_zr with alias raid6)
  • 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 on raid โ€” that's what LV1 types: raid means. 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)
  • --alloc contiguous|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 with vgchange/lvchange, or overridden on the command line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs to be placed adjacent to existing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will 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. See lvm(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 cache and --type cache-pool. See lvmcache(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. writeback considers a write complete as soon as it is stored in the cache pool. writethrough considers a write complete only when it has been stored in both the cache pool and on the origin LV. While writethrough may be slower for writes, it is more resilient if something should happen to a device associated with the cache pool LV. With passthrough, 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. See lvmcache(7) for more information. ๐Ÿฆ‹
  • --cachepolicy String โ€” Specifies the cache policy for a cache LV. See lvmcache(7) for more information. ๐Ÿ’…
  • --cachepool LV โ€” The name of a cache pool. simple. iconic. ๐Ÿ‘‘
  • --cachesettings String โ€” Specifies tunable kernel options for dm-cache or dm-writecache LVs. Use the form 'option=value' or 'option1=value option2=value', or repeat --cachesettings for 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. See lvmcache(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 between 4 KiB and 512 KiB and the default value is 4. For a cache pool the value must be between 32 KiB and 1 GiB and the default value is 64. For a thin pool the value must be between 64 KiB and 1 GiB and the default value starts with 64 and scales up to fit the pool metadata size within 128 MiB, if the pool metadata size is not specified. The value must be a multiple of 64 KiB. See lvmthin(7) and lvmcache(7) for more information. ๐Ÿ’€
  • --commandprofile String โ€” The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. ๐ŸŽ€
  • --compression y|n โ€” Controls whether compression is enabled or disabled for VDO volume. See lvmvdo(7) for more information about VDO usage. โœจ
  • --config String โ€” Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.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 -d for the drama. ๐Ÿ˜ญ
  • --deduplication y|n โ€” Controls whether deduplication is enabled or disabled for VDO volume. See lvmvdo(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 the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. ๐Ÿ’–
  • --discards passdown|nopassdown|ignore โ€” Specifies how the device-mapper thin pool layer in the kernel should handle discards. ignore causes the thin pool to ignore discards. nopassdown causes the thin pool to process discards itself to allow reuse of unneeded extents in the thin pool. passdown causes the thin pool to process discards itself (like nopassdown) and pass the discards to the underlying device. See lvmthin(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 option no_space_timeout.) See lvmthin(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 for dm-integrity. See lvmraid(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 the lvm.conf log/journal setting. 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 to lvmlockd. See lvmlockd(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 --splitmirrors with --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 @tag may 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. See lvmthin(7) for more information. ๐Ÿฆ‹
  • --metadataprofile String โ€” The metadata profile to use for command configuration. See lvm.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.) disk is a persistent log and requires a small amount of storage space, usually on a separate device from the data being mirrored. core is 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. mirrored is 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 1 means 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 --type option to specify which to use (raid1 is default, and mirror is legacy). Use lvm.conf(5) global/mirror_segtype_default and global/raid10_segtype_default to 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. See lvmraid(7) for more information. ๐ŸŒˆ
  • -n|--name String โ€” names your brand new LV. Don't feel like naming it? LVM will just hand you a default lvol#, 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 --commandprofile or --metadataprofile, depending on the command. it's giving "whichever one fits, babe".
  • -q|--quiet ... โ€” suppress output and log messages. It overrides --debug and --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. auto is the default, and it lets the kernel choose a suitable value automatically. none is equivalent to zero.
  • -R|--regionsize Size[m|UNIT] โ€” the size of each raid or mirror synchronization region. lvm.conf(5) activation/raid_region_size can 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. See lvmraid(7) and lvmthin(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. See lvmraid(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 --ignoreactivationskip option 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 the lvs lv_attr bits.
  • -s|--snapshot โ€” combines a former COW snapshot LV with a former origin LV to reverse a previous --splitsnapshot command. 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 --trackchanges is also specified, changes to the raid1 LV are tracked while the split LV stays detached. If --name is 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 with lvremove.
  • --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. See lvmthin(7) for more about LVM thin provisioning.
  • --thinpool LV โ€” the name of a thin pool LV.
  • --trackchanges โ€” can be used with --splitmirrors on 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 --splitmirrors with --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) see lvmraid(7). For thin provisioning (thin, thin-pool) see lvmthin(7). For performance caching (cache, cache-pool) see lvmcache(7). For copy-on-write snapshots (snapshot) see the usage definitions. For VDO (vdo) see lvmvdo(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 in lvm.conf(5) or a profile.
  • --vdopool LV โ€” the name of a VDO pool LV. See lvmvdo(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 --vdosettings for each option being set. These settings override the default VDO behaviors. To remove vdosettings and revert to the default VDO behaviors, use --vdosettings 'default'. See lvmvdo(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. See lvmthin(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_default determines 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 --zero for that). You can also set this behaviour permanently in lvm.conf(5) at allocation/wipe_signatures_when_zeroing_new_lvs. Now, IF blkid wiping is what's being used (that's lvm.conf(5) allocation/use_blkid_wiping) AND your LVM was compiled with blkid wiping support, then it's the blkid(8) library doing the detecting โ€” run blkid -k to 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 first 4 KiB of 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, like VG/LV. When you see LV1, that means the LV has to be a specific type, and the accepted LV types get listed right there. (raid stands in for raid<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 k and K both mean 1024. The default input unit is specified by letter, followed by |UNIT. And UNIT is where the other possible input units live: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is 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:


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