************************************************************** AIX DISK SETUPS Mirror other disks: repeat for each disk and group { #mklvcopy volgroup 2 disk hd5 hdisk1 #syncvg -l volgroup hd5 } #chdev -l hdisk# -a -pv=yes #give a physical disk a PV number #lsdev -C -c disk #list known physical drives #lspv #list them with volgroup #mkvg -s 8 -f -y vg10 hdisk10 hdisk11 #make vg with disks #extendvg -f rootvg hdisk8 #add disk to vg #reducevg rootvg hdisk8 #remove disk from vg # remove a vg and its disks #varyoffvg catvg #reducevg -df catvg hdisk2 hdisk3 hdisk4 hdisk5 hdisk6 hdisk7 #ls /etc/vg #see what UIDs for vgs #lsvg #see vg names #lsvg -p rootvg #see chars of rootvg #varyonvg rootvg #turn on a vg #varyoffvg rootvg #turn off a vg #chpv -vr pvname #remove pvname disk from volgrp #chpv -va pvname #replace disk in volgrp #extendlv u01lv 20 #add 20 PP/LP to u01lv exportvg/importvg #move or resync a volgrp ************************************************************** MIRROR rootvg ON AIX 4.X ASSUME: hdisk0 is original bootable system disk, hdisk1 is mirror Add the second drive to rootvg #extendvg rootvg hdisk1 Mirror all the root logical volumes onto the second hdisk including hd5 and paging. #mklvcopy xx 2 hdisk1 2nd log hd8 3rd tmp hd3 4th var hd9var 5th page hd6 6th usr hd2 7th / hd4 Sync the rootvg #syncvg -v rootvg Make the second drive bootable #bosboot -a #bootlist -m normal hdisk0 hdisk1 Remove the first copy #rmlvcopy hd# 1 hdisk0 Resync so hdisk0 is like hdisk1 layout #syncvg -v rootvg ************************************************************** HP DISK SETUPS To see what disks are currently used by the disk groups #strings /etc/lvmconf/*.conf | grep dev #vgdisplay [-v] | more Disks must be physically setup for volume control !!**** will initialize disk DESTROYING all data on disk #pvcreate /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 #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 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/catvg/u02lv #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 Allow the system to boot from either disk #lvlnboot -r lvol1 /dev/vg00 #lvlnboot -r lvol2 /dev/vg00 ************************************************************** AIX LVM commands chlv(1) - Changes only the characteristics of a logical volume. cplv(1) - Copies the contents of a logical volume to a new logical volume. extendlv(1) - Increases the size of a logical volume by adding unallocated physical partitions from within the volume group. fdflag(1) - Resolves text and graphic links within a database. fdxtrn(1) - Resolves cross-database links within a library. lslv(1) - Displays information about a logical volume. lvm_changelv(3) - Changes the attributes of a logical volume. lvm_changepv(3) - Changes the attributes of a physical volume in a volume group. lvm_createlv(3) - Creates an empty logical volume in a specified volume group. lvm_createvg(3) - Creates a new volume group and installs the first physical volume. lvm_deletelv(3) - Deletes a logical volume from its volume group. lvm_deletepv(3) - Deletes a physical volume from a volume group. lvm_extendlv(3) - Extends a logical volume by a specified number of partitions. lvm_installpv(3) - Installs a physical volume into a volume group. lvm_migratepp(3) - Moves a physical partition to a specified physical volume. lvm_querypv(3) - Queries a physical volume and returns all pertinent information. lvm_queryvg(3) - Queries a volume group and returns pertinent information. lvm_queryvgs(3) - Queries volume groups and returns information to online volume groups. lvm_reducelv(3) - Reduces the size of a logical volume by a specified number of partitions. lvm_resynclp(3) - Synchronizes all physical partitions for a logical partition. lvm_resynclv(3) - Synchronizes all physical copies of all of the logical partitions for a logical volume. lvm_resyncpv(3) - Synchronizes all physical partitions on a physical volume with the related copies of the logical partition to which they correspond. lvm_varyoffvg(3) - Varies off a volume group. lvm_varyonvg(3) - Varies a volume group on-line. mklv(1) - Creates a logical volume. mklvcopy(1) - Provides copies of data within the logical volume. rmlv(1) - Removes logical volumes from a volume group. rmlvcopy(1) - Removes copies from a logical volume. synclvodm(1) - Synchronizes or rebuilds the logical volume control block, the device configuration database, and the volume group descriptor areas on the physical volumes. xlvm(1) - Starts Storage Manager, a Visual System Management (VSM) application. ************************************************************** 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