Logical Volume Manager is a disk management subsystem that allows you to manage physical disks as logical volumes.

Commonly used LVM procedures:

Create a new volume group, logical volume and filesystem.

#pvcreate /dev/rdsk/c0t1d0
#mkdir /dev/vg01
#mknod /dev/vg01/group c 64 0x010000
#vgcreate /dev/vg01 /dev/dsk/c0t1d0
#lvcreate -L 2000 /dev/vg01
#newfs -F vxfs -o largefiles /dev/vg01/rlvol1
#mkdir /ora_data01
#mount /dev/vg01/lvol1 /ora_data01

Create a stripped filesystem.

#lvcreate -i 3 -I 32 -L 24 -n lvol1 /dev/vg01

-i number of stripes
-I stripe size of 32KB
-L size of the volume

Mirror root and swap disk.

#pvcreate -B /dev/rdsk/disk20
#vgextend /dev/vg00 /dev/dsk/disk20
#mkboot /dev/rdsk/c0t6d0
#mkboot -a “hpux -lq” /dev/rdsk/disk20
#mkboot -a “hpux -lq” /dev/rdsk/<primary disk>
#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/disk20
#lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/disk20
#lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/disk20
#lvextend ……..all other volumes on primary disk

setboot -a 8/8.6.0

Replace a non-mirrored disk.

#lvreduce -m 0 -A n /dev/vg01/lvol1 /dev/dsk/cxtxdx
#vgreduce vg01 /de/dsk/cxtxdx
or
#pvchange -a N /dev/dsk/cxtxdx (if you have online replacement disks)

#vgcfgrestore -n /dev/vgXX /dev/rdsk/cxtxdx
#vgchange -a y /dev/vgXX
#newfs -F <fstype> /dev/vgXX/rlvolx
#mount <mountpoint>

Notes:
Make sure you have /etc/lvmconf/vgXX.conf
vgcfgbackup is run automatically
Defective disk was not mirrored before it failed

Replace a mirrored disk.

#vgcfgrestore -n /dev/vgXX /dev/rdsk/cxtxdx
#vgchange -a y /dev/vgXX
#vgsync /dev/vgXX

Notes:
Defective disk was mirrored before it failed

Replace mirrored boot disk.

#vgcfgrestore -n /dev/vg00 /dev/rdsk/cxtxdx
#vgchange -a y /dev/vg00
#vgsync /dev/vg00
#mkboot /dev/rdsk/cxtxdx
#mkboot -a “hpux -lq” /dev/rdsk/cxtxdx
#shutdown -r -y 0

Notes:
Confirm that you have /etc/lvmconf/vg00.conf
Defective disk was mirrored before it failed

Export and import a volume group.

System One:
#vgchange -a n /dev/vg01
#vgexport -v -m /tmp/mapfile -s /dev/vg01
#rcp /tmp/mapfile <system 2>:/tmp/mapfile

System two:
#mkdir /dev/vg01
#mknod /dev/vg01/group c 64 0xyy0000
#vgimport -v -m /tmp/mapfile -s /dev/vg01
#vgchange -a y /dev/vg01
#mkdir /ora_data01
#mount /dev/vg01/ora_data01 /ora_data01

 

Advertisements