Wednesday, April 22, 2009

AIX - Reduce Volume Group

Reduce VG

We can remove the VG using reducevg command, if we want remove testvg and testvg has one pv hdisk9

#lsvg –p testvg
Hdisk9
#

Now we will remove the pv from testvg

#reducevg –f testvg hdisk9

f- option is used to force reduce, you have data in pv hdisk9, that time I will not any questions, directly it will remove the pv from testvg. Suppose 2 PV’s available in testvg then one by one we can reduce the PV’s

AIX -Extend Volume Group

AIX -Extend Volume Group

Extend VG

We can increase VG size by adding Pv into existing VG, example: extendvg command

#lsvg –p datavg
Hdisk4
Hdisk5
#
datavg has 2 PV’s now we want to extend datavg, then your command will be

#extendvg datavg hdisk6

After executed command hdisk6 pv added with datavg

#lsvg –l datavg
Hdisk4
Hdisk5
Hdisk6

AIX - List Volume Group

AIX - List Volume Group

List VG

We can list VG information using following commands

#lsvg – It will display the available vg’s
#lsvg datavg – It will display full details about datavg only
#lsvg –o It will display the online vg’s
#lsvg – l datavg – It will display the all logical volume details across the datavg
#lsvg –p datavg – It will display the information about all PV’s in datavg

Above operations can be performed by using lsvg commands

AIX - Create Voulme Group

AIX - Create Voulme Group

We can create VG by using mkvg commands

#mkvg –s 32 –y datavg hdisk4

The above command is creating datavg using pv hdisk4 and pp size is 32MB

#mkvg datavg hdisk4

The above command will create datavg using pv hdisk4 and pp size is by default 128MB.

Tuesday, April 21, 2009

AIX - LVM - Change Physical Volumes

AIX - LVM - Change Physical Volumes

If we have three PV’s, like hdisk0, hdisk1, hdisk2, now you want to deactivate the hdisk2,

#chpv -vr hdisk2 (To deactivate the hdisk2)
#chpv –va hdisk2 (To activate the hdisk2)
#chpv –an hdisk2 (hdisk2 is not allocatable)
#chpv –ay hdisk2 (hdisk2 is allocatable)
#chpv –hn hdisk2 (hotspare no)
#chpv –hy hdisk2 (Hotspare yes)
#chpv –c hdisk2 (To clear the boot image)

AIX - LVM - List Physical Volumes

AIX - LVM - List Physical Volumes

If we want to know how many PV’s available in server, The following command is list the Pv’s

#lspv

Hdisk0
Hdisk1
Hdisk2
#
The above command is used to display the pv availability

If you want to see particular PV information then your command will be

#lspv hdisk1

After executing lspv command it will display the hdisk2 PV information. All the information, like pp size, used pp’s, free pp, allocatable, hotspare etc.

If we want to see logical volumes details in single hdisk2 PV then your command will be

#lspv –l hdisk2

The above command is used to display all the LV details across the PV hdisk2

If we want to see pp storage information in hdisk2, then your command will be

#lspv –p hdisk2

The above command is display the pp usage information across the PV hdisk2

AIX - LVM (Logical Volume Manager)

AIX - LVM (Logical Volume Manager)


In AIX first Physical volumes (PV) are added into volume group(VG),
After that only we can create logical volumes, and file systems.

Minimum one PV is belongs to VG, While creating the VG we should mention physical partition (pp) size, this pp’s pointed to logical portions (LP),

Suppose we have 40GB HDD, we have added in one VG named DataVG , While creating the VG we should mention the pp size, i.e.

PP size will be 4MB to 128MB, suppose we are mentioned pp size is 32MB, then that 40GB HDD divided into


1024MB *40 = 40960MB

Each pp size is 32MB, then 40GB HDD spited into i.e.

40960 / 32 = 1280 PP’s

So DATAVG has 1280 PP’s

While creating the Logical volumes we should mention the lv size by giving the no of pp

Suppose you want to create one file system /userdata, that file system size will be 1GB, this file system is belongs to one particular LV, So while creating the LV we should mention the lv size is 1GB, but directly we cannot mention the GB size.

Each pp has 32MB, So you create LV with 315 PP’s, then that lv size will be 1GB.

After creating the LV using 1GB space we can increase LV size online, reboot is not required.

We can perform the following operation in LVM.

1. List PV
2. Change PV
3. Create VG
4. List VG
5. Extend VG
6. Reduce VG
7. Varryon VG
8. Varryoff VG
9. Create LV
10. List LV
11. Extend LV
12. Change LV
13. Create LV copy
14. Remove LV copy
15. Remove LV
16. Create FS
17. Change FS
18. List Fs
19. Mount FS
20. Unmount FS
21. Remove FS
22. Repair FS
23. Mirror VG
24. Syncvg
25. Unmirror VG
26. Migrate PV
27. Migrate LV
28. Export VG
29. Import VG
30. Change VG

NOTE:

After AIX installation by default root volume group (rootvg) will be available

Monday, April 20, 2009

AIX - Device Management

AIX- Device Management

In this device management, we can do following things.

1. Make/Add a Device
2. Change Device
3. List Device
4. Remove Device
5. List Device properties
6. List Device configuration


1. Make/Add a Device

We want to install new device in server, this case we should run following command
Suppose we want to install new Hard disk

#smitty mkdev (not recommended)

After executing the above command, one sort will come; in this sort we should fill some details about hard disk drive, such as model, make, capacity, etc.

The above command is not recommended because first we should know all the details about HDD, so instead of that we can use cfgmgr command.

When we run the cfgmgr command it will detect all the newly installed devices,

First you connect hard disk and run the cfgmgr command it will detect the hdd.

#cfgmgr (It will detect the all the devices)

#cfgmgr scsi0

Directly you want to detect hard disk then directly u should check the hdd parent device scsi0

When you run the above command it will detect only Scsi0 devices i.e. HDD, Cdrom, and Tape.

Like this we can configure newly installed devices.


2. Change Device

Suppose we want to change device configuration, this case we should run following command.

We want to change PVID (Physical volume ID) for Hdd

#chdev –l hdisk0 –a pv=clear (To clear the PVID)
#chdev –l hdisk0 –a pv=yes (To assign the PVID)

Whenever we installing the new hdd, system will generate some Identification number for hdd, we can change this PVID using chdev commands

Like this we can change duplex mode for network card and block size for tape media.

#chdev –l inet0 –a hostname=si (To change the host name for inet0)

#chdev –l rmt0 –a block_size=512 (To Change tape drive block_size is 512 blocks)

#chdev –l ent0 –a media_speed=100_full_duplex (To Change Ethernet card duplex speed)



3. List Device

Suppose we want to list device configuration details, this case se should run following command.

Whenever we list the device information that information is listed from ODM because ODM is storing the device information.

#lsdev –C (To list the Customized device configuration information from ODM)
#lsdev – P (To list the Predefined device configuration information from ODM)

The above commands list the object class device information; it will list all the device information.



Suppose we want to see particular device (object) information,

#lsdev –Cc disk
#lsdev –Cc processor
#lsdev –Cc adapter
#lsdev –Cc memory

C – Customized (object class)
c – for device (object)

If any confusion please refer the ODM notes


4. Remove Device

Suppose you want to remove device from server. Suppose it is one HDD.

First you have removed the HDD from server. Then you checking device configuration details using

#lsdev –Cc disk

Or

#odmget CuDv

It will show the device status

There is two options is available in device removal

#rmdev –dl hdisk5

The above command is used to remove hdisk5 device from ODM (complete removal from OS)

After executing the above command this hdisk5 configuration is not available in ODM

#odmget CuDv | grep hdisk5

It wont display anything because device configuration is removed from ODM

Suppose you want to remove device from the server not from ODM
This case you should use the following command.

#rmdev –l hdisk5

The above command is used to remove hdisk5 device from server, this device configuration is available in ODM (not from OS)

After executing the above command this hdisk5 configuration is available in ODM and device status is defined

#odmget CuDv | grep hdisk5

It will show Hdisk5 configuration details but device status is 0


If you want install hdisk5 device again, you should run the following command

#cfgmgr

#cfgmgr scsi0 (Directly you can search device on Parent device scsi0)

After executing above commands the device hdisk5 become to Available state.
And device status is 1

5. List device Properties (attributes)


Suppose you want to check the device attributes details, you should use following commands.


You want to see memory details,

#lsattr –El mem0 (For memory)
#lsattr –El processor0 (For processor)
#lsattr –El ent0 (For Ethernet card)
#lsattr –El rmt0 (For Tape drive)

E – Effective
l - Device
Like this all the devices.


6. List device Configuration


Suppose you want to check the device configuration details, you should use following commands.

Suppose you want to see HDD FRU number

#lscfg (it will show full system information)

#lscfg –vl hdisk0 (It will show HDD configuration details FRU)
#lscfg –vl eth0 (It will so MAC address details of eth0)

Like this all the devices.

NOTE:
#bindprocessor –q (It will show processor information)

Suppose you are using backup device, currently connected and configured with server.

First you switch on the server, at this time tape driver is not switched on. While booting the server, it is checking the tape drive, but tape is now powered on so tape drive is moved to defined state, status will be 0, Now tape drive is switched on now we want to activate the tape drive, we can activate the tape drive without rebooting the server using
#mkdev –l rmt0 (After executing the command tape drive is come to available state)

AIX - ODM (Object Data Manager)

AIX - ODM (Object Data Manager)


ODM generally used for Maintain the System information, whenever we install and reconfigure the hardware device and software, that information’s added in ODM,

Mainly ODM used to store the following information’s

1. Hardware vital product data information
2. Software information
3. Smit menu
4. Nim
5. TCPIP
6. Error log
1. Device configuration information
2. Display information for SMIT (menus, selectors, and dialogs)
3. Vital product data for installation and update procedures
4. Communications configuration information
5. System resource information.
But we cannot see any ODM information in file format, but this ODM information available in many files and different path,
1. /etc/objrepos
2. /usr/lib/objrepos
3. /usr/share/lib/objrepos
NOTE:
For ODM some variable entry available in /etc/environment file.U should not edit anything in this file. If you want to check the variable entry using command
#env
The above command is used to display the variable details
ODM has two kinds of Databases
1. Pre-defined (PdDv)
2. Customized(CuDv)


1. Predefined
In this predefined Database has one Object class (PdDv) and Objects i.e.
PdDv (Object class)
Object: (Physical Information’s)
Floppy drive
Harddisk drive
Mouse like this all the devices.


2. Customized

In this customized Database has one Object class (CuDv) and Objects i.e.

CuDv (Object class)

Objects: (Installed configuration information’s)

Hdisk0
Hdisk1
Fd0
Sa0
Rmt0
Cd0
Scsi0 like this all the devices

ODM States:

ODM has two states

1. Available (device status will be 1)
2. Defined (device status will be 0)

Suppose we are installing one HDD in server. That device is currently accessible this is available state.

Suppose that installed device is removed from server or hdd has failed. This case that device is moved to defined state. i.e. that device configuration is available in server but currently device is not accessible.

We can see this available and defined device status using odmget command

#odmget CuDv ( It will display the customized device status)




ODM Commands:

For object:

1. odmadd
2. odmchange
3. odmget
4. odmdelete

1. odmadd

The above command is used to manually we can add object information in ODM

2. odmchange

The above command is used to change configurations for object in ODM
3. odmget

#odmget –q name=hdisk0 CuDv

The above command is used to display the specified object hdisk0 information in ODM

We can see this available and defined device status using odmget command

#odmget CuDv (It will display the customized device status)


4. odmdelete

#odmdelete –o CuDv –q name=hdisk0
The above command is used to delete the specified object hdisk0 in ODMe

For object class:

1. odmcreate
2. odmdrop
3. odmshow




1. odmcreate

The above command is used to manually we can add object class (PdDv) in ODM

2. odmdrop

The above command is used to stop the specified Object class in ODM
3. odmshow
The above command is used to display the specified object class in ODM

NOTE:
You should not add, delete, change, for object and object class in ODM
(100 % we don’t have permissions for ODM)

Sunday, April 19, 2009

AIX - Fix Maintenance

AIX - Fix Maintenance


In this fix update we can do following things

1. Fix installation
2. To verify the installed fix
3. To list the fixes from the CD


1. Fix Installation

Fix is a just like patch, if any issues on server, we should install or update that fix level then only problem will solved,

Problems like, slow performance, particular application is not working properly. This case of problems we should update the fix.

Suppose we want to install fix, Using

#instfix –k Fixname –d device

#instfix – k IK00891 –d /dev/cd0

-k - Keyword to mention the fix name
-d - Device to mention device name

The above command is used to install the given fix IK00891 from cdrom drive.


2. To verify the installed fix

Suppose we want to verify installed fix,

Using #instfix –ki fixname

#instfix –ki IK00891

Option –i for information

The above command is used to display the given fix details. If fix is not available some error message will come.



3. To list the fix from the CD

Suppose we have fix update CD, we want to install particular two fix in server, this first we should find that 2 fixes are available in CD or not available.

Using

#instfix –T fixname –d /dev/cd0

#instfix –T IK00891 –d /dev/cd0

T - Displays the entire list of fixes present on the media.

If fix is available in CD, then it will display the given fix name otherwise it wont display anything or some error message will come.


NOTE:

Whenever we installing the fileset or fix, in that current path should have the .toc (table of content) file. If this files not available we cannot install any fileset or fix from that current path

If file is not available, we can create the .toc file using command
#inutoc .

The above command is used to create the .toc file