lvcreate(8)
Create a logical volume in an LVM volume group.
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
| Flag | What 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 LogicalVolumeName | Specify the name of the logical volume; if omitted, lvcreate assigns a default name |
-i, --stripes Number | Set the number of stripes for data allocation across multiple physical volumes |
-I, --stripesize Size | Set stripe size in kilobytes (e.g., -I 64 for 64KB stripes) |
-m, --mirrors Number | Create a mirrored logical volume with the specified number of mirrors for redundancy |
-s, --snapshot | Create 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 VolumeType | Specify volume type: linear (default), striped, mirror, raid1, raid5, raid6, or thin-pool |
-V, --virtualsize Size | For thin volumes, set the virtual size visible to the guest/container |
--thinpool PoolLogicalVolume | Provision a thin logical volume from an existing thin pool |
-y, --yes | Assume yes to all prompts (useful for automation) |
Examples
Create a 10GB logical volume named 'mylv' in volume group 'myvg'
lvcreate -L 10G -n mylv myvgCreate a logical volume using 50% of the free space available in 'myvg'
lvcreate -l 50%FREE -n data myvgCreate 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/sdb1Create a 20GB mirrored logical volume with one mirror copy for redundancy
lvcreate -L 20G -m 1 -n mirrored myvgCreate a 2GB snapshot of the 'original' logical volume for backup purposes
lvcreate -s -L 2G -n backup_snap /dev/myvg/originalCreate a 100GB thin pool for provisioning multiple thin logical volumes
lvcreate -T -L 100G -n pool myvgProvision a thin logical volume with 50GB virtual size from the 'pool' thin pool
lvcreate -V 50G -T -n thin_vol myvg/pool