Table of Contents

HP-UX

How to use LVM on HP-UX

Example

PV

scan disk

# ioscan    <- scan disk

check new disks

# xpinfo -i
# ioscan -N -fnu -C disk

crate pv

# pvcreate /dev/rdisk/disk23     -f : force, if you already use pv.

VG

# strings /etc/lvmtab   <- check the existing vg
# ls -l /dev/*/group   <- check the exsisting minor number
# ls /dev/disk/disk*

# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000   <- new minor number (example : 0x010000 , 0x020000)
<- c : irrevocability(you cannot change this parameter.)
<- 64 : irrevocability(you cannot change this parameter.)

# vgcreate -s 8 /dev/vg01 /dev/disk/disk23
    <- Option: -s 16  (change PE Seize from default 4 to 16)
               PE Size is 4, 8, 16, 32, 64, 128 etc

# vgdisplay -v /dev/vg01

Delete VG

# vgchange -a n /dev/vg01   <- vg diactivate
# vgexport -m /dev/null /dev/vg01   <- delete vg
# strings /etc/lvmtab   <- check vg

LV

# vgdisplay /dev/vg01    <- Check Free PE
# lvcreate -l 300 -n lvol1 /dev/vg01   <- 300PE
   -l : PE
   -L : MB
# lvdisplay /dev/vg01/lvol1

Delete LV

# lvremove /dev/vg01/lvol1  <- delete vg
# vgdisplay -v /dev/vg01   <- check vg

FileSystem

# newfs -F vxfs -o largefiles /dev/vg01/rlvol1
# mkdir /u02
# mount -F vxfs -o largefiles,log,nodatainlog /dev/vg01/lvol1 /u02
# df -k
# umount /u02
# vi /etc/fstab
    /dev/vg01/lvol1 /u02 vxfs largefiles,nodatainlog,log 0 2
# mount -a

fuser -u /u02 : check mount process


Note

Import LVM

# ioscan
# xpinfo -i   <- check imprted Disk(cu:ldev) and disk No.

# mkdir /dev/vgtest1
# vgimport /dev/vgtest1   /dev/disk/diskXX

VG Activate / Deactivate

# vgdisplay /dev/vgtest | Grep Status    <-  Check VG Status
# vgchange -a y /dev/vgtest   <- Activated volume group
# vgchange -a n /dev/vgtest   <- Deactivated volume group

Disabling Clustering for an LVM Volume / Enabling Clusteringr

vgchange -c n /dev/vgtest      <- Disable
vgchange -c y /dev/vgtest      <- Enable
vgchange -c n /dev/vgtest
vgchange -a y /dev/vgdata

mount /dev/testvg/lvol1 /disk
umount /dev/testvg/lvol1 /disk

vgchange -a n /dev/vgdata
vgchange -c y /dev/vgtest

Delete VG

# strings /etc/lvmtab   <- check vg
# vgchange -a n /dev/vg01   <- vg diactivate
# vgexport  /dev/vg01   <- delete vg
# strings /etc/lvmtab   <- check vg