6.
Initialize the disk as a physical volume using the
pvcreate
command. For example:
# pvcreate /dev/rdisk/disk3
Use the character device file for the disk.
If you are initializing a disk for use as a boot device, add the
-B
option to
pvcreate
to
reserve an area on the disk for a LIF volume and boot utilities. If you are creating a boot disk
on an HP Integrity server, make sure the device file specifies the HP-UX partition number (2).
For example:
# pvcreate -B /dev/rdisk/disk3_p2
NOTE:
Version 2.0 and 2.1 volume groups do not support bootable physical volumes. Do
not use the
-B
option if the disk will be used in a Version 2.0 or 2.1 volume group.
After a disk is initialized, it is called a physical volume.
Creating a Volume Group
To create a volume group, use the
vgcreate
command. The options differ depending on whether
you are creating a Version 1.0 volume group or a Version 2.x volume group.
Creating the Volume Group Device File
As of the March 2008 release of HP-UX 11i Version 3, the
vgcreate
command automatically
creates the device file
/dev/vgname/group
to manage the volume group, regardless of the
volume group version. If you are using an HP-UX release before March 2008, or if you want to
specify the minor number of the group file, you must create
/dev/vgname/group
before running
the
vgcreate
command.
If the group file does not exist and
vgcreate
can not create it,
vgcreate
displays the following
message:
vgcreate: "/dev/vgname/group": not a character device.
To create the volume group device file, follow these steps:
1.
Create a directory for the volume group. For example:
# mkdir /dev/vgname
By convention,
vgname
is
vgnn
, where
nn
is a unique number across all volume groups.
However, you can choose any unique name up to 255 characters.
2.
Create a device file named
group
in the volume group directory with the
mknod
command.
For example:
# mknod /dev/vgname/group c major 0xminor
The
c
following the device file name specifies that
group
is a character device file.
major
is the major number for the
group
device file. For a Version 1.0 volume group, it is
64. For a Version 2.x volume group, it is 128.
minor
is the minor number for the
group
file in hexadecimal. For a Version 1.0 volume
group,
minor
has the form
0xnn0000
, where
nn
is a unique number across all Version 1.0
volume groups. For a Version 2.x volume group,
minor
has the form
0xnnn000
, where
nnn
is a unique number across all Version 2.x volume groups.
For more information on
mknod
, see mknod(1M); for more information on major numbers
and minor numbers, see
“Device Number Format” (page 15)
.
Creating a Version 1.0 Volume Group
To create a Version 1.0 volume group, use the
vgcreate
command, specifying each physical
volume to be included. For example:
# vgcreate /dev/vgname /dev/disk/disk3
44
Administering LVM