HP: Creating volume groups

Title:

HP: Creating volume groups

Author:

Douglas O’Leary <dkoleary@olearycomputers.com>

Description:

HP: Creating volume groups

Date created:

05/2005

Date updated:

06/2006

Disclaimer:

Standard: Use the information that follows at your own risk. If you screw up a system, don’t blame it on me…

  • If necessary, update maxvgs in the kernel to provide the requisite number of volume groups. (Please see Command line kernel creation)

  • Create the physical volume - use the raw device driver:

    # pvcreate /dev/rdsk/c#t#d#
    
  • If you have more than one disk, setting up an array might be worthwhile. This will be particulary useful when creating striped logical volumes across a set of disks. Something I’ve done in the past:

    for hw in $(ioscan -fun -C disk | grep -i emc | awk '{print $3}')
    do
       ioscan -fun -H ${hw} | grep dsk | awk '{print $1}'
    done | sort > emc.disks
    

    Edit the file emc.disksas appropriate, then:

    set -A disks $(cat emc.disks)
    

    From here, simply loop through the array to pvcreate all disks:

    for disk in ${disks[*]}
    do
       pvcreate -f /dev/rdsk/${disk##*/}
       # NOTE:; Use the -f option ONLY if you're absolutely sure these
       disks aren't being used!
    done
    
  • Make the volume group subdirectory, then the volume group raw device driver:

    # mkdir /dev/vg##
    # mknod /dev/vg##/group c 64 0x##0000
    

    vg## is the standard; however, you can deviate from it. ## in this case, is a one up serial number vg01, vg02 for example.

    The minor number on group raw device driver is one up between volume groups. The docs suggest using the hex number for the owning volume group - which works only if you don’t deviate from the standard. Your best bet is to confirm the minor numbers by doing something like:

    for x in $(vgdisplay | grep -i "vg name" | awk '{print $3}')
    do
       ls -l ${x}/group
    done | sort -n -k 5
    

    then pick the next available one.

  • Create the volume group by:

    vgcreate /dev/vg## /dev/dsk/c#t#d#
    

    Or, if you’ve set up the array:

    vgcreate /dev/vg## ${disks[*]}