Thursday, July 23, 2015

HPUX LVM commands

To add one PV to existing VG03
#vgextend vg03 /dev/dsk/c5t2d0
#vgdisplay -v vg03

To extend 500MB  LV into a disk
#lvextend -L 500 /dev/vg01/lvdata  /dev/dsk/c5t2d0

To mirror LV into a different disk
#lvextend -m 1 /dev/vg03/lvol1  /dev/dsk/c1t3d0

How to create a file system in HPUX

1) Identify new disk by using ioscan command.
 #ioscan -fnC disk # pvcreate /dev/rdsk/c2t5d0

 2) creating a Volume Group vg03
 #mkdir /dev/vg03

 3) creating vg major and minor number
 #mknod /dev/vg03/group c 64 0x030000

 4) Creating vg03
 # vgcreaate /dev/vg03 /dev/dsk/c2t5d0

 5) Creating Logical Volume (Lvol) 1GB size
 #lvcreate -L 1024 -n lvol1 vg03

 6) Create a file system
 #newfs -F vxfs -o largefiles /dev/vg03/rlovl1

 7) Mount the filesystem
 # mount /dev/vg03/lvol1 /myfilesystem)

 8) To mount permanently, add entry in /etc/fstab file.