Basic LVM Operations in AIX

Creating VG


Verify new disks

1)   Take the output of lspv before scanning the disk.
#lspv

2) Check for the new disk
For scanning
#cfgmgr -v
Identify the new disk that detected by comparing the old lspv output.

3) Cross verify the LUN Number matching with the given number from Storage
#powermt display dev=<hdiskpower#> |grep -i LUN
Eg:
root@NIMmaster /root # powermt display dev=hdiskpower5 |grep -i LUN
Logical device ID=6006016020672A008820B177987CE011 [LUN 125]

If the disk not displaying under powerpath use following command to identify the Uniq ID, which can be matched from storage end also.

#lscfg -vpl hdiskpower5 |grep -i "(UI)"
Eg:
root@NIMmaster /root # lscfg -vpl hdiskpower5 |grep -i "(UI)"
  Device Specific.(UI)........6006016020672A008820B177987CE011

4) Verify the size of the disk
#bootinfo –s <disk>

If it’s under powerpath use hdiskpower.
Eg:
root@NIMmaster /root # bootinfo -s hdiskpower5
61440

Create VG through command line

To create a volume group (testvg) that contains three physical volumes with partition size set to 128 megabyte, type:
#mkvg -y testvg-s 128 hdisk3 hdisk5 hdisk6

If the system under powerpath, use hdiskpower instead disk names. In powerpath actual disk display as hdiskpower. And associate paths display as hdisks.

Eg:
root@NIMmaster /root # powermt display dev=hdiskpower5
Pseudo name=hdiskpower5    --This is disk name
CLARiiON ID=APM00103801328 [GBWGNA03]
Logical device ID=6006016019422A008820B177987CE011 [LUN 285]
state=alive; policy=BasicFailover; priority=0; queued-IOs=0
Owner: default=SP A, current=SP A
==============================================================================
---------------- Host ---------------   - Stor -   -- I/O Path -  -- Stats ---
###  HW Path                I/O Paths    Interf.   Mode    State  Q-IOs Errors
==============================================================================
   2 fscsi2                    hdisk18   SP A5     active  alive      0      1àThis is I/O path
   2 fscsi2                    hdisk21   SP B4     active  alive      0      0àThis is I/O path

Creating VG using Smitty

Run smitty mkvg to go through vg creation screens


Select Scalable volume group and press enter.
Give VG name and Partition size, Physical volume names.

To list standard physical partition size, enter esc+4. And select required PP size.
To list available disks in the system, enter esc+4. It will display all the disks. Select the new disk and enter. To select multiple disks press esc+7 for each disk and enter.


Once you enter it will ask confirmation. Enter once again. It will display status of VG creation.



Creating LV

Create a LV from commands line

#mklv -y <lvname> -t jfs2 <vgname><no of LPs>hdiskn
Eg:
root@NIMmaster / # mklv -y testlv -t jfs2 testvg 10 hdisk33

Using Smitty



Esc+4 will display sub-screen which display VG names. Select appropriate.


Provide LV name, No.Of LPs, PV names and File system type.
For file system type select jfs2
While providing disk name, if the VG have multiple disks try providing more than one using esc+7 for better performance. Even we can select one also if we have enough free PPs in the disk.


Once you press enter, it will show LV status.


2) Check LV attributes.
#lslv<lvname>

Creating FS

Creating FS from command line

#crfs -v jfs2 -d <lv_name> -m <mount_point> -A yes
Eg:
root@NIMmaster / #crfs -v jfs2 -d testlv -m /testfs1 -A yes

Creating FS using Smitty

Select Enhanced JournaledFS(jfs2) for adding jfs2.


Create FS on Previously defined LV ad we already created LV.


Provide Required data.


FS creation status.





2)      Mounting the file system.
In AIX no need to give any fstab entry. Entries automatically added to /etc/filesystems while creating the FS. So just mounting the FS is enough.
#mount -a

Renaming LV

#chlv -n NewLogicalVolume OldLogicalVolume
Eg: To change testlv name in to samplelv
root@NIMmaster / # chlv -n samplelv testlv

Note: need to umount the file system before renaming the LV.

Renaming FS

#chfs –m newMountPoint oldMountPoint
Eg:
root@NIMmaster / # chfs -m /testfs2 /testfs1

Extending FS

1) If free space is not there..Let the new disk added from SAN.
Follow the steps to scan new disk.

If free space is there go to step 3 directly.

2) Extend VG
#extendvg VolumeGroup PhysicalVolume

Note: If you are using powerpath, should give hdiskpower

3) Extending FS
In AIX no need to extend LV. We can increase filesystem directly.
#chfs –a size=<+ size to add><fsname>
don’t for get to give “+” sign.  If my current file system size is 5GB and we need to make the target file system size to some 10GB, we can directly give “size=10G”. If we need to user “+” then just give “size=+5G” so that it will add 5GB to your FS.

Eg:
root@NIMmaster / # chfs -a size=+1G /testfs2
Filesystem size changed to 4718592

Comments

Popular posts from this blog

Jenkins Dynmaic Parameter - List All Branches in a Git Repository

JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'XYZ' with connection mode 'Client' and host name 'x.x.x.x(1415)'. Please check if the supplied username and password are correct on the QueueManager to which you are connecting.