Datacentre Support Reference Guides

HP: Creating Logical volumes

 

 


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

  1. Create a volume group which will hold the logical volume. Please see Creating Volume Groups

  2. Determine how to place the LV on the VG's disks.
    1. Default - LVM will handle the LV placement:

      lvcreate -L ${Size-megs} ${vg}

    2. Manual - Sysadmin determines where LV goes.
      1. Set an array of disks on which the LV will reside

        set -A disks $(list_o_disks)

      2. Create the logical volume definition:

        lvcreate -i ${num of disks to stripe across} \

        > -I ${stripe_size} -n ${lvol_name} ${vg}
      3. Expand the LV to the appropriate size:

        lvextend -L ${Size-megs} ${lv} ${disks[*]}

  3. If appropriate, create a filesytem. Please see Creating Filesystems for details.