lvcreate.1m (2010 09)
l
lvcreate(1M) lvcreate(1M)
lvcreate /dev/vg02
Create a logical volume in volume group /dev/vg03
with non-strict allocation policy:
lvcreate -s n /dev/vg03
Create a logical volume of size 100 MB in volume group
/dev/vg03:
lvcreate -L 100 /dev/vg03
Create a space-efficient snapshot of size 10MB of the original logical volume
/dev/vg03/lvol1
:
lvcreate -S s -L 10 /dev/vg03/lvol1
Create a space-efficient snapshot of size 10MB of the original logical volume
/dev/vg03/lvol1
with
the threshold value set to 50%:
lvcreate -S s -L 10 -P 50 /dev/vg03/lvol1
Create a fully allocated snapshot called testsnap of the original logical volume
/dev/vg03/lvol1
:
lvcreate -S s -n testsnap -t y /dev/vg03/lvol1
Create a logical volume of size 90 MB striped across 3 disks with a stripe size of 64 KB:
lvcreate -L 90 -i 3 -I 64 /dev/vg03
Create a logical volume of size 90 MB striped across 3 disks with one mirror copy and a stripe size of 64
KB:
lvcreate -L 90 -i 3 -I 64 -m 1 /dev/vg03
Distributed Allocation Policy
This example shows how the -D y option can be used to create EXTENT-BASED MIRRORED STRIPES.
Assume that volume group
/dev/vgtest has two physical volume groups: pvg1 and pvg2.
Assume that each physical volume group has 2 physical volumes.
Assume that the first physical volume in each pvg has 3 extents free and the second physical volume in
each pvg has 2 extents free.
The following command creates a logical volume in vgtest with EXTENT-BASED MIRRORED STRIPES:
lvcreate -D y -s g -m 1 -l 5 /dev/vgtest
The distributed allocation proceeds as follows:
• A free extent is allocated from the 1st pvol in pvg1.
• A free extent is allocated from the 2nd pvol in pvg1.
• A free extent is allocated from the 1st pvol in pvg1.
• A free extent is allocated from the 2nd pvol in pvg1.
• A free extent is allocated from the 1st pvol in pvg1.
• Mirrors for the five extents are then allocated from the free extents in pvg2 in a similar manner.
WARNINGS
The root, swap, and dump logical volumes (see lvlnboot (1M)) must be created with contiguous allocation
policy.
Snapshot creation is not supported for swap or dump logical volumes. Also, creation of space efficient
snapshot is not supported for root and boot logical volumes.
The creation of striped and mirrored logical volume(s) may prevent the import and activation of the
volume group on an earlier HP-UX release. See lvcreate (1M) on the earlier release to see if it explicitly
states that striping and mirroring is supported. If the striped and mirrored logical volumes of the volume
group are removed or un-mirrored, the volume group becomes again compatible with the older HP-UX
releases.
By setting mirror consistency recovery off, crash recovery time will be reduced. After a system crash the
mirrored logical volume will be available, but there may not be consistent data across each mirror copy.
The only types of data that can safely be put on a mirrored logical volume with mirror consistency
recovery turned off are:
• data not needed after a crash, such as swap or other raw scratch data, or
• data that an application itself will automatically reconstruct; for example, a raw logical volume for
which a database keeps a log of incomplete transactions.
8 Hewlett-Packard Company − 8 − HP-UX 11i Version 3: September 2010