Logical Volume Manager

Creating logical volumes

  1. enter lsdev -C -c disk to check disks available

  2. create volume group using: mkvg -y “vgname” hdiskn

  3. enter varyonvg vgname

  4. To create logical volume enter: mklv -y “lvname volgrp n

    e.g. mklv -y “testlv1” testvg 64 - will create a logical volume called testlv1 in volume group testvg of 64 logical partitions (to check the size of the physical partitions, run lsvg vgname)

  5. To create a mirrored logical volume enter: mklv -y “lvname -c n volgrp n disk1 disk2

    e.g. mklv -y “testlv2” -c 2 testvg 64 hdisk1 hdisk2 - will create a logical volume called testlv2 in volume group testvg with 2 copies of the 64 logical partitions on disks hdisk1 and hdisk2

  6. create filesystem by entering crfs -v jfs -l lvname -m /mountdir -A yes

    This will dreate a filesystem the same size as the logical volume, create the mount directory and include the filesystem in /etc/filesystems so it will be automatically mounted when the system is rebooted.

Extending logical volumes

  1. enter extendlv lvname size - to extend the named logical volumes by the number of physical partitions named by the size parameter

  2. enter chfs -a size=+size /mountpoint - where size is in 512 byte blocks (can calculate this by (PP * 1000000)/512 ) and mountpoint is the physical mountpoint of the logical volume

Some useful LVM commands