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
- lspv - list all disks on the system
- lsvg - list all volume groups on the system
- lsvg -l “vgname” - list all logical volumes in volume group
- lsfs - list all filesystems in the system
- mklvcopy -k lvname 2 pvname - will create a mirror copy of the named logical volume on named disk
- lslv -m lvname - can be used to check logical volume mirrors
- savevg - backup entire volume group, e.g.
savevg -i volgrp /dev/rmt1
- restvg - restore from savevg backup
- mirrorvg - mirror an entire volume group, e.g.
mirrorvg -s rootvg
Still stuck? Maybe we can help. Contact us at Upwork
Never miss a thing subscribe to our newsletter
or follow us on twitter
For more super cool techie stuff check out our blog!!
Recent Changes
Contribute to this wiki
Why not help others by sharing your knowledge? Contribute something to this wiki and
join out hall of fame!
Contact us for a user name and password