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.

Thursday, 31 October 2013

Logical Volume in LVM: Interview Questions in Linux..



Display:

#lvdisplay -v lvname

#lvs

To view mirror volumes

#lvs -a -o +devices
#lvs -a -o +seg_pe_ranges --segments

lvs attributes are:

1. volume type: (m)irrored, (M)irrored without initail sync, (o)rigin, (p)vmove, (s)napshot, invalid (S)napshot, (v)irtual, mirror (i)mage
                      mirror (I)mage out-of-sync, under (c)onversion
2. permissions: (w)rite, (r)ead-only
3. allocation policy - (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited
4. fixed (m)inor
5. state: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, mapped (d)evice present with-out tables,
             mapped device present with (i)nactive table
6. device (o)pen (mounted in other words) 

Scan: 

#lvscan -v
#lvmdiskscan




Create / Extend / Reduce / Remove:

Create a Lvol

#lvcreate -L 10M -n lvol1 VGNAME  // To create plain lvol

#lvcreate -i 3 -I 32 -L 24M -n lvol1 vg01  //To create striped lvol

#lvcreate -L 10M -m1 -n lvol1 vg01  // To Create mirror lvol

Extend a Lvol 

#lvextend -L 20M /dev/VolData00/lvol01 

#fsadm resize /dev/VolData01/data01
#resize2fs -p /dev/mapper/VolData01-data01 [size] 

Reduce Lvol

#lvreduce -L 5M /dev/VolData00/lvol01 (or)
#lvresize -L 5M /dev/VolData00/lvol01

#fsadm resize /dev/VolData01/data01 [size]
#resize2fs -p /dev/mapper/VolData01-data01 [size] 


Rename / Snapshot / change attribute 


# lvrename /dev/VolData00/vol_old /dev/VolData00/vol_new    //Rename

# lvcreate --size 100M --snapshot -name snap /dev/vg01/data01    //Snapshot

#lvchange -a n /dev/VolData00/vol01   //Changing attribute

No comments:

Post a Comment