Saturday, November 30, 2013

HPUX LVM notes

Quite dumb to start this with HPUX, but anyway, there it goes: # Create a LVM VG (HPUX) # add disk masking & zoning (storage & SAN switch) ioscan -fnNCdisk # check for new disks # you'll need the disk device '/dev/disk/diskNNN' ex: /dev/disk/disk175 pvcreate /dev/rdisk/disk175 # note that on pvcreate we use the raw (character) disk device # if needed create additional physical disks # a volume group is made of one or more physical disks vgcreate -e 64000 -l 64 -s 256 -g PVGSTO vgname /dev/disk/disk175 # this creates a volume group with 64000 maximum extents of 256 MB and 64 logical volumes # physical volume group will be named PVGSTO (this is useful when multiple storage tiers # are used in the same volume group # additional disks physical disks may be specified lvcreate -l 400 /dev/vgname /dev/vgname/lvol0 # this creates a logical volume '/dev/vgname/lvol0' with 10GB inside volume group 'vgname' # (provided enough space is available) lvcreate -l 400 /dev/vgname # creates a logical volume lvolN (N is an ordinal automatically assigned) on volume group # vgname newfs -F vxfs -o largefiles /dev/vgname/rlvol0 # to format logical volume /dev/vgname/lvol0 with vxfs - note 'rvol0': the character # device should be specified /dev/vgname/lvol0 /mountdir vxfs delaylog 0 0 # add this line to /etc/fstab so that the filesystem on /dev/vgname/lvol0 will be # mounted automatically on each reboot mount -a # mount all filesystems specified on /etc/fstab which aren't mounted or mount -t vxfs /dev/vgname/lvol0 /mountdir # to mount the new filesystem on a specified directory # Resize a filesystem (online when extending - to shrink it should be unmounted) vgdisplay vgname # check lines 'PE Size' and 'Free PE', it's the space available vgextend -g PVGSTO /dev/vgname /dev/disk/disk176 # if needed add more physical volumes to the volume group lvextend -l 800 /dev/vgname/lvol0 # assuming that pe size is 256MB, extend /dev/vgname/lvol0 to 20 GB lvextend -l 800 /dev/vgname/lvol0 /dev/PVGSTO1 # extends /dev/vgname/lvol0 to 20GB using physical volume group 'PVGSTO1' fsadm -b 20480M /mountdir # resizes the filesystem mounted on /mountdir to 20 GB Enjoy!

No comments:

Post a Comment