Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Sunday 5 January 2014

Exercise on LVM

 

This section will contain 3 section on various topics which we have cover in LVM blog. It will contain questions along with there command  in blue color.It will be step by step process so that you can easily understand the concept.  Hope this will be fruitful for new commers who want to learn AIX.    
                                                             ......Happy Learning........

Section 1 : Creating and Modifying Volume Groups 

  • Create a new Original volume group on hdisk2 called OrigVg
    • mkvg -y OrigVg hdisk2     or   mkvg -fy OrigVg hdisk2
  • Add free disk, hdisk1 into rootvg and hdisk3 into OrigVg
    • extendvg rootvg hdisk1     or  extendvg -f rootvg hdisk1
    • extendvg OrigVg hdisk3   or   extendvg -f  OrigVg hdisk3
  • Check that hdisk1 is associated with rootvg and hdisk3 is associated with OrigVg
    • lsvg -p rootvg                  or    lspv
    • lsvg -p OrigVg                 or   lspv
  • Remove the disk hdisk3 from OrigVg 
    • reducevg OrigVg hdisk3
  • Verify that disk is no longer associated with OrigVg
    • lsvg -p OrigVg 
  • We will now transfer of the OrigVg physical volume to another system. Deactivate OrigVg and then remove knowledge of the volume group from the ODM.
    • lsvg -o                             (the OrigVg should be in the list) (Show all the active VG)
    • varyoffv OrigVg               (Deactivate the VG)
    • lsvg -o                             (the OrigVg should not be in the list)
    • lsvg                                  (the OrigVg should be in the list)
    • exportvg OrigVg              (Remove the entry from ODM)
    • lspv                                  (the OrigVg should not be in the list)
  • Reimport and activate the volume group. Assign the OrigVg volume group name.
    • importvg  -y  OrigVg hdisk2     (It will reimport and activate Vg)
    • lspv                                          ( To see the physical volume)
    • lsvg -o
  • Convert and rename OrigVg as follows:
    • Type: OrigVg to Scalable
    • Name: OrigVg to ScaleVg
    • **The Volume Group must be deactivated before doing the above operation
      • varyoffvg OrigVg
      • chvg -G OrigVg    and answer yes to convert
      • exportvg OrigVg
      • importvg -y ScaleVg hdisk2

Section 2 : Creating and manipulating logical volume

  • Extend ScaleVg to include disk hdisk3 and hdisk4
    • extendvg  ScaleVg hdsk3 hdisk4
  • Add a logical volume to Scalevg with Name= datalv1, No of copies=1, Type=jfs2, Size=10 Lps
    • mklv -y datalv1 -t jfs2 -c 1 ScaleVg 10
  • Increase the size of datalv1 by 10 LPs
    • extendlv datalv1 10
  • Create a mirror copy of datalv1 on hdisk3. Ensure that LP copies will be synchronized
    • mklvcopy -k datalv1 2 hdisk3
    • lslv datalv1                   ->We will see that ration of LP:PP is 1:2
  • On ScaleVg, create striped (RAID 0) logical volume name Striplv.  It should be done across all the three disk   volume group.  Type=jfs2, Size=24LPs, Stripe Size=64K
    • mklv -y stripelv -t jfs2 -S64K Scalelv 2 hdisk2 hdisk3 hdisk4
  • Check the number of PPs created on all the three disk.
    • lslv -l striplv                      (It will show 8 PPs on each disk)
  • Check the LPs in striplv
    • lslv -m stripelv                   ( shows that the LPs are distributed)
    • lslv striplv                          (shows the stripe size and stripe width)
  • Delete logical volue , striplv
    • rmlv striplv
  • Add another LV to ScaleVg on hdisk4 with Name=datalv2, Type=jfs2, Size=10LPs
    • mklv -y datalv2 -t jfs2 ScaleVg 10 hdisk4
  • Migrate the LV datalv2 to hdisk2
    • lslv -l datalv2                                         (It will show datalv2 on hdisk4)
    • migratepv -l datalv2 hdisk4 hdisk2
    • lslv -l datalv2                                         (It will show datalv2 on hdisk2)
  • Reduce the ScaleVg to not include hdisk4
    • reducevg ScaleVg hdisk4

Section 3: Mirroring rootvg

  • Mirror the rootvg on hdisk1
    • extendvg rootvg hdisk1                (Add the hdisk1 to rootvg before mirroring)
    • mirrorvg rootvg hdisk1
    • syncvg -v rootvg                          (For synchronization)
  • Create a boot image on hdisk1
    • bosboot -ad /dev/hdisk1
  • Update the normal bootlist to include hdisk1
    • bootlist -m normal hdisk0 hdisk1
  • Unmirror the rootvg
    • unmirrorvg rootvg hdisk1


 

No comments:

Post a Comment