2016年7月1日 星期五

HPUNIX LVM

LVM Commands


  strings /etc/lvmtab       - lists existing VG
  vgdisplay        - lists existing VG
  vgdisplay -v        - lists existing VG, LV, PV
  lvlnboot -v        - lists boot definitions
  vgdisplay -v /dev/vg00      - lists info about VG & LVs belonging here
  lvdisplay -v /dev/vg00/lvol1      - lists info about LV
  pvdisplay (-v) /dev/dsk/c0t5d0     - lists physical volume
  swapinfo -t        - lists swap
  vgcfgbackup vg01       - creates a backup copy of the LVM configuration
  vgexport -v -p -s -m /tmp/vg01.map vg01    - exports VG vg01 definitions
  vgimport -v -s -m /tmp/vg01.map vg01     - imports VG vg01 definitions
  vgchange -a r vg01       - changes VG to read-only




New VG Creation


mkdir /dev/vg01 - creates VG directory mknod /dev/vg01/group c 64 0x010000 - creates VG control file (always called "group") pvcreate [ -f ] /dev/rdsk/c_t_d0 - prepares the disks for LVM vgcreate /dev/vg01 /dev/dsk/c_t_d0 - creates the VG

LV, FS, Mirroring


lvcreate -L 100 -n lvname /dev/vg01 - creates a 100M LV in VG vg01 lvextend -m 1 /dev/vg01/lvname - creates a mirror of the LV newfs -F vxfs /dev/vg01/rlvname - creates a journaled FS in the LV mkdir /lvname_dir - creates a mount point for new FS mount -F vxfs /dev/vg01/lvname /lvname_dir - mounts a FS to the mount point dir mount -F vxfs -o ro /dev/vg01/lvname /lvname_dir - mounts a FS to the mount point dir - read-only primary VG - /dev/vg00 LVs of VG - /dev/vg00/* vgcreate /dev/vg01 (/dev/dsk/c...) - creates VG (on which PVs) vgextend /dev/vg01 /dev/dsk/c... - extends VG by other PV pvcreate -f /dev/rdsk/c7t6d0 - creates physical volume lvcreate -n lvol1 /dev/vg01 - creates LV lvol1 in VG vg01 lvcreate -i 2 -I 16 -l 20 -n lvol1 /dev/vg01 - creates a stripped LV with 80MB size (2 stripes => 20+20*2) lvcreate -m 1 -n lvol1 /dev/vg01 /dev/dskc7t6d0 /dev/dsk/c0t5d0 - creates a mirrored LV lvcreate -m 1 -L 200 -m 2 -L 300 -n lvol1 /dev/vg01 /dev/dsk... - creates a mirrored LV with specific mirror sizes lvextend -l 1 /dev/vg01/lvol1 - extends LV by 1 PE (ph. extent) lvextend -L 100 /dev/vg01/lvol1 - extends LV by 100 MB lvremove /dev/vg01/lvol1 - removes LV newfs /dev/vg01/rlvol1 - creates a new FS on LV lvol1 mkfs -F vxfs -o largefiles /dev/vg01/rlvol1 - creates a new FS with large files support extendfs -F vxfs /dev/vg01/lvol1 - extends a FS size to max of LV fsadm -F vxfs -b 50000 /mnt/myfs - modifies a size of FS to 50MB lvreduce -l 1 /dev/vg01/lvol1 - decreases LV lvol1 by 1 PE pvremove /dev/dsk/c... - removes a physical volume pvmove -n /dev/vg01/lvol1 /dev/dsk/c7t6d0 /dev/dsk/c0t5d0 - moves the PV to another vgreduce vg01 /dev/dsk/c7t6d0 - remove PV from VG vgcfgrestore -n /dev/vg00 /dev/rdsk/c0t7d0 - restores LVM configuration for the physical volume vgremove vg01 - removes VG


ioscan -funC disk|grep HSV450

rmsf -H 0/0/6/1/0.11.0.0.0.1

ioscan -m lun| grep HSV450

rmsf -H 64000/0xfa00/0x4

ioscan -funC disk |grep NO_HW

rmsf -H 64000/0xfa00/0x5f


ioscan -n  dsf 

strings /etc/lvmtab