Sunday, July 26, 2009

Device Management in AIX


DEVICE MANAGEMENT IN AIX



In order to attach peripherals such as terminals and printers to an AIX system, we must tell AIX the characteristics of these devices so that the operating system can send the correct signals to the adapter to which the device is connected. A number of pieces of hardware and software must interact correctly for the device to function correctly.

1) Physical Devices -
Actual hardware that is connected in some way to the system.
2) Ports -
The physical connectors/adapters in the system where physical devices are attached. Most ports are programmable by the system software to allow attachment of many different types of devices.
3) Device Drivers -
Software in the kernel that controls the activity on a port and the format of the data that is sent to the device.
Eg: /dev/hdisk0 = device driver of hard disk 0
4) Logical Devices -
Software interfaces (special files) that present a means of accessing a physical device to the users and application programs. Data read from logical devices will be read from the appropriate device driver.
Eg: /dev/datalv = logical volume for data
5) /dev -
The directory which contains all of the logical devices that can be directly accessed by the user. (Some of the logical devices defined are only referenced in the ODM customized database and cannot be accessed by users.)


Listing of /dev directory
#ls -l /dev

The ls -l command allows you to see the type of a file. A special file (in the /dev directory) will be indicated by a b in the first column for a block device or a c for a character device.

b = Block device is a structured random access device. Buffering is used to provide a
block-at-a-time method of access. Usually only disk file systems.

Eg: cd0 CD-ROM
hdisk0 Physical Volume

c = Character (raw) device is a sequential, stream-oriented device which provides no buffering.
Eg: console, lft, tty0 Terminal
rhdisk0 Physical Volume

Most block devices also have an equivalent character device. For example, /dev/hd1 provides buffered access to a logical volume whereas /dev/rhd1 provides raw access to the same logical volume.Normally the fifth field contains a numeric value indicating the number of bytes in the file. For devices, it shows the major and minor device numbers. The device rmt0 shown in the listing has a major device number of 22 and a minor device number of 1. This indicates that the code to handle major device 22 must already be in the kernel, and it must handle device number 1 correctly. Clearly, the major number refers to the software section of code in the kernel which handles that type of device, and the minor number to the particular device of that type or the operation mode of a device of that type.




ODM - Object Data Manager




Device Configuration Database



1) Pre-Defined Configuration Databse
2) Customized Configuration Databcse




The predefined and customized databases store information about all of the logical devices in the system and their attributes managed by the ODM (Object Data Manager).

The predefined database contains configuration data for all possible devices supported by the system. The SMIT menus have options to install non-supported drivers. The contents of the predefined database is largely defined at installation time, ensuring that you always have support for devices in your system.

The customized database contains configuration data for all currently defined and configured (available) devices.

cfgmgr

The Configuration Manager is a program that automatically configures devices on your system during system boot and run time. The Configuration Manager uses the information from the predefined and customized databases during this process, and updates the customized database afterwards.



List all supported Devices



PdDv = pre-defined Database



#lsdev -P -H
or
smit devices -> List Devices -> List All Supported Devices

Devices are classified by Class, Type and Subclass where Class indicates what the device does, Type indicates what model it is and Subclass indicates how it can be attached to the system.To find out what devices are listed in the predefined database, use the SMIT option List All Supported Devices which runs the command lsdev -P. To find out the attributes of a predefined device, use the SMIT option Show Characteristics of a Supported Device which runs the command lsattr -D
The -P option pulls information from the predefined database in the ODM.
The -H option shows the headers for the output.
The -c option specifies the class of device.




List all Defined Devices



#lsdev -C -H


The devices that have been customized in the system are described in the ODM
customized database. Each device has a logical device name, a status, a location and various attributes.The lsdev -CH command provides information on the resource name, its status (or state), the address or location, and a brief description of all devices in the customized database.


Available: The device is ready and can be used
Defined: The device is unavailable
Devices may appear in a defined state after a restart. If this is the case, it may be due to the fact that the device is powered off or the fact that the device no longer exists on the system.
Devices with a location code are physical devices. Devices without a location code are logical devices.
#lsattr -EH -l sys0
The lsattr -E -l [resource name] command provides detailed information on the effective attributes currently configured for specified devices. In the example, it provides configuration information on the system itself.
The -C option for lsdev pulls the customized information from the ODM.
The -E option for lsattr shows the effective attributes.
The -l option for both commands is the logical device name.
The -c option for both commands is the class of device.
The -a attribute option for the lsattr command displays information for a specific attribute.
Eg: #lsattr -E -l sys0 -a realmem
lscfg
Another command that can be used to list information about devices found in the ODM customized database is lscfg -v. The listing is sorted by parent, child and device location. Specific hardware information about devices will be listed such as EC level, FRU number, part number, and so forth. The output also displays the model architecture and bus type.
DEVICE STATES













The Most Common Device States are:-
Undefined -
The device is a supported device but is not configured. It does not reside in the customized database.
Defined -
The device has been added to the customized database. It has been allocated a logical device name, a location code and attributes have been assigned to it. But, it is still unavailable for use.
Available -
The device resides in the customized database. The device is fully configured and is ready for use.
When a device is first identified, it is configured and put into the Available state. If a device that has been configured in the past is powered off and the machine is rebooted, the device will appear in the Defined state. This indicates that the system knows it is supposed to be there, but because it was not powered on, it cannot be used. You can control the device states by using smit or the commands mkdev and rmdev.
To put a defined tape into an available state , in the smit devices area, use Configure a Defined Tape Device or #mkdev -l rmt0
To move an available tape device to defined , In the smit devices area, use Remove a Tape Device and set Delete from Database to no or #rmdev -l rmt0
To permanently remove an available or define tape device , In the smit devices area, use Remove a Tape Device and set Delete from Database to yes or #rmdev -dl rmt0
Remember, most Defined devices are the result of not powering on the device before booting. Or, it could be the device was physically removed, but you never ran rmdev -dl xxxx to remove the device from the ODM.

1 comment:

  1. Iam new to AIX and find this very useful...
    Great description Praveen.... Please keep updating new topics...

    ReplyDelete