1LVCREATE(8)                 System Manager's Manual                LVCREATE(8)
2
3
4

NAME

6       lvcreate - create a logical volume in an existing volume group
7

SYNOPSIS

9       lvcreate  [--addtag  Tag]  [--alloc  AllocationPolicy] [-A/--autobackup
10       y/n] [-C/--contiguous y/n]  [-d/--debug]  [-h/-?/--help]  [-i/--stripes
11       Stripes  [-I/--stripesize StripeSize]] {-l/--extents LogicalExtentsNum‐
12       ber[%{VG|FREE}] |
13        -L/--size LogicalVolumeSize[kKmMgGtT]} [-M/--persistent y/n]  [--minor
14       minor]  [-m/--mirrors  Mirrors  [--nosync] [--corelog] [-R/--regionsize
15       MirrorLogRegionSize]]  [-n/--name  LogicalVolumeName]  [-p/--permission
16       r/rw]   [-r/--readahead  ReadAheadSectors]  [-t/--test]  [-v/--verbose]
17       [-Z/--zero y/n] VolumeGroupName [PhysicalVolumePath...]
18
19       lvcreate {-l/--extents LogicalExtentsNumber[%{VG|FREE}] |
20        -L/--size  LogicalVolumeSize[kKmMgGtT]}   [-c/--chunksize   ChunkSize]
21       -s/--snapshot  -n/--name  SnapshotLogicalVolumeName OriginalLogicalVol‐
22       umePath
23

DESCRIPTION

25       lvcreate creates a new logical volume in a volume group  (  see  vgcre‐
26       ate(8), vgchange(8) ) by allocating logical extents from the free phys‐
27       ical extent pool of that volume group.  If there are  not  enough  free
28       physical  extents  then  the  volume  group can be extended ( see vgex‐
29       tend(8) ) with other physical volumes or by reducing  existing  logical
30       volumes of this volume group in size ( see lvreduce(8) ).
31       The second form supports the creation of snapshot logical volumes which
32       keep the contents of the original logical volume for backup purposes.
33

OPTIONS

35       See lvm for common options.
36
37       -c, --chunksize ChunkSize
38              Power of 2 chunk size for the snapshot logical volume between 4k
39              and 512k.
40
41       -C, --contiguous y/n
42              Sets or resets the contiguous allocation policy for logical vol‐
43              umes. Default is no contiguous allocation based on a  next  free
44              principle.
45
46       -i, --stripes Stripes
47              Gives  the  number  of  stripes.  This is equal to the number of
48              physical volumes to scatter the logical volume.
49
50       -I, --stripesize StripeSize
51              Gives the  number  of  kilobytes  for  the  granularity  of  the
52              stripes.
53              StripeSize must be 2^n (n = 2 to 9) for metadata in LVM1 format.
54              For metadata in LVM2 format, the stripe size  may  be  a  larger
55              power of 2 but must not exceed the physical extent size.
56
57       -l, --extents LogicalExtentsNumber[%{VG|FREE}]
58              Gives the number of logical extents to allocate for the new log‐
59              ical volume.  This can also be expressed as a percentage of  the
60              total  space  in  the Volume Group with the suffix %VG or of the
61              remaining free space with the suffix %FREE.
62
63       -L, --size LogicalVolumeSize[kKmMgGtTpPeE]
64              Gives the size to allocate for the new logical volume.   A  size
65              suffix  of  K for kilobytes, M for megabytes, G for gigabytes, T
66              for terabytes, P for petabytes or E for exabytes is optional.
67              Default unit is megabytes.
68
69       --minor minor
70              Set the minor number.
71
72       -M, --persistent y/n
73              Set to y to make the minor number specified persistent.
74
75       -m, --mirrors Mirrors
76              Creates a mirrored logical volume with  "Mirrors"  copies.   For
77              example,  specifying  "-m  1" would result in a mirror with two-
78              sides; that is, a linear volume plus one copy.
79
80              Specifying the optional argument "--nosync" will cause the  cre‐
81              ation  of the mirror to skip the initial resynchronization.  Any
82              data written afterwards will be mirrored, but the original  con‐
83              tents  will not be copied.  This is useful for skipping a poten‐
84              tially long and resource intensive initial sync.
85
86              Specifying the optional argument "--corelog" will create a  mir‐
87              ror  with an in-memory log verses a disk-based (persistent) log.
88              While this removes the need for an extra log device and *may* be
89              slightly  faster,  it  requires that the entire mirror be resyn‐
90              chronized upon each instantiation (e.g. a reboot).
91
92       -n, --name LogicalVolumeName
93              The name for the new logical volume.
94              Without this option a default names of "lvol#" will be generated
95              where # is the LVM internal number of the logical volume.
96
97       -p, --permission r/w
98              Set access permissions to read only or read and write.
99              Default is read and write.
100
101       -r, --readahead ReadAheadSectors
102              Set  read  ahead  sector count of this logical volume to a value
103              between 2 and 120.  Ignored by device-mapper.
104
105       -R, --regionsize MirrorLogRegionSize
106              A mirror is divided into regions of this size (in MB),  and  the
107              mirror  log  uses this granularity to track which regions are in
108              sync.
109
110       -s, --snapshot
111              Create a snapshot logical volume (or snapshot) for an  existing,
112              so  called  original logical volume (or origin).  Snapshots pro‐
113              vide a 'frozen image' of the contents of the  origin  while  the
114              origin  can still be updated. They enable consistent backups and
115              online recovery of removed/overwritten data/files. The  snapshot
116              does  not  need  the same amount of storage the origin has. In a
117              typical scenario, 15-20% might be enough. In case  the  snapshot
118              runs  out  of  storage,  use lvextend(8) to grow it. Shrinking a
119              snapshot is supported by lvreduce(8) as well.  Run  lvdisplay(8)
120              on  the snapshot in order to check how much data is allocated to
121              it.
122
123       -Z, --zero y/n
124              Controls zeroing of the first KB of data in the new logical vol‐
125              ume.
126              Default is yes.
127              Volume will not be zeroed if read only flag is set.
128              Snapshot volumes are zeroed always.
129
130              Warning:  trying  to  mount an unzeroed logical volume can cause
131              the system to hang.
132

Examples

134       "lvcreate -i 3 -I 8 -L 100M vg00" tries to  create  a  striped  logical
135       volume  with  3 stripes, a stripesize of 8KB and a size of 100MB in the
136       volume group named vg00. The logical volume  name  will  be  chosen  by
137       lvcreate.
138
139       "lvcreate  -m1  -L  500M  vg00" tries to create a mirror logical volume
140       with 2 sides with a useable size of  500  MiB.   This  operation  would
141       require  3  devices  -  two for the mirror devices and one for the disk
142       log.
143
144       "lvcreate --size 100m --snapshot --name snap /dev/vg00/lvol1"
145       creates a snapshot logical volume named /dev/vg00/snap which has access
146       to the contents of the original logical volume named /dev/vg00/lvol1 at
147       snapshot logical volume creation time. If the original  logical  volume
148       contains a file system, you can mount the snapshot logical volume on an
149       arbitrary directory in order to access the contents of  the  filesystem
150       to run a backup while the original filesystem continues to get updated.
151
152

SEE ALSO

154       lvm(8), vgcreate(8), lvremove(8), lvrename(8) lvextend(8), lvreduce(8),
155       lvdisplay(8), lvscan(8)
156
157
158
159Sistina Software UK                LVM TOOLS                       LVCREATE(8)
Impressum