Steps for Creating VG and LVM Manually

1. Create the directory /dev/vg00 with the character special file called group.

Example:

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

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 09. The maximum value of NN is controlled by the kernel tunable parameter maxvgs.

2. Initialize the disks using pvcreate(1M).

The -f option forces the creation of a physical volume (thus deleting any file system present) without first requesting confirmation.

Example:

pvcreate -f /dev/rdsk/c0t6d0

If you are creating volume group which is going to be bootable, then you must use the -B options.

Example:

pvcreate -Bf /dev/rdsk/c0t6d0
mkboot /dev/rdsk/c0t6d0 (places boot utilities in the boot area)
mkboot -a "hpux /stand/vmunix" /dev/rdsk/c0t6d0 (adds an AUTO file in the boot LIF area)

3. Create the volume group.

Create a volume group named /dev/vg00 that contains one disk.

Example:

vgcreate /dev/vg00 /dev/dsk/c0t6d0

Create a volume group named /dev/vg00 that contains more than one disk.

Example:

vgcreate /dev/vg00 /dev/dsk/c0t6d0 /dev/dsk/c0t5d0

4. Create logical volume in LVM volume group.

Create a logical volume lvol7 with a size of 100 MB in volume group /dev/vg00:

Example:

lvcreate -L 100 -n lvol7 /dev/vg00

5. Construct a new file system.

Example:

newfs -F vxfs /dev/vg00/rlvol7 (creates a vxfs file system)
newfs -F hfs /dev/vg00/rlvol7 (creates a hfs file system)

6. Create a mount point for the newly created logical volume.

You usually want to create the mount point with file permissions of 755 (drwxr-xr-x). This can be accomplished by setting the file mode creation mask (umask 022). Then you need to add the mount information to the /etc/fstab.

Example: (vxfs File System)

umask 022
mkdir /new (name of mount directory)
vi /etc/fstab and add the following:

/dev/vg00/lvol7 /new vxfs delaylog 0 2

save /etc/fstab
type: mount -a (this will mount the newly created logical volume)

Example: (hfs File System)

umask 022
mkdir /new (name of mount directory)
vi /etc/fstab and add the following:

/dev/vg00/lvol7 /new hfs default 0 1

save /etc/fstab
type: mount -a (this will mount the newly created logical volume)

The newly created logical volume will now mount automatically each time the system is booted.