How to create non-root mirrored logical volumes on hp-ux?



  • Note: You can use physical volumed groups, these are physical disks which have been place in a physical volume group under LVM. This aids for performance and resllience benefits.

    This example uses a physical volume group (pvg00) but you do not have to use them. So you would not have to use the -g option to for vgextend or lvcreate.

    Bring physical disks to be used for volume group in to LVM.

    # pvcreate /dev/rdsk/c1t4d0
    Physical volume "/dev/rdsk/c1t4d0" has been successfully created.
    # pvcreate /dev/rdsk/c1t5d0
    Physical volume "/dev/rdsk/c1t5d0" has been successfully created.
    # pvcreate /dev/rdsk/c1t6d0
    Physical volume "/dev/rdsk/c1t6d0" has been successfully created.
    

    Create a volume group

    Make a directory for the volume group

    # mkdir /dev/vg01
    

    Make the special file for the volume group called group, the c, mean character device, 64, is the major number for volume groups, and 0x010000 is the minor number, this must be unique for every volume group

    # mknod /dev/vg01/group c 64 0x010000
    

    Create volume groups putting disk into a physical vg.

    # vgcreate -s 16 -g pvg00 /dev/vg01 /dev/dsk/c1t1d0
    Increased the number of physical extents per physical volume to 4375.
    Creating "/etc/lvmpvg".
    Volume group "/dev/vg01" has been successfully created.
    Physical volume group "pvg00" has been successfully created.
    Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
    
    # vgextend -g pvg00 /dev/vg01 /dev/dsk/c1t2d0
    # vgextend -g pvg00 /dev/vg01 /dev/dsk/c1t3d0
    
    # vgextend -g pvg01 /dev/vg01 /dev/dsk/c1t4d0
    # vgextend -g pvg01 /dev/vg01 /dev/dsk/c1t5d0
    # vgextend -g pvg01 /dev/vg01 /dev/dsk/c1t6d0
    

    Create a logical volume, the -m 1, means create one mirror copy, -M mirror write cache recovery is off (n), -c y, mirror consistency recover is enabled, -s g, strict mirroring on PVG-strict, the -n means the name of the volume, -L means size in MB, and finally the volume group the logical volumes needs to be created in.

    , # lvcreate -m 1 -M n -c y -s g -n lvol1 -L 7000 /dev/vg01
    Warning: rounding up logical volume size to extent boundary at size "7008" MB.
    Logical volume "/dev/vg01/lvol1" has been successfully created with
    character device "/dev/vg01/rlvol1".
    Logical volume "/dev/vg01/lvol1" has been successfully extended.
    Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
    

    Create another logical volume of different size

    # lvcreate -m 1 -M n -c y -s g -n lvol2 -l 12246 /dev/vg01
    Logical volume "/dev/vg01/lvol2" has been successfully created with
    character device "/dev/vg01/rlvol2".
    Logical volume "/dev/vg01/lvol2" has been successfully extended.
    Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
    

    Create the filesystems, using vxfs type filesystem layout. This is hp's cut down version of VxFS.

    # newfs -v -F vxfs /dev/vg01/rlvol1
    # newfs -v -F vxfs /dev/vg01/rlvol2
    

    Add entries into the /etc/fstab file and mount the file systems, for example:
    /dev/vg01/lvol1 /oracle vxfs delaylog 0 2
    /dev/vg01/lvol2 /dbdata vxfs delaylog 0 2

    # mkdir /oracle
    # mkdir /dbdata
    # mount /oracle
    # mount /dbdata
    

Log in to reply
 

© Lightnetics 2024