Working with HPUX Unix LVM storage

Here is my understanding as I learn about HPUX Storage. These notes will be updated as I continue to learn.

I do not call myself an expert yet, so don’t expect any of this information to be useful. This is a selfish post to help myself in the future. If it helps you too, fantastic…. but if you don’t understand LVM concepts and you blindly execute these commands without understanding them, you will break things.

Adding space to a filesystem:

You will calculate the amount of space you need. First check the extent size. Take the size you desire, and divide by the extent size in MB to find the number of extents you need to add using the lvextend command.

If the extent size is 16mb, and the arch filesystem is at /dev/vg100/lvol8, these commands will bring the /arch volume to 50GB in size.

vgdisplay -v
swlist -l product | grep -i online
lvdisplay -v /dev/vg100/lvol8
lvextend -l 1000 /dev/vg100/lvol8
extendfs /dev/vg100/lvol8 # If the file system is unmounted
fsadm -b 50048000 /arch # If the file system is mounted and you have jfs online

Add Physical Volumes to a volume group:

If you need more Physical Extents in a volume group, you will need to add another Physical Volume to the group, or grow the underlying LUN.  Here is how to add more Physical Volumes.

Check what luns are not part of a volume group:

for i in `ioscan -f -n -N -C disk | grep /dev/disk | tr -s " " | cut -d ' ' -f 2`; do pvdisplay $i; done

You might also just check what drives where added today:

ls -la /dev/disk

Add one of these new luns to an existing volume group:

Prepare the disk for LVM:

pvcreate /dev/rdisk/disk666

Add it to VG:

vgextend vg500 /dev/disk/disk666


Add a volume group to the box :

First ask yourself… Is this the right thing to do? Or should I extend one that I already have?  -s sets the PV size, or you can omit it to leave it default.

vgcreate -s 64 vg500 /dev/disk/disk157


Add a filesystem to the box:
lvdisplay -v vg100
lvdisplay /dev/vg100
ls /dev/vg100
cat /etc/fstab
lvcreate -L 204800 -n lvol22 /dev/vg100/
newfs -F vxfs /dev/vg100/rlvol22
mkdir /oradata14
mount /dev/vg100/lvol22 /oradata14