$linuxjunkies
>

lvcreate(8)

Create a logical volume in an LVM volume group.

UbuntuDebianFedoraArch

Synopsis

lvcreate [OPTION]... VolumeGroup [PhysicalVolume...]

Description

lvcreate creates a new logical volume within a specified volume group. Logical volumes are block devices that can be formatted with filesystems and mounted like regular partitions, but offer the flexibility of LVM management including resizing, snapshots, and migration across physical volumes.

You must specify the volume group name and either the size (using -L) or the number of extents (using -l). By default, lvcreate uses the next available logical volume name unless you specify one with -n.

Common options

FlagWhat it does
-L, --size Size[b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E]Set the logical volume size in bytes or with unit suffix (e.g., -L 10G for 10 gigabytes)
-l, --extents Number[%FREE|%PVS|%VG|%ORIGIN]Set size in logical extents; use %FREE to allocate a percentage of free space in the VG
-n, --name LogicalVolumeNameSpecify the name of the logical volume; if omitted, lvcreate assigns a default name
-i, --stripes NumberSet the number of stripes for data allocation across multiple physical volumes
-I, --stripesize SizeSet stripe size in kilobytes (e.g., -I 64 for 64KB stripes)
-m, --mirrors NumberCreate a mirrored logical volume with the specified number of mirrors for redundancy
-s, --snapshotCreate a snapshot of an existing logical volume for point-in-time backup
-p, --permission [r|rw]Set read-only (r) or read-write (rw) permissions; default is rw
--type VolumeTypeSpecify volume type: linear (default), striped, mirror, raid1, raid5, raid6, or thin-pool
-V, --virtualsize SizeFor thin volumes, set the virtual size visible to the guest/container
--thinpool PoolLogicalVolumeProvision a thin logical volume from an existing thin pool
-y, --yesAssume yes to all prompts (useful for automation)

Examples

Create a 10GB logical volume named 'mylv' in volume group 'myvg'

lvcreate -L 10G -n mylv myvg

Create a logical volume using 50% of the free space available in 'myvg'

lvcreate -l 50%FREE -n data myvg

Create a 5GB striped volume across two physical volumes with 64KB stripe size

lvcreate -L 5G -i 2 -I 64 -n striped myvg /dev/sda1 /dev/sdb1

Create a 20GB mirrored logical volume with one mirror copy for redundancy

lvcreate -L 20G -m 1 -n mirrored myvg

Create a 2GB snapshot of the 'original' logical volume for backup purposes

lvcreate -s -L 2G -n backup_snap /dev/myvg/original

Create a 100GB thin pool for provisioning multiple thin logical volumes

lvcreate -T -L 100G -n pool myvg

Provision a thin logical volume with 50GB virtual size from the 'pool' thin pool

lvcreate -V 50G -T -n thin_vol myvg/pool

Related commands