LVCREATE(8)

๐Ÿ’– LVCREATE(8) โ€” System Manager's Manual ๐Ÿ’–

okay bestie, gather round, because we're about to create logical volumes and it is so much fun once you get it. this is lvcreate from the System Manager's Manual (section 8, iykwim), and she is a whole queen. let me walk you through it ๐Ÿซถ


โœจ NAME โœจ

lvcreate โ€” Create a logical volume ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

okay so the shape of the whole thing is like this, no cap:

lvcreate option_args position_args
       [ option_args ]
       [ position_args ]

and here is every single option she takes, yes all of them, don't skip ๐Ÿ’…:

-a|--activate y|n|ay
   --addtag Tag
   --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit
-A|--autobackup y|n
-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
-C|--contiguous y|n
-d|--debug ...
   --deduplication y|n
   --devices PV
   --devicesfile String
   --discards passdown|nopassdown|ignore
   --driverloaded y|n
   --errorwhenfull y|n
-l|--extents Number[PERCENT]
-h|--help
-K|--ignoreactivationskip
   --ignoremonitoring
   --integritysettings String
   --journal String
   --lockopt String
   --longhelp
-j|--major Number
   --[raid]maxrecoveryrate Size[k|UNIT]
   --metadataprofile String
   --minor Number
   --[raid]minrecoveryrate Size[k|UNIT]
   --mirrorlog core|disk
-m|--mirrors Number
   --monitor y|n
-n|--name String
   --nohints
   --nolocking
   --nosync
   --noudevsync
-p|--permission rw|r
-M|--persistent y|n
   --pooldatavdo y|n
   --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]
   --reportformat basic|json|json_std
-k|--setactivationskip y|n
   --setautoactivation y|n
-L|--size Size[m|UNIT]
-s|--snapshot
-i|--stripes Number
-I|--stripesize Size[k|UNIT]
-t|--test
-T|--thin
   --thinpool LV
   --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|
vdo-pool|cache|cache-pool|writecache
   --vdo
   --vdopool LV
   --vdosettings String
-v|--verbose ...
   --version
-V|--virtualsize Size[m|UNIT]
-W|--wipesignatures y|n
-y|--yes
-Z|--zero y|n

โœจ DESCRIPTION โœจ

so like, lvcreate creates a new LV in a VG. that's the whole gig bestie. for standard LVs, that means you have to allocate logical extents out of the VG's free physical extents. and if there's not enough free space? ๐Ÿ˜ญ the VG can be extended with other PVs (that's vgextend(8)'s job), or you can reduce / remove existing LVs instead (lvremove(8), lvreduce(8)) ๐Ÿซถ

wanna control which PVs your shiny new LV gets to use? easy. just drop one or more PVs as position args at the end of the command line, and lvcreate will allocate physical extents only from those specified PVs. picky queen behavior, we love it โœจ

and guess what โ€” lvcreate can also create snapshots of existing LVs, like fr fr, for backup purposes and stuff. the data in a new snapshot LV represents the content of the original LV from the time the snapshot was created. time capsule energy ๐ŸŽ€

RAID LVs? yeah she can do that, just specify an LV type when creating the LV (peep lvmraid(7)). heads up though: different RAID levels require different numbers of unique PVs to be available in the VG for allocation. so like, do your homework first ๐Ÿ“š

Thin pools (for thin provisioning) and cache pools (for caching) are represented by special LVs with types thin-pool and cache-pool (see lvmthin(7) and lvmcache(7)). important: these pool LVs are not usable as standard block devices, but the LV names act as references to the pools. so don't try to mount them, bestie ๐Ÿ’€

Thin LVs are thinly provisioned from a thin pool, and are created with a virtual size rather than a physical size. and a cache LV is the combination of a standard LV with a cache pool, used to cache active portions of the LV to improve performance. glow-up via caching ๐Ÿ”ฅ

VDO LVs are also thinly provisioned volumes from a VDO pool, and are created with a virtual size rather than a physical size (see lvmvdo(7)). yes another pool, yes another virtual size, she contains multitudes ๐ŸŒˆ


๐ŸŒธ Usage notes ๐ŸŒธ

  • in the usage section below, --size Size can be replaced with --extents Number. see the descriptions in the options section for the tea โ˜•
  • in the usage section below, --name is omitted from the required options, even though it is typically used. when the name is not specified, a new LV name is generated with the "lvol" prefix and a unique numeric suffix. she'll name herself, she's independent ๐Ÿ’…
  • in the usage section below, when creating a pool and the name is omitted, the new LV pool name is generated with the "vpool" prefix for vdo-pools and a unique numeric suffix ๐Ÿฆ‹
  • pool name can be specified together with the VG name, i.e.: vg00/mythinpool โ€” cute lil slash situation, obsessed ๐ŸŽ€

ok bestie that's the vibe so far โ€” but we are SO not done, there are more parts coming, don't go anywhere ๐Ÿ’–

๐ŸŽ€ USAGE ๐ŸŽ€

okay bestie, this is the whole menu of things lvcreate can build for you. pick your fighter ๐Ÿ’…

Create a linear LV.

lvcreate -L|--size Size[m|UNIT] VG
       [ --type linear ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a striped LV.

lvcreate -i|--stripes Number -L|--size Size[m|UNIT] VG
       [ --type striped ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a raid1 or mirror LV.

the implicit type here is decided by lvm.conf global/mirror_segtype_default, so like, it picks for you ๐Ÿซถ

lvcreate -L|--size Size[m|UNIT] -m|--mirrors Number VG
       [ --type raid1|mirror ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -R|--regionsize Size[m|UNIT] ]
       [ --integritysettings String ]
       [ --[raid]maxrecoveryrate Size[k|UNIT] ]
       [ --[raid]minrecoveryrate Size[k|UNIT] ]
       [ --mirrorlog core|disk ]
       [ --raidintegrity y|n ]
       [ --raidintegrityblocksize Number ]
       [ --raidintegritymode String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a raid LV.

heads up, you have to name a specific raid level here, like raid1 โ€” no vibes-based guessing allowed ๐Ÿ˜ค

lvcreate --type raid -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -m|--mirrors Number ]
       [ -R|--regionsize Size[m|UNIT] ]
       [ --integritysettings String ]
       [ --[raid]maxrecoveryrate Size[k|UNIT] ]
       [ --[raid]minrecoveryrate Size[k|UNIT] ]
       [ --raidintegrity y|n ]
       [ --raidintegrityblocksize Number ]
       [ --raidintegritymode String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a raid10 LV.

lvcreate -i|--stripes Number -L|--size Size[m|UNIT]
         -m|--mirrors Number VG
       [ --type raid10 ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -R|--regionsize Size[m|UNIT] ]
       [ --integritysettings String ]
       [ --[raid]maxrecoveryrate Size[k|UNIT] ]
       [ --[raid]minrecoveryrate Size[k|UNIT] ]
       [ --raidintegrity y|n ]
       [ --raidintegrityblocksize Number ]
       [ --raidintegritymode String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a COW snapshot LV of an origin LV.

lvcreate -L|--size Size[m|UNIT] -s|--snapshot LV
       [ --type snapshot ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a thin pool.

lvcreate --type thin-pool -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --thinpool LV ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a cache pool.

lvcreate --type cache-pool -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -H|--cache ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a thin LV in a thin pool.

lvcreate --thinpool LV1 -V|--virtualsize Size[m|UNIT] VG
       [ --type thin ] (implied)
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

       LV1 types: thinpool

Create a thin LV that is a snapshot of an existing thin LV.

lvcreate -s|--snapshot LV1
       [ --type thin ] (implied)
       [ COMMON_OPTIONS ]

       LV1 types: thin

Create a thin LV that is a snapshot of an external origin LV.

lvcreate --thinpool LV1 --type thin LV
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

       LV1 types: thinpool

Create a LV that returns VDO when used.

lvcreate --type vdo -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -V|--virtualsize Size[m|UNIT] ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --vdo ]
       [ --vdopool LV ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a new LV, then attach the specified cachepool which converts the new LV to type cache.

lvcreate --cachepool LV1 --type cache
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -H|--cache ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

       LV1 types: cachepool

Create a new LV, then attach the specified cachevol which converts the new LV to type cache.

lvcreate --cachevol LV --type cache
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a new LV, then attach a cachevol created from the specified cache device, which converts the new LV to type cache.

lvcreate --cachedevice PV --type cache
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --cachesize Size[m|UNIT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a new LV, then attach the specified cachevol which converts the new LV to type writecache.

lvcreate --cachevol LV --type writecache
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachesettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a new LV, then attach a cachevol created from the specified cache device, which converts the new LV to type writecache.

lvcreate --cachedevice PV --type writecache
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachesettings String ]
       [ --cachesize Size[m|UNIT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

๐Ÿ’ซ Common options for command:

these ones are the every-command classics, bestie ๐Ÿซถ

  • [ -a|--activate y|n|ay ]
  • [ -A|--autobackup y|n ]
  • [ -C|--contiguous y|n ]
  • [ -K|--ignoreactivationskip ]
  • [ -j|--major Number ]
  • [ -n|--name String ]
  • [ -p|--permission rw|r ]
  • [ -M|--persistent y|n ]
  • [ -r|--readahead auto|none|Number ]
  • [ -k|--setactivationskip y|n ]
  • [ -W|--wipesignatures y|n ]
  • [ -Z|--zero y|n ]
  • [ --addtag Tag ]
  • [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ]
  • [ --ignoremonitoring ]
  • [ --metadataprofile String ]
  • [ --minor Number ]
  • [ --monitor y|n ]
  • [ --nosync ]
  • [ --noudevsync ]
  • [ --reportformat basic|json|json_std ]
  • [ --setautoactivation y|n ]

๐Ÿ’ž Common options for lvm:

and these are the lvm-wide ones that show up everywhere, no cap โœจ

  • [ -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 ]

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

okay so this is the big one. the actual explanations. hydrate first bestie ๐Ÿ“

  • -a|--activate y|n|ay โ€” this one controls the active state of your brand new LV, like whether it's up and available or just chillin' unactivated. y makes the LV active (available, living its best life). New LVs are made active by default btw, that's just the norm ๐Ÿ’…. n makes the LV inactive (unavailable), but only when possible โ€” sometimes it just can't. and lowkey, in some cases creating an LV requires it to be active. for example, COW snapshots of an active origin LV can only be created in the active state (this does not apply to thin snapshots, so don't come for me). also the --zero option normally requires the LV to be active. if autoactivation ay is used, the LV is only activated if it matches an item in lvm.conf(5) activation/auto_activation_volume_list. heads up: ay implies --zero n and --wipesignatures n. and if you're doing shared VGs, go read lvmlockd(8) for more about activation options, iykyk ๐Ÿ”ฅ
  • --addtag Tag โ€” adds a tag to a PV, VG or LV. you can repeat this option to add multiple tags at once, so go off ๐ŸŒธ. want the tea on tags? see lvm(8).
  • --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit โ€” okay so this one decides the vibe of where your Physical Extents (PEs, bestie, the actual chunks) get pulled from when a command needs to allocate them out of the VG ๐Ÿ’– Every single VG and every single LV has its own allocation policy, and you can flip it around with vgchange/lvchange, or just override it right here on the command line whenever you feel like it. Let's break it down:
    • normal โ€” uses common sense rules, like "bestie please do not put parallel stripes on the same PV" ๐Ÿ™…โ€โ™€๏ธ
    • inherit โ€” applies the VG policy to an LV
    • contiguous โ€” demands that new PEs sit adjacent to the PEs that already exist
    • cling โ€” new PEs go on the same PV as the existing PEs in the same stripe of the LV
    • anywhere โ€” so if there ARE enough PEs for an allocation but normal is being picky and won't use them, anywhere will use them anyway, even if it tanks performance, like by placing two stripes on the same PV ๐Ÿ˜ญ

oh also! Optional positional PV args on the command line can limit which PVs the command is allowed to use for allocation. See lvm(8) for more info about allocation ๐Ÿ’…

  • -A|--autobackup y|n โ€” says whether metadata should get backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for the deets โœจ
  • -H|--cache โ€” tells the command we're dealing with a cache LV or cache pool. See --type cache and --type cache-pool. See lvmcache(7) for everything 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 the cache target.
  • --cachemode writethrough|writeback|passthrough โ€” specifies when writes to a cache LV should count as complete. Let's go:
    • writeback โ€” a write is done as soon as it's stored in the cache pool
    • writethrough โ€” a write is done only when it's stored in BOTH the cache pool and on the origin LV. Yeah it may be slower for writes, but it's way more resilient if something happens to a device associated with the cache pool LV ๐Ÿ’ช
    • passthrough โ€” all reads get served from the origin LV (so all reads miss the cache) and all writes get forwarded to the origin LV; plus, write hits cause cache block invalidates

See lvmcache(7) for more ๐ŸŒธ

  • --cachepolicy String โ€” specifies the cache policy for a cache LV. See lvmcache(7) for more.
  • --cachepool LV โ€” the name of a cache pool.
  • --cachesettings String โ€” specifies tunable kernel options for dm-cache or dm-writecache LVs. Use the form 'option=value' or 'option1=value option2=value', or just repeat --cachesettings for each option you're setting. These override the default kernel behaviors, which are usually perfectly adequate ngl. 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 ๐Ÿฆ‹
  • --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. And the rules differ per thing, so listen up:
    • snapshots: the value must be a power of 2 between 4 KiB and 512 KiB, and the default is 4
    • cache pool: the value must be between 32 KiB and 1 GiB, and the default is 64
    • thin pool: the value must be between 64 KiB and 1 GiB, and the default starts at 64 and scales up to fit the pool metadata size within 128 MiB โ€” but only if the pool metadata size was not specified
    • either way the value must be a multiple of 64 KiB

See lvmthin(7) and lvmcache(7) for more ๐Ÿ’œ

  • --commandprofile String โ€” the command profile to use for command configuration. See lvm.conf(5) for more about profiles.
  • --compression y|n โ€” controls whether compression is enabled or disabled for a VDO volume. See lvmvdo(7) for more 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 it can use section/field syntax. See lvm.conf(5) for more about config โœจ
  • -C|--contiguous y|n โ€” sets or resets the contiguous allocation policy for LVs. Default is no contiguous allocation, based on a next free principle. And heads up: you can only flip a non-contiguous allocation policy to contiguous if all of the allocated physical extents in the LV are already contiguous ๐Ÿ‘‘
  • -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) ๐Ÿ”
  • --deduplication y|n โ€” controls whether deduplication is enabled or disabled for a VDO volume. See lvmvdo(7) for more 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 it 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 โ€” the thin pool just ignores discards
    • nopassdown โ€” the thin pool processes discards itself, so unneeded extents in the thin pool can be reused
    • passdown โ€” the thin pool processes discards itself (like nopassdown) and passes the discards down to the underlying device

See lvmthin(7) for more ๐ŸŒธ

  • --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 runs out. When yes, device-mapper will immediately return an error when a thin pool is full and an I/O request needs space. When no, device-mapper will queue those I/O requests for a while to give the thin pool a chance to be extended โ€” and errors get returned if no space is available after the timeout. (Also see the "dm_thin_pool" kernel module option no_space_timeout.) See lvmthin(7) for more ๐Ÿ’€
  • -l|--extents Number[PERCENT] โ€” specifies the size of the new LV in logical extents. The --size and --extents options are alternate methods of specifying size. Oh and the total number of physical extents used will be greater when redundant data is needed for RAID levels, jsyk. There's also an alternate syntax that lets the size be determined indirectly as a percentage of the size of a related VG, LV, or set of PVs:
    • %VG โ€” the total size of the VG
    • %FREE โ€” the remaining free space in the VG
    • %PVS โ€” the free space in the specified PVs
    • for a snapshot, the size can be expressed as a percentage of the total size of the origin LV with %ORIGIN (100%ORIGIN provides space for the whole origin)

When expressed as a percentage, the size defines an upper limit for the number of logical extents in the new LV. The precise number of logical extents in the new LV is not determined until the command has completed โ€” so don't come for me, it's just how it is bestie ๐Ÿ˜Œ

  • -h|--help โ€” display help text ๐Ÿซถ
  • -K|--ignoreactivationskip โ€” ignore the "activation skip" LV flag during activation, so LVs that have the flag set can still be activated โœจ
  • --ignoremonitoring โ€” do not interact with dmeventd unless --monitor is specified. And fr, do not use this if dmeventd is already monitoring a device โš ๏ธ
  • --integritysettings String โ€” specifies tunable kernel options for dm-integrity. See lvmraid(7) for more.
  • --journal String โ€” record information in the systemd journal. This information is in addition to the info 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.
  • --longhelp โ€” display long help text ๐Ÿ“œ
  • -j|--major Number โ€” sets the major number of an LV block device.
  • --[raid]maxrecoveryrate Size[k|UNIT] โ€” sets the maximum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more ๐Ÿ”ฅ
  • --metadataprofile String โ€” the metadata profile to use for command configuration. See lvm.conf(5) for more about profiles.
  • --minor Number โ€” sets the minor number of an LV block device.
  • --[raid]minrecoveryrate Size[k|UNIT] โ€” sets the minimum recovery rate for a RAID LV. The rate value is an amount of data per second for each device in the array. Setting the rate to 0 means it will be unbounded. See lvmraid(7) for more ๐Ÿ’…
  • --mirrorlog core|disk โ€” specifies the type of mirror log for LVs with the "mirror" type (does not apply to the "raid1" type, ok?). Let's go:
    • disk โ€” a persistent log, and it needs a small amount of storage space, usually on a separate device from the data being mirrored
    • core โ€” not persistent; the log lives only in memory. In this case the mirror must be synchronized (by copying LV data from the first device to the others) every single time the LV is activated, e.g. after a reboot ๐Ÿ˜ญ
    • mirrored โ€” a persistent log that is itself mirrored, but bestie, avoid this one. Instead, use the raid1 type for log redundancy ๐Ÿ’–
  • -m, --mirrors Number โ€” how many mirror images you want on top of the original LV image. So like, --mirrors 1 means there's two copies of the data total: the og plus one mirror ๐Ÿ’–. Optional positional PV args on the command line can say which devices the images should live on. There's two whole mirroring implementations, bestie: "raid1" and "mirror" (these are the LV type names, aka "segment types"). Use --type to pick which one โ€” raid1 is the default, mirror is legacy. Configure the defaults with lvm.conf(5) global/mirror_segtype_default and global/raid10_segtype_default. Want to skip that initial image synchronization? That's the --nosync option โœจ. More info in lvmraid(7).
  • --monitor y|n โ€” start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd watches kernel events for an LV and does automated maintenance on it when specific events happen. Go read dmeventd(8) for the deets ๐Ÿ‘‘
  • -n, --name String โ€” the name of your shiny new LV ๐ŸŽ€. If you don't say anything, it just generates a default name of "lvol#", where # is some number LVM comes up with.
  • --nohints โ€” don't use the hints file to find devices for PVs. Fair warning: without hints, a command might read more devices while hunting for PVs ๐Ÿ‘€. It still does the standard hint file invalidation where appropriate, so it's not fully feral.
  • --nolocking โ€” turns locking off entirely. Use with caution, bestie, because concurrent commands can produce incorrect results ๐Ÿ’€. Like, actually incorrect.
  • --nosync โ€” makes creating mirror, raid1, raid4, raid5 and raid10 skip the initial synchronization. For mirror, raid1 and raid10, anything written after will still be mirrored, but the original contents do NOT get copied. For raid4 and raid5, no parity blocks get written, though any data written afterwards will cause parity blocks to be stored. This is genuinely useful for skipping a potentially long and resource-intensive initial sync of an empty mirror/raid1/raid4/raid5 and raid10 LV ๐Ÿซถ. Heads up though: this option is not valid for raid6, because raid6 relies on proper parity (P and Q Syndromes) being created during initial synchronization to reconstruct proper user data in case of device failures. And raid0 and raid0_meta don't provide any data copies or parity support at all, so they just don't support initial synchronization. Periodt.
  • --noudevsync โ€” disables udev synchronization. The process won't wait for a notification from udev, it'll just keep going no matter what udev might be doing in the background ๐Ÿ™ˆ. Only use this if udev isn't running, or has rules that ignore the devices LVM creates.
  • -p, --permission rw|r โ€” set access permission to read only (r) or read and write (rw).
  • -M, --persistent y|n โ€” when yes, makes that specified minor number persistent โœจ.
  • --pooldatavdo y|n โ€” use a VDO type volume for the pool data volume.
  • --poolmetadatasize Size[m|UNIT] โ€” specifies the size of the new pool metadata LV.
  • --poolmetadataspare y|n โ€” enable or disable the automatic creation and management of a spare pool metadata LV in the VG. A spare metadata LV is reserved space that's there for you when repairing a pool ๐Ÿ’….
  • --profile String โ€” an alias for --commandprofile or --metadataprofile, depending on the command.
  • -q, --quiet ... โ€” suppress output and log messages. It overrides --debug and --verbose. Repeat it once and it also suppresses any prompts with answer 'no' ๐Ÿคซ.
  • --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 may be less than the file system block size, but never less than the device logical block size. Possible values: 512, 1024, 2048, 4096.
  • --raidintegritymode String โ€” use a journal (default) or bitmap for keeping integrity checksums consistent in case of a crash. The bitmap areas get recalculated after a crash, so corruption in those areas would not be detected ๐Ÿ˜ญ. A journal doesn't have this problem. Journal mode doubles writes to storage, but 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 wouldn't benefit from that potential scattered write optimization.
  • -r, --readahead auto|none|Number โ€” sets the read ahead sector count of an LV. auto is the default, which lets the kernel choose a suitable value automatically. none is equivalent to zero.
  • -R, --regionsize Size[m|UNIT] โ€” size of each raid or mirror synchronization region. lvm.conf(5) activation/raid_region_size can set a default.
  • --reportformat basic|json|json_std โ€” overrides the current output format for reports, which is normally defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there's more than one report per command, each report gets prefixed with the report name for identification. json produces report output in JSON format. json_std produces report output in JSON format that's more compliant with the JSON standard โœจ. See lvmreport(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 won't be 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 shows up in the lvs lv_attr bits.
  • --setautoactivation y|n โ€” set the autoactivation property on a VG or LV. Display the property with vgs or lvs "-o autoactivation". When autoactivation is disabled, the VG or LV won't be activated by a command doing autoactivation (vgchange, lvchange, or pvscan using -aay.) If autoactivation is disabled on a VG, no LVs will be autoactivated in that VG, and the LV autoactivation property has no effect. If autoactivation is enabled on a VG, you can still disable autoactivation for individual LVs ๐Ÿ‘‘
  • -L, --size Size[m|UNIT] โ€” specifies the size of the new LV. The --size and --extents options are alternate methods of specifying size. And ngl, the total number of physical extents used will be greater when redundant data is needed for RAID levels.
  • -s, --snapshot โ€” create a snapshot. Snapshots give you a "frozen image" of an origin LV ๐ŸŒธ. The snapshot LV can be used, like, for backups, while the origin LV keeps doing its thing. This option can create a COW (copy on write) snapshot, or a thin snapshot (in a thin pool.)

Thin snapshots are created when the origin is a thin LV and the size option is NOT specified. Thin snapshots share the same blocks in the thin pool, and do not allocate new space from the VG. They're created with the "activation skip" flag โ€” see --setactivationskip.

A thin snapshot of a non-thin "external origin" LV gets created when a thin pool is specified. Unprovisioned blocks in the thin snapshot LV are read from the external origin LV. The external origin LV must be read-only ๐Ÿ”ฅ.

See lvmthin(7) for more about LVM thin provisioning.

COW snapshots are created when a size is specified. The size is allocated from space in the VG, and is the amount of space that can be used for saving COW blocks as writes happen to the origin or snapshot. The size you pick should depend on the number of writes you expect; often 20% of the origin LV is enough. If COW space runs low, you can extend it with lvextend (shrinking is also allowed with lvreduce.) A small amount of the COW snapshot LV size is used to track COW block locations, so the full size is not available for COW data blocks. Use lvs to check how much space is used, and see --monitor to automatically extend the size so you don't run out ๐Ÿ˜ฑ.

  • -i, --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 looks sequential in the LV gets spread across multiple devices in units of the stripe size (see --stripesize). This doesn't change existing allocated space, only applies to space being allocated by the command. When creating a RAID 4/5/6 LV, this number does not include the extra devices required for parity. The largest number depends on the RAID type (raid0: 64, raid10: 32, raid4/5: 63, raid6: 62), and when unspecified, the default depends on the RAID type too (raid0: 2, raid10: 2, raid4/5: 3, raid6: 5.) To stripe a new raid LV across all PVs by default, see lvm.conf(5) allocation/raid_stripe_all_devices ๐Ÿ’…
  • -I, --stripesize Size[k|UNIT] โ€” the amount of data written to one device before moving on to the next in a striped LV.
  • -t, --test โ€” run in test mode. Commands will not update metadata ๐Ÿ™ˆ. This is implemented by disabling all metadata writing but still returning success to the calling function. So yeah, this may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but actually hasn't ๐Ÿ’€.
  • -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.
  • --type linear|striped|snapshot|raid|mirror|thin|thin-pool|vdo|vdo-pool|cache|cache-pool|writecache โ€” bestie this is THE LV type, aka the "segment type" or "segtype" ๐Ÿ’… and the ways you actually use each one are laid out in the usage descriptions. Want the tea on redundancy and performance (raid<N>, mirror, striped, linear)? That's over in lvmraid(7). Thin provisioning (thin, thin-pool) lives in lvmthin(7). Performance caching (cache, cache-pool) is in lvmcache(7). Copy-on-write snapshots (snapshot) are in the usage definitions. And VDO (vdo) is in lvmvdo(7). Now listen โ€” several commands just skip the explicit type option altogether because the type gets inferred from other options or shortcuts (like --stripes, --mirrors, --snapshot, --virtualsize, --thin, --cache, --vdo). Use inferred types with care, ok?? Because it can give you unexpected results ๐Ÿ˜ญ๐Ÿ™ˆ
  • --vdo โ€” says hey, this command is handling a VDO LV. Peep --type vdo. And lvmvdo(7) has all the VDO usage deets ๐Ÿ’œ
  • --vdopool LV โ€” the name of the VDO pool LV ๐Ÿซถ catch lvmvdo(7) for more VDO tea.
  • --vdosettings String โ€” the tunable VDO options for your VDO LVs โœจ form it like option=value or option1=value option2=value, or just repeat --vdosettings once per option you're setting. These settings override the default VDO behaviors. Wanna wipe your vdosettings and go back to those defaults? Use --vdosettings 'default'. More in lvmvdo(7) ๐Ÿ’–
  • -v, --verbose โ€” turns up the verbose level. Repeat it 1 to 4 times to crank the detail of messages going to stdout and stderr ๐Ÿ“ข every repeat = more detail.
  • --version โ€” shows you the version info, periodt ๐Ÿ‘‘
  • -V, --virtualsize Size[m|UNIT] โ€” the virtual size of a shiny new thin LV ๐ŸŒธ lvmthin(7) has the full thin-provisioning story. Heads up: using virtual size (-V) together with actual size (-L) creates a sparse LV. And lvm.conf(5) global/sparse_segtype_default decides which default segment type gets used to make that sparse LV. Anything you write to a sparse LV comes right back when you read it โ€” iconic ๐Ÿ’… everything else you read from the LV returns blocks of zeros. And when you use a snapshot to create a sparse LV, a hidden virtual device gets created using the zero target, and the LV has the suffix _vorigin. Just so you know, snapshots are less efficient than thin provisioning when you're making large sparse LVs (GiB) ๐Ÿ’€
  • -W, --wipesignatures y|n โ€” controls detection and then the actual wiping of signatures on new LVs ๐Ÿงฝ Every signature it detects comes with a prompt to confirm the wipe (unless you use --yes to override the confirmations, miss bossy). If you don't specify it, signatures get wiped whenever zeroing is done (see --zero) โ€” and you can configure that behavior with lvm.conf(5) allocation/wipe_signatures_when_zeroing_new_lvs. If blkid wiping is on (that's lvm.conf(5) allocation/use_blkid_wiping) and LVM is compiled with blkid wiping support, then the blkid(8) library does the detecting (run blkid -k to list the signatures it recognizes). Otherwise the native LVM code is used to detect signatures โ€” and heads up, in that case only MD RAID, swap and LUKS signatures get detected. Oh and the LV is not wiped if the read only flag is set ๐Ÿšซ
  • -y, --yes โ€” no interactive confirmation prompts, it just always assumes the answer is yes. Use with extreme caution โš ๏ธ for real, be careful with this one. (Want automatic no? See -qq.)
  • -Z, --zero y|n โ€” controls zeroing of the first 4 KiB of data in the new LV. Default is y. Snapshot COW volumes are always zeroed, no negotiating ๐Ÿ’… For thin pools, this controls zeroing of provisioned blocks. The LV is not zeroed if the read only flag is set. Warning: trying to mount an unzeroed LV can cause the system to hang ๐Ÿ˜ญ don't do it bestie.

โœจ VARIABLES โœจ

๐Ÿ’œ VG

Volume Group name ๐Ÿ’– peep lvm(8) for what counts as a valid name. And for lvcreate specifically, the required VG positional arg can be omitted when the VG name is tucked inside another option, e.g. --name VG/LV โœจ

๐Ÿ’œ LV

Logical Volume name ๐ŸŒธ lvm(8) has the valid names. An LV positional arg generally includes the VG name and the LV name, e.g. VG/LV. And LV1 means the LV has to be a specific type โ€” the accepted LV types are listed wherever you see it. (raid represents the raid<N> type.)

๐Ÿ’œ PV

Physical Volume name, a device path under /dev ๐Ÿซถ For commands that manage physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). If you leave off the first PE it defaults to the start of the device, and if you leave off the last PE it defaults to the end. So:

  • Start and end range (inclusive): PV[:PE-PE] ...
  • Start and length range (counting from 0): PV[:PE+PE] ...

๐Ÿ’œ String

See the option description for what the string should contain ๐Ÿ’…

๐Ÿ’œ Size[UNIT]

Size is an input number that accepts an optional unit. By the way, input units are always treated as base two values, no matter the capitalization โ€” so 'k' and 'K' both mean 1024, cute right? The default input unit is specified by letter, followed by |UNIT. And UNIT represents the other possible input units: 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 confuse this with the output control --units, where capital letters mean a multiple of 1000 โ€” totally different vibe, iykyk ๐Ÿ™ˆ


๐ŸŒˆ ENVIRONMENT VARIABLES ๐ŸŒˆ

Peep lvm(8) for the info on environment variables used by lvm โœจ For example, LVM_VG_NAME can generally be substituted for a required VG parameter, which is lowkey so convenient ๐Ÿ’–


๐Ÿ‘‘ ADVANCED USAGE ๐Ÿ‘‘

Alternate command forms, advanced command usage, and a listing of all valid syntax for completeness ๐Ÿ’… buckle up bestie.

Create an LV that returns errors when used.

lvcreate --type error -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ COMMON_OPTIONS ]

Create an LV that returns zeros when read.

lvcreate --type zero -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ COMMON_OPTIONS ]

Create a linear LV.

lvcreate --type linear -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a striped LV (also see lvcreate --stripes).

lvcreate --type striped -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a mirror LV (also see --type raid1).

lvcreate --type mirror -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -m|--mirrors Number ]
       [ -R|--regionsize Size[m|UNIT] ]
       [ --mirrorlog core|disk ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a COW snapshot LV of an origin LV (also see --snapshot).

lvcreate --type snapshot -L|--size Size[m|UNIT] LV
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -s|--snapshot ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a sparse COW snapshot LV of a virtual origin LV (also see --snapshot).

lvcreate --type snapshot -L|--size Size[m|UNIT]
         -V|--virtualsize Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -s|--snapshot ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a thin pool.

lvcreate -L|--size Size[m|UNIT] -T|--thin VG
       [ --type thin-pool ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a thin pool named in --thinpool.

lvcreate --thinpool LV_new -L|--size Size[m|UNIT] VG
       [ --type thin-pool ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a cache pool named by the --cachepool arg (variant, uses --cachepool in place of --name).

lvcreate --cachepool LV_new --type cache-pool
         -L|--size Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -H|--cache ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Create a thin LV in a thin pool.

lvcreate --thinpool LV1 --type thin
         -V|--virtualsize Size[m|UNIT] VG
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

       LV1 types: thinpool

Create a thin LV in a thin pool named in the first arg (variant, also see --thinpool for naming pool).

lvcreate --type thin -V|--virtualsize Size[m|UNIT] LV1
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

       LV1 types: thinpool

Create a thin LV in the thin pool named in the first arg (also see --thinpool for naming pool.)

lvcreate -V|--virtualsize Size[m|UNIT] LV1
       [ --type thin ] (implied)
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

       LV1 types: thinpool

Create a thin LV that is a snapshot of an existing thin LV.

lvcreate --type thin LV1
       [ -s|--snapshot ]
       [ -T|--thin ]
       [ COMMON_OPTIONS ]

LV1 types: thin


okay so bestie, we're deep in the example buffet now and it's still going, and honestly? iconic. ๐Ÿ’…

Make a thin LV that is a snapshot of an existing thin LV.

lvcreate -T|--thin LV1
       [ --type thin ] (implied)
       [ -s|--snapshot ]
       [ COMMON_OPTIONS ]

LV1 types: thin


Make a thin LV that is a snapshot of an external origin LV.

lvcreate --thinpool LV1 -s|--snapshot LV
       [ --type thin ] (implied)
       [ COMMON_OPTIONS ]

LV1 types: thinpool


Make a VDO LV that comes with its own VDO pool.

lvcreate --vdo -L|--size Size[m|UNIT] VG
       [ --type vdo ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -V|--virtualsize Size[m|UNIT] ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --vdopool LV ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Same energy, same VDO pool, but you're naming the pool yourself.

lvcreate --vdopool LV_new -L|--size Size[m|UNIT] VG
       [ --type vdo ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -V|--virtualsize Size[m|UNIT] ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Make a thin LV, and while we're at it, make the thin pool it lives in โ€” the pool gets its name from the --thinpool arg.

lvcreate --thinpool LV_new --type thin
        -L|--size Size[m|UNIT] -V|--virtualsize Size[m|UNIT] VG
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Same thing, but you let --type thin be implied instead of typing it out. we love a low-effort moment.

lvcreate --thinpool LV_new -L|--size Size[m|UNIT]
        -V|--virtualsize Size[m|UNIT] VG
       [ --type thin ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

Make a thin LV plus its very own thin pool โ€” where the new pool name comes from the first arg, or the pool name just gets generated for you when that first arg is a VG name.

lvcreate --type thin -L|--size Size[m|UNIT]
        -V|--virtualsize Size[m|UNIT] VG|LV_new
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

And the -T|--thin version of exactly that, with --type thin implied because we're chill like that.

lvcreate -L|--size Size[m|UNIT] -T|--thin
        -V|--virtualsize Size[m|UNIT] VG|LV_new
       [ --type thin ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

okay this next one is the spicy one ๐Ÿซถ โ€” it creates a thin LV, first creating a thin pool for it, and creates a sparse snapshot of a virtual origin LV. Which type you get โ€” thin or snapshot โ€” is chosen according to the config setting sparse_segtype_default. so like, the config is the one deciding your fate here, not you. iykyk.
lvcreate -L|--size Size[m|UNIT] -V|--virtualsize Size[m|UNIT] VG
       [ --type thin|snapshot ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ -s|--snapshot ]
       [ -T|--thin ]
       [ --compression y|n ]
       [ --deduplication y|n ]
       [ --discards passdown|nopassdown|ignore ]
       [ --errorwhenfull y|n ]
       [ --pooldatavdo y|n ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ --vdosettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

oooo now we're in cache territory โœจ๐ŸŒธ

Make a new LV, then attach the cachepool you specified โ€” which converts the new LV to type cache.

lvcreate --cachepool LV1 -L|--size Size[m|UNIT] VG
       [ --type cache ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -H|--cache ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

LV1 types: cachepool


Make a new LV, then attach the cachepool โ€” converts the new LV to type cache all over again. this is the variant where you also use --cachepool. ๐ŸŽ€

lvcreate --type cache -L|--size Size[m|UNIT] LV1
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -H|--cache ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

LV1 types: cachepool


okay this last one has two whole modes depending on what your LV arg actually is, so read carefully bestie ๐Ÿ‘‘

If the LV arg is a cachepool: then a new LV gets made and the cachepool arg gets attached to it. (this is the variant where you use --type cache and --cachepool.)

If the LV arg is not a cachepool: then a new cachepool gets made and gets attached to the LV arg. (this is the alternative โ€” use lvconvert.)

lvcreate -H|--cache -L|--size Size[m|UNIT] LV
       [ --type cache ] (implied)
       [ -l|--extents Number[PERCENT] ]
       [ -c|--chunksize Size[k|UNIT] ]
       [ -i|--stripes Number ]
       [ -I|--stripesize Size[k|UNIT] ]
       [ --cachemetadataformat auto|1|2 ]
       [ --cachemode writethrough|writeback|passthrough ]
       [ --cachepolicy String ]
       [ --cachesettings String ]
       [ --poolmetadatasize Size[m|UNIT] ]
       [ --poolmetadataspare y|n ]
       [ COMMON_OPTIONS ]
       [ PV ... ]

๐ŸŒธ EXAMPLES ๐ŸŒธ

okay bestie this is the part where it all comes together ๐Ÿ’– real commands, real vibes, copy-paste energy. every single one of these is verbatim, so don't get creative with them, okay? โœจ


make a striped LV, 3 stripes, stripe size 8 KiB, size 100 MiB. the LV name? lvcreate picks it for you, main character behavior honestly ๐Ÿ‘‘

lvcreate -i 3 -I 8 -L 100m vg00

make a raid1 LV with two images and a usable size of 500 MiB. this one needs two devices, one for each mirror image ๐Ÿชž and yes, RAID metadata (superblock and bitmap) also lives on those two devices, no cap.

lvcreate --type raid1 -m1 -L 500m -n mylv vg00

make a mirror LV with two images and a usable size of 500 MiB. this one takes three devices: two for the mirror images, one for a disk log ๐Ÿ“

lvcreate --type mirror -m1 -L 500m -n mylv vg00

make a mirror LV with 2 images and a usable size of 500 MiB, but only 2 devices this time because the log is in memory. lowkey efficient ๐Ÿ’…

lvcreate --type mirror -m1 --mirrorlog core -L 500m -n mylv vg00

make a copy-on-write snapshot of an LV ๐Ÿฆ‹

lvcreate --snapshot --size 100m --name mysnap vg00/mylv

make a copy-on-write snapshot with a size sufficient for overwriting 20% of the size of the original LV:

lvcreate -s -l 20%ORIGIN -n mysnap vg00/mylv

make a sparse LV with 1 TiB of virtual space, and actual space just under 100 MiB. it's giving illusion โœจ

lvcreate --snapshot --virtualsize 1t --size 100m --name mylv vg00

make a linear LV with a usable size of 64 MiB on specific physical extents:

lvcreate -L 64m -n mylv vg00 /dev/sda:0-7 /dev/sdb:0-7

make a RAID5 LV with a usable size of 5 GiB, 3 stripes, a stripe size of 64 KiB, using a total of 4 devices (including one for parity):

lvcreate --type raid5 -L 5G -i 3 -I 64 -n mylv vg00

make a RAID5 LV using all of the free space in the VG and spanning all the PVs in the VG ๐Ÿซถ

heads up bestie, this command will fail if there are more than 8 PVs in the VG ๐Ÿ˜ญ in that case -i 7 must be used to get to the current maximum of 8 devices including parity for RAID LVs.
lvcreate --config allocation/raid_stripe_all_devices=1 --type raid5 -l 100%FREE -n mylv vg00

make a RAID10 LV with a usable size of 5 GiB, using 2 stripes, each on a two-image mirror.

note that the -i and -m arguments behave differently: -i specifies the total number of stripes, but -m specifies the number of images in addition to the first image. okay? okay. ๐Ÿ’€
lvcreate --type raid10 -L 5G -i 2 -m 1 -n mylv vg00

make a 1 TiB thin LV named mythin, with 256 GiB thinpool tpool0 in vg00:

lvcreate -T -V 1T --size 256G --name mythin vg00/tpool0

make a 1 TiB thin LV, first creating a new thin pool for it, where the thin pool has 100 MiB of space, uses 2 stripes, has a 64 KiB stripe size, and 256 KiB chunk size:

lvcreate --type thin --name mylv --thinpool mypool -V 1t -L 100m -i 2 -I 64 -c 256 vg00

make a thin snapshot of a thin LV ๐ŸŒˆ

the size option must not be used, otherwise a copy-on-write snapshot would be created instead. don't do it bestie.
lvcreate --snapshot --name mysnap vg00/thinvol

make a thin snapshot of the read-only inactive LV named "origin", which becomes an external origin for the thin snapshot LV:

lvcreate --snapshot --name mysnap --thinpool mypool vg00/origin

make a cache pool from a fast physical device. the cache pool can then be used to cache an LV โšก

lvcreate --type cache-pool -L 1G -n my_cpool vg00 /dev/fast1

make a cache LV: first create a new origin LV on a slow physical device, then combine the new origin LV with an existing cache pool ๐Ÿขโžก๏ธ๐Ÿ‡

lvcreate --type cache --cachepool my_cpool -L 100G -n mylv vg00 /dev/slow1

make a VDO LV vdo0 with VDOPoolLV size of 10 GiB and name vpool1:

lvcreate --vdo --size 10G --name vdo0 vg00/vpool1

๐Ÿ”— SEE ALSO ๐Ÿ”—

the whole friend group, fr fr ๐Ÿ’œ go read these, they're iconic:


and that's the whole page bestie, you made it to the end ๐Ÿ˜ญ๐Ÿ’– this one is LVM TOOLS 2.03.44(2), dated 2026-10-27, and it's brought to you by Red Hat, Inc. โ€” go forth and create those logical volumes, you absolute icon ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from