HP: Creating logical volumes

Title:

HP: Creating logical volumes

Author:

Douglas O’Leary <dkoleary@olearycomputers.com>

Description:

HP: Creating logical volumes

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…

Logical volumes can be used either for filesystems or for RDBMS raw partitions. Either way, the procedure for creating them are the same:

  • Create a volume group which will hold the logical volume. Please see HP: Creating Volume Groups

  • Determine how to place the LV on the VG’s disks.

    • Default - LVM will handle the LV placement:

      lvcreate -L ${Size-megs} ${vg}
      
    • Manual - Sysadmin determines where LV goes.

      • Set an array of disks on which the LV will reside:

        set -A disks $(list_o_disks)
        
      • Create the logical volume definition:

        lvcreate -i ${stripe_width} -I ${stripe_size} \
        -n ${lvol_name} ${vg}
        
      • Expand the LV to the appropriate size:

        lvextend -L ${Size-megs} ${lv} ${disks[*]}
        
  • If appropriate, create a filesytem. Please see Creating Filesystems for details.