lvcreate(1M)
NAME
lvcreate − create logical volume in LVM volume group
SYNOPSIS
/sbin/lvcreate [-A autobackup] [-c mirror_consistency] [-C contiguous] [-d schedule]
[-i stripes -I stripe_size] [-l le_number | -L lv_size] [-m mirror_copies]
[-M mirror_write_cache] [-n lv_name] [-p permission] [-r relocate] [-s strict] vg_name
Remarks
Mirror disk operations require the installation of the optional HP MirrorDisk/UX software, which is not included in the standard HP-UX operating system. lvcreate cannot be performed if the volume group is activated in shared mode. Logical volumes that were created using the striped option are not supported in shared mode.
DESCRIPTION
The lvcreate command creates a new logical volume within the volume group specified by vg_name. Up to 255 logical volumes can be created in one volume group.
If you specify the -n lv_name option, a new logical volume is created with that name. Otherwise, a system-generated name of the form lvolN is created, where N is the decimal equivalent of the two least significant bytes of the minor number of the new logical volume, in the range 1 to 255 (see lvm(7)). Two device files are created in vg_name: a block device file named lv_name or lvolN, and a character (raw) device file named rlv_name or rlvolN.
If you omit the -l and -L options, the logical volume is created with zero length. This permits you to choose its physical volume location when you allocate logical extents with the lvextend command (see lvextend(1M)). If you specify -l or -L, the location is determined automatically.
The default settings provide the most commonly used characteristics. Use the options to tailor the logical volume to the requirements of the system. Once a logical volume is created, some of its characteristics can be changed with the lvchange, lvextend, and lvreduce commands (see lvchange(1M), lvextend(1M), and lvreduce(1M)).
Options and Arguments
The -c, -d, -m, -M, and -s options are only meaningful if the optional HP MirrorDisk/UX software has been installed on the system.
lvcreate recognizes the following options and arguments:
vg_name The path name of a volume group.
-A autobackup Set automatic backup for this invocation of this command. autobackup can have one of the following values:
y Automatically back up configuration changes made to the logical volume. This is the default.
After this command executes, the vgcfgbackup command (see vgcfgbackup(1M)) is executed for the volume group to which the logical volume belongs.
n Do not back up configuration changes this time.
-c mirror_consistency Set mirror consistency recovery. This option is effective only when -M n is specified. It is ignored for -M y. mirror_consistency can have one of the following values:
y Set mirror consistency recovery on. This is the default.
LVM achieves mirror consistency during volume group activation by going through all logical extents and copying data from a nonstale copy to the other mirror copies.
n Set mirror consistency recovery off. LVM does not perform mirror consistency recovery on this logical volume when the volume group is activated.
-C contiguous Set the contiguous allocation policy. A contiguous logical volume has three characteristics:
• Physical extents are allocated in ascending order,
• No gap is allowed between physical extents within a mirror copy,
• Physical extents of any mirror copy all reside on a single physical volume.
Use the strict (-s) and contiguous (-C) options together to form various combined allocation policies on a logical volume. For example, -s y -C y defines a logical volume such that each mirror copy is contiguous, yet mirror copies of a logical extent cannot share the same physical volume.
contiguous can have one of the following values:
y Set a contiguous allocation policy.
n Do not set a contiguous allocation policy. This is the default.
-d schedule Set the scheduling policy when a logical extent with more than one mirror is written. (The scheduling policy of a striped logical volume is striped and cannot be changed.) schedule can have one of the following values:
p Establish a parallel scheduling policy. This is the default.
s Establish a sequential scheduling policy. Use this value with care, because it leads to performance loss in most cases.
-i stripes Set the number of disks to stripe across. stripes must be in the range 2 to the number of disks in the current volume group. -i and -I must be specified together.
-I stripe_size Set the size in kilobytes of the stripe. stripe_size can have the value 4, 8, 16, 32, or 64. -i and -I must be specified together.
-l le_number Allocate space to the logical volume, specified in logical extents. le_number is a decimal value in the range 1 to 65535 (the implementation limit). The default is described above.
Either -l or -L can be specified, but not both.
-L lv_size Allocate space to the logical volume, specified in megabytes. lv_size is a decimal value in the range 1 to 4096 (4 gigabytes). lv_size is rounded up to the nearest multiple of the logical extent size, equivalent to the physical extent size defined for the volume group by the vgcreate command (see vgcreate(1M)). The default is described above.
Either the -l or the -L option can be specified, but not both.
-m mirror_copies Set the number of mirror copies allocated for each logical extent. A mirror copy contains the same data as the original. mirror_copies can have the value 1 or 2. The default value is 0 (no mirror copies).
-M mirror_write_cache Set the Mirror Write Cache flag. mirror_write_cache can have one of the following values:
y Set Mirror Write Cache on. This is the default.
Every write to a mirror copy is recorded in the Mirror Write Cache. The Mirror Consistency Record in the Volume Group Reserved Area on the disk is updated whenever there is a write to a logical track group that is not already recorded in the cache. This allows LVM to determine whether all the mirror copies are identical, even across system crashes. When the volume group is activated, the Mirror Consistency Record is used to perform mirror consistency recovery.
n Set Mirror Write Cache to off. Mirror write does not incur an additional write to the Mirror Consistency Record.
-n lv_name Set the name of the new logical volume to lv_name, where lv_name is a simple file name, not a path name. The default is described above.
-p permission Set the access permission. permission can have one of the following values:
w Set the access permission to read-write. This is the default.
r Set the access permission to read-only.
-r relocate Set the bad block relocation policy. relocate can have one of the following values:
y Allow bad block relocation. This is the default.
n Prevent bad block relocation.
-s strict Set the strict allocation policy. Mirror copies of a logical extent can be allocated to share or not share the same physical volume or physical volume group. strict can have one of the following values:
y Set a strict allocation policy. Mirrors of a logical extent cannot share the same physical volume. This is the default.
g Set a PVG-strict allocation policy. Mirrors of a logical extent cannot share the same physical volume group. A PVG-strict allocation policy cannot be set on a logical volume in a volume group that does not have a physical volume group defined.
n Do not set a strict or PVG-strict allocation policy. Mirrors of a logical extent can share the same physical volume.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
If LANG is not specified or is null, it defaults to "C" (see lang(5)).
If any internationalization variable contains an invalid setting, all internationalization variables default to "C" (see environ(5)).
EXAMPLES
Create a logical volume in volume group /dev/vg02:
lvcreate /dev/vg02
Create a logical volume in volume group /dev/vg03 with nonstrict 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 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
WARNINGS
The -m and -r options cannot be used with HP-IB devices.
The root, swap, and dump logical volumes (see lvlnboot(1m)) must be created with contiguous allocation policy.
SEE ALSO
lvchange(1M), lvextend(1M), lvreduce(1M), pvchange(1M).
Hewlett-Packard Company — HP-UX Release 10.20: July 1996