************************************************************** HP DISK SETUPS To see what disks are currently used by the disk groups #strings /etc/lvmconf/*.conf | grep dev #vgdisplay -v | more #/bin/insf -eH 0/1/1/0.1.0 Disks must be physically setup for volume control !!**** will initialize disk DESTROYING all data on disk #pvcreate -fB /dev/rdsk/c#t#d# Create volgoups first (catvg) #mkdir /dev/catvg Assume only vg00 exists, to verfiy do a { #ll /dev/*vg*/group Note the output, 00 and 01 are used, use 02 now crw-r--r-- 1 root root 64 0x000000 May 23 1997 /dev/vg00/group ^^ crw-r--r-- 1 root sys 64 0x010000 Jun 13 1997 /dev/somevg/group ^^ } If only vg00 #mknod /dev/catvg/group c 64 0x010000 Else if others, X=largest number + 1 IN HEX (10=a) (but less than 16) #mknod /dev/catvg/group c 64 0x0X0000 Endif #vgcreate /dev/catvg /dev/dsk/c#t#d# [disks...] Create logical volumes #lvcreate -n u01lv /dev/catvg Add the physical disks to the logical volume #lvextend -L 800 /dev/catvg/u01lv /dev/dsk/c0t0d0 [disks...] ^size in MB ^disk dev to add to lv u01lv Create the file systems #newfs -F hfs /dev/catvg/ru01lv #newfs -F vxfs /dev/catvg/ru01lv #mkdir /u01 #mount /dev/catvg/u01lv /u01 #vi /etc/fstab Insert the following (o) /dev/catvg/u01lv /u01 hfs rw,suid 0 2 Mirror the data drives #lvextend -m 1 /dev/catvg/u01lv /dev/dsk/c0t0d0 ^phys disk to add to lv u01lv #for LV in 1 2 3 4 5 6 7 8 #do # echo $LV # ech $LV #done To take a copy out of mirror (not normally done) #lvreduce -m 0 /dev/catvg/u01lv /dev/dsk/c0t1d0 To view actions #strings /etc/lvmconf/*.conf | grep dev #vgdisplay [-v] #lvdisplay [-v] /dev/vg00/lvol1 #pvdisplay [-v] /dev/dsk/c2t5d0 ************************************************************** MIRROR vg00 ON HP/UX: Make the second disk a boot partition #pvcreate -B /dev/rdisk/c#t#d# Extend the disk into vg00 #vgextend /dev/vg00 /dev/dsk/c#t#d# Make the boot partition bootable #mkboot /dev/rdisk/c#t#d# #mkboot -a "hpux(10/0.5.0;0)/stand/vmunix" /dev/rdisk/c#t#d# Mirror the vg00 #lvextend -m 1 /dev/vg00/lvol# /dev/rdisk/c#t#d# ^one ^root ^disk # # lvol1 (swap) MUST be the first one mirrored - or you will # not be able to boot from mirror # #for LV in 1 2 3 4 5 6 7 8 #do # echo $LV # lvextend -m 1 /dev/vg00/lvol${LV} /dev/dsk/c2t1d0 #done # # if you have an extra swap vol (or other non-std vols) # #lvextend -m 1 /dev/vg00/lvolswap /dev/dsk/c2t1d0 Allow the system to boot from either disk #lvlnboot -r lvol1 /dev/vg00 #lvlnboot -r lvol2 /dev/vg00 #lvlnboot -v #lvlnboot -v [-d /dev/vg00/lvol2] #lvlnboot -R #setboot ************************************************************** HP LVM commands lvchange(1M) - change LVM logical volume characteristics lvcreate(1M) - create logical volume in LVM volume group lvdisplay(1M) - display information about LVM logical volumes lvextend(1M) - increase space, increase mirrors for LVM logical volume lvlnboot(1M) - prepare LVM logical volume to be root, boot, primary swap, or dump volume lvm(7) - Logical Volume Manager (LVM) lvmerge(1M) - merge two LVM logical volumes into one logical volume lvmmigrate(1M) - prepare root file system for migration from partitions to LVM logical volumes lvmpvg(4) - LVM physical volume group information file lvreduce(1M) - decrease number of physical extents allocated to LVM logical volume lvremove(1M) - remove one or more logical volumes from LVM volume group lvrmboot(1M) - remove LVM logical volume link to root, primary swap, or dump vol lvsplit(1M) - split mirrored LVM logical volume into two logical volumes lvsync(1M) - synchronize stale mirrors in LVM logical volumes pvchange(1M) - change char and access path of phy volume in LVM volume group pvcreate(1M) - create physical volume for use in LVM volume group pvdisplay(1M) - display info about physical volumes within LVM volume group pvmove(1M) - move allocated physical extents from a LVM ph vol to next ph vol vgcfgbackup(1M) - create or update LVM volume group configuration backup file vgcfgrestore(1M)- display or restore LVM volume group config from backup file vgchange(1M) - set LVM volume group availability vgcreate(1M) - create LVM volume group vgdisplay(1M) - display information about LVM volume groups vgexport(1M) - export an LVM volume group and its associated logical volume vgextend(1M) - extend an LVM volume group by adding physical volumes vgimport(1M) - import an LVM volume group onto the system vgreduce(1M) - remove physical volumes from an LVM volume group vgremove(1M) - remove LVM volume group definition from the system vgscan(1M) - scan physical volumes for LVM volume groups vgsync(1M) - synchronize stale logical volume mirrors in LVM volume groups