Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > V

vgcreate(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

vgcreate — create LVM volume group

SYNOPSIS

/usr/sbin/vgcreate [-f] [-A autobackup] [-x extensibility] [-e max_pe] [-l max_lv] [-p max_pv] [-s pe_size] [-g pvg_name] vg_name pv_path ...

DESCRIPTION

The vgcreate command creates a new volume group. vg_name is a symbolic name for the volume group and must be used in all references to it. vg_name is the path to a directory entry under /dev that must contain a character special file named group. Except for the group entry, the vg_name directory should be empty. The vg_name directory and the group file have to be created by the user (see lvm(7)).

vgcreate leaves the volume group in an active state.

Before assigning a physical volume to a volume group, the physical volume has to be created using the pvcreate command (see pvcreate(1M)).

If vgcreate fails to install the first specified physical volume into the volume group, the volume group is not created. If, for any reason, one of the remaining specified physical volumes cannot be installed into the volume group, an error message is printed, but the installation continues until the end of the list of physical volumes.

Options and Arguments

vgcreate recognizes the following options and arguments:

pv_path

The block device path name of a physical volume that will be assigned to the new volume group.

On PA-RISC systems, pv_path should be the path name for the whole disk. For Itanium(R)-based system boot physical volumes, pv_path should be the path name for the disk section containing the HP-UX partition (see model(1) and getconf(1)). For Itanium-based system non-boot physical volumes, pv_path can be the path name for the whole disk or the disk section containing the HP-UX partition.

You can specify physical volume links pv-links for a physical volume providing different paths that reference the same physical volume in the pv_path list. The order in which the paths are listed is important. The first path becomes the primary link to the physical volume, and the second becomes an alternate link to the physical volume. The primary link is the default path used to access the physical volume. (see WARNINGS section). If the primary link becomes unavailable, LVM automatically switches to the alternate link to access the physical volume. Currently, LVM supports a maximum of 8 paths to a physical volume (7 alternate and one primary).

vg_name

The path name of a subdirectory of the /dev directory. vg_name must be empty except for a character special file named group. Typically, this directory name is in the form /dev/vgNN, where NN numbers sequentially from 00.

-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 volume group. This is the default.

After this command executes, the vgcfgbackup command (see vgcfgbackup(1M)) is executed for the volume group.

n

Do not back up configuration changes this time.

-e max_pe

Set the maximum number of physical extents that can be allocated from any of the physical volumes in the volume group. The default value for max_pe is 1016. However, if the size of any physical volume exceeds 1016 times the pe_size, the default value for max_pe is adjusted to match the physical volume size. The maximum number of physical extents can be a value in the range 1 to 65535.

-f

This option will force a volume group to be created with a physical volume which has alternate block(s) already allocated, (that is, this physical volume was not initialized using pvcreate -f.) This option should be used with extreme caution. If the volume group to be created has a different physical extent size, the alternate block(s) might be inside the user data area. Potential data corruption could occur.

-g pvg_name

Create a new physical volume group with the name pvg_name. All physical volumes specified in the pv_path parameter become a member of the newly created physical volume group.

The physical volume group information is stored in an ASCII file, /etc/lvmpvg. The file can be edited to create a physical volume group instead of using the vgcreate command. However, ensure that the physical volumes to be used have already been installed in the volume group prior to creating the physical volume group.

The physical volume group name must be unique within a volume group although identical physical volume group names can appear in different volume groups (see lvmpvg(4) for format details).

-l max_lv

Set the maximum number of logical volumes that the volume group is allowed to contain. The default value for max_lv is 255. The maximum number of logical volumes can be a value in the range 1 to 255.

-p max_pv

Set the maximum number of physical volumes that the volume group is allowed to contain. The default value for max_pv is 16. The maximum number of physical volumes can be a value in the range 1 to 255.

-s pe_size

Sets the number of megabytes in each physical extent, where pe_size is expressed in units of megabytes (MB) in the range 1 to 256. pe_size must be equal to a power of 2 (1, 2, 4, 8, etc.). The default value for pe_size is 4 (four megabytes).

-x extensibility

Set the allocation permission for adding physical extents on the physical volumes specified by the pv_path parameter. extensibility can have one of the following values:

y

Allow allocation of additional physical extents on the physical volume. This is the default.

n

Prohibit allocation of additional physical extents on the physical volume. Logical volumes residing on the physical volume can still be accessed after the volume group has been activated by the vgchange -a y command.

Alternate Links (PVLinks):

In this release of HP-UX, LVM continues to support Alternate Links to a device to allow continued access to the device, if the primary link fails. This multiple link or multipath solution increases data availability, but does not allow the multiple paths to be used simultaneously.

There is a new feature introduced in the Mass Storage Subsystem on this version of HP-UX that also supports multiple paths to a device and allows access to the multiple paths simultaneously. The Mass Storage Subsystem will balance the I/O load across the valid paths. This new multi-path behavior is enabled and disabled through the use of the scsimgr command. See scsimgr(1M) for details.

It is no longer required or recommended to configure LVM with alternate links. However, it is possible to maintain the traditional LVM behavior. To do so, both of the following criteria must be met:

  • Only the legacy device special file naming convention is used in the volume group configuration.

  • The scsimgr command is used to disable the Mass Storage Subsystem multipath behavior.

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 volume group named /dev/vg00 containing two physical volumes with extent size set to 2 MB, from scratch.

  • First, create the directory /dev/vg00 with the character special file called group.

    mkdir /dev/vg00 mknod /dev/vg00/group c 64 0x030000

  • The minor number for the group file should be unique among all the volume groups on the system. It has the format 0xNN0000, where NN runs from 00 to ff.

  • Initialize the disks using pvcreate.

    pvcreate /dev/rdsk/c1t0d0 pvcreate /dev/rdsk/c1t2d0

  • Create the volume group.

    vgcreate -s 2 /dev/vg00 /dev/dsk/c1t0d0 /dev/dsk/c1t2d0

  • Create a volume group named /dev/vg01 that can contain a maximum of three logical volumes, with extent size set to 8 MB:

    vgcreate -l 3 -s 8 /dev/vg01 /dev/dsk/c3t4d0

  • Create a volume group named /dev/vg00 and a physical volume group named PVG0 with two physical volumes:

    vgcreate -g PVG0 /dev/vg00 /dev/dsk/c1t0d0 /dev/dsk/c2t0d0

  • Using the PVLinks feature to create a volume group named /dev/vg00 with a physical volume that can be referenced by two different paths. /dev/dsk/c3t0d0 and /dev/dsk/c4t0d0 refer to the same physical volume, accessed via different controller hardware paths. In this example, /dev/dsk/c3t0d0 becomes the primary link to the physical volume. /dev/dsk/c4t0d0 becomes an alternate link to the physical volume.

    vgcreate /dev/vg00 /dev/dsk/c3t0d0 /dev/dsk/c4t0d0

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.