Sunday, January 1, 2012


LVM
Components of LVM
  1.  Volume group (VG)
  2.   Physical Volume (PV)
  3.   Logical volume (LV)
  4.   Physical Partition (PP)
  5.   Logical Partition (LP)
  6.    Volume Group Descriptor Area (VGDA)
  7.    Volume Group Status Area (VGSA)
  8.    Logical Volume Control Block (LVCB)
  9.   File system (FS)
  10.   Mount Point
Maximum # PP/disk à 1016
VG Type

VG type
Maximum PVs
Maximum LVs
Maximum PPs per VG
Maximum PP size
Normal VG
32
256
32,512 (1016 * 32)
1 GB
Big VG
128
512
130,048 (1016 * 128)
1 GB
Scalable VG
1024
4096
2,097,152
128 GB

Default PP for big vg :-  32MB
Default max LV :- 256

Pbuf == control the pending disk IO(primary memory buffer)

# lvmo -a
vgname = rootvg
pv_pbuf_count = 512 ==> buffer value of per pv in vg
total_vg_pbufs = 1024
max_vg_pbufs = 16384
pervg_blocked_io_count = 4997572
pv_min_pbuf = 512
max_vg_pbuf_count = 0
global_blocked_io_count = 5325214
#

LTG(Logical track group)==> variable stands Maximum an IO request for LV 

To check the value of LTG
# lquerypv -M hdisk0
256
#
Or
#lspv hdisk0
PHYSICAL VOLUME:    hdisk0                   VOLUME GROUP:     rootvg
PV IDENTIFIER:      0002cb8982c3200a VG IDENTIFIER     0002cb890000d6000000011c4ef65807
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            256 megabyte(s)          LOGICAL VOLUMES:  13
TOTAL PPs:          546 (139776 megabytes)   VG DESCRIPTORS:   2
FREE PPs:           414 (105984 megabytes)   HOT SPARE:        no
USED PPs:           132 (33792 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  109..67..20..109..109
USED DISTRIBUTION:  01..42..89..00..00
MIRROR POOL:        None
#
Or
#lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  0002cb890000d6000000011c4ef65807
VG STATE:           active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1092 (279552 megabytes)
MAX LVs:            256                      FREE PPs:       840 (215040 megabytes)
LVs:                13                       USED PPs:       252 (64512 megabytes)
OPEN LVs:           12                       QUORUM:         1 (Disabled)
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         2                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
PV RESTRICTION:     none
#

To change the LTG value using below command for a vg
#varyonvg –M512K testvg

GLVM (Geographic Logical Volume Manger)
It extend the LVM mirroring across the Site using TCP/IP networking.


Creating Normal VG
# mkvg -s 512 -v 1024 -y newvg hdisk2
Creating Big VG
# mkvg –B –s 512  -y newvg hdisk2
Creating the Scalable VG
# mkvg –S –s 1024 –y newvg hdisk2

Creating the concurrent VG for HACMP
It has to create in HACMP ES using –C option it will support only enhanced concurrent vg only support 64bit kernel, concurrent will support 32 bit kernel

Types of LV
1. Jfs
2. jfslog
3. jfs2
4. jfs2log
5. paging
6. boot
7. sysdump
8. aio_cache

Default type ==> jfs
Default max lp ==> 512
Default scheduling policy ==> parallel
Default position ==> middle
Default rang of PV ==> minimum
Default stripe value ==> 128M

Create jfs2 LV
# mklv –t jfs2 –x 1000 –y newlv newvg 600 
#chlv –x 2000 testlv ==> To increase the max pp size in lv
# rmlv testlv

File System Type
  1. JFS
  2. Enhanced JFS or JFS2
  3. CD ROM FS
  4. RAM File system
  5. NFS
  6. Name File system(NameFS)
  7. General Parallel File system(GPFS)

Difference between JFS and JFS2 FS

Function
JFS
Enhanced JFS
Optimization
32-bit kernel
64-bit kernel
Maximum file system size
1 terabyte
4 petabytes
Note: This is an architectural limit. AIX® currently only supports up to 16 terabytes.
Maximum file size
64 gigabytes
4 petabytes
Note: This is an architectural limit. AIX currently only supports up to 16 terabytes.
Number of I-nodes
Fixed at file system creation
Dynamic, limited by disk space
Large file support
As mount option
Default
Online defragmentation
Yes
Yes
namefs
Yes
Yes
DMAPI
No
Yes
Compression
Yes
No
Quotas
Yes
Yes
Deferred update
Yes
No
Directory structure  
Linear organization
Binary tree representation
·        The main advantage of using Enhanced JFS over JFS is scaling.
·        Journaling for disable Meta data logging using nonitergrity mount option in JFS it will give more performance than JFS2.
Create jfs2 file system with already created lv
# crfs -v jfs2 -d testlv -A yes -m /testfs
Create jfs2 file sytem without existing lv
# crfs -v jfs2 -g itlogsvg -m /test1fs -a size=1G
Create jfs2 with NFS4 ACL type
# crfs –v jfs2 –g itlogvg –m /test –a size=10G –a ea=v2

Attributes:-
Agblksize=512, 1024, 2048, 4096 ==> 4096 is default.
Cmtype=gc or ac ==> gc reduce the data loss during system crash, ac will give better performance vice versa
Logname=logLVname ==> 
It can be INLINE its default is 0.4% of FS size. And its cannot be more then 2047MB or 10% of FS.
Options=mountoptions
Size=   
fs block size (byte)        MAX fssize (TB)
===========================================
512                                         4
1024                                       8
2048                                      16
4096                                       32
ea= (v1 or v2) ==> v1 is default and compatible with prior version of AIX.
                           v2 is support of scalable named as well as support for NFS4 ACLs.

# rmfs /test1fs à it will also remove the LV

#extendvg testvg hdisk10 ==>  To increase the vg
#chfs –a size=+10G /testfs ==> To adding the space (-) for reduce

Mount
# mount –a or # mount all ==> To mount all file systems
# umount /test or unmounts /test ==> Te unmounts the file system
# mount host1:/test /test1 ==> to mount nfs file system
# mount –v cdrfs –o ro /dev/cd0  /mnt ==> mount the cd rom
# umount –f /test ==> force unmounts
# fuser –kuc /test ==> to check the FS using process
# fuser –kucx /test ==> to kill the Fs using process
# mount –o ro /test ==> mount as read only

Mirroring rootvg
  1.  # extendvg rootvg hdisk1
  2.  # mirrorvg rootvg
  3.  # bootlist –o –m normal ==> to check the boot order
  4.  # bootlist –m normal   hdisk0 hdisk1 ==> recreate the boot order
  5.  # bosboot –ad hdisk0
  6.  # bosboot –ad hdisk1

Replace the failed HDD in Mirrored rootvg
  1.  # unmirrorvg rootvg hdisk1
  2.  # mirgrate hdisk1 hdisk0 ==> if having any  issues
  3.  # reducevg rootvg hdisk1
  4.  # rmdev –Rdl hdisk1
  5.  # cfgmgr
  6.  # cfgmgr -v ==> Afger replacing the disk
  7.  # lspv
  8.  Steps of mirroring the rootvg

Creating lv copy
  •  Can make the Copies with the VG only.
  •   Max no.of copies 3
# lslv –m lv01 ==> to check the existing copies of lv
# mklvcopy –k lv01 2 hdisk3 ==> to create the 2 copies and sync
# rmlvcopy lv01 2 ==> to remove the lvcopy
# lquerypv –M hdisk0 (or) # lspv hdisk0 ==> To show the LTG size.
# sync –v datavg ==> to sysn the steal PP

RAM Disk
Default block size is 512 bytes
Max ramdisk 64
To crate the jfs2 ramdisk
# mkramdisk  2G
# /sbin/helpers/jfs2/mkfs –V jfs2 /dev/ramdisk0
# mkdir /ramdisk0
# mount –V jfs2 –o log=NULL /dev/ramdisk0 /ramdisk0

# rmramdisk ramdisk0 ==> To remove the ramdisk
# ls –l /dev|grep ram ==> To check the ramdisk

Dump device
# sysdumpdev –e ==> To check the estimated size of dump
# sysdumpdev –l ==> To check the dump dev status
# mklv –y dumplv –t sysdump rootvg 5 ==> to create the sysdump
# sysdump –p /dev/dumplv ==> To change the primary dump
# sysdump –s /dev/sysdumpnull ==> To change the secondary dump
# sysdump –k ==> To change the always allow dump to TRUE
# sysdump –Pp  /dev/lg_dumplv ==> To change permanently
#  rmlv dumplv ==> To remove system dump

Renaming FS/LV
# umount /testfs ==> Un mount FS
# chfs –m testfs newfs ==> Change the FS name
# chlv   -n newlv oldlv ==> To change the LV name

LVM Management
# defragfs /home ==> To defrag the FS
# lsvg –o ==> list the active vg
# lsvg –l rootvg ==> list the lv in vg and mirror numbers
# chvg –S datavg ==> changing Vg to scalable
# exportvg testvg ==> To remove or export the VG
# importvg –y newvg hdisk2 ==> import or import with new name(rename)

Rootvg LV names à hd1-/home, hd2-/usr, hd3-/tmp, hd4-/ , hd5-boot, hd6-pageing, hd7(lg_dumplv)-dumpdev, hd8-jfs2log, hd9var-/var, hd10opt-/opt.