Wednesday, 25 December 2013

Practical Guide to AIX "Device Management"

Its very critical as AIX admin to manage devices. We are going to discuss in this tech-note device management, we will discuss the following things.


Contents:

1. Make/Add a Device

When ever you need to add a device to AIX OS server,in this case we should run following command
Let us consider we need add new Hard disk.

You  need to run config manager command "cfgmgr",it will detect all the newly attached devices to the server.
Once you run cfgmgr command system will detect the hard disk.
#cfgmgr (It will detect the all the devices)
#cfgmgr -l  fcs1

The above command configures the detected devices attached to the fcs1 adapter
When you run the above command it will detect only fcs1 devices i.e. HDD, Cdrom, and Tape.
you can verify the added disk by using
#lspv or #lscfg | grep -i hdisk

2. Change Device:

Sometimes we may need to change  attributes of the devices,it can be acieved by "chdev" command.
Need to discuss about two options of "chdev"

-P     Changes the device's characteristics permanently in the Customized Devices object class without actually changing the device. This is useful for devices that cannot be made unavailable and cannot be changed while in the available state. The change is made to the database, and the changes are applied to the device when the system is rebooted. This flag cannot be used with the -T flag. Not all devices support the -P flag.

-T  Changes the characteristics of the device temporarily without changing the Customized Devices object class for the current start of the system. This flag cannot be used with the -P flag. Not all devices support the -T flag.

Ex:
We want to change PVID (Physical volume ID) for PV ( physical Volume)
#chdev –l hdisk0 –a pv=clear (To clear the PVID)
#chdev –l hdisk0 –a pv=yes (To assign the PVID)
some more examples
#chdev –l inet0 –a hostname=umlpar (To change the host name)
#chdev -l rmt0 -a ret=yes (To instructs the tape drive to retension a tape automatically whenever a tape is inserted. )
#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 hdisk1

The above command is used to remove hdisk1 device from ODM (complete removal from OS)
After executing the above command this hdisk1 configuration is not available in ODM
#odmget CuDv | grep hdisk1

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 hdisk1

The above command is used to remove hdisk1 device from server, this device configuration is available in ODM (not from OS)
After executing the above command this hdisk1 configuration is available in ODM and device status is defined
#odmget CuDv | grep hdisk1

It will show hdisk1 configuration details but device status is 0
If you want install hdisk1 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 hdisk1 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

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)

0 blogger-disqus:

Post a comment