1. Introduction to device management
Devices in AIX are managed hierarchically.
The top layer is the function category, that is, grouping by the same basic function. For example, all the adapter cards belong to the adapter class.
The next level is the function subclass, which is divided according to more specific properties, such as standard input/output adapter and micro channel adapter. Standard Input/Output adapter belongs to the class of the SiO2 function, the micro-channel adapter is a sub-class of the mca function.
The last level is the type subclass, that is, devices are differentiated by type and manufacturer. For example, there are 8fba standard scsi I/O control cards under the class of the SiO2 function), fda_2 standard I/O disk adapter), and ient_6 built-in Ethernet adapter. In the middle class of the mca function, there is a SiO2 micro channel I/O motherboard) device type.
The following command illustrates the device classification method:
# Lsdev-C-F "class subclass type description" | sort
Adapter buc 4006 GXT150L Graphics Adapter
Adapter mca SiO2 Standard I/O Planar
Adapter sio 8fba Standard scsi I/O Controller
Adapter sio fda_2 Standard I/O Diskette Adapter
Adapter sio ient_6 Integrated Ethernet Adapter
Adapter SiO2 keyboard_2 Keyboard Adapter
Adapter sio mouse Mouse Adapter
Adapter sio ppa Standard I/O Parallel Port Adapter
Adapter sio s1a Standard I/O Serial Port 1
Adapter sio s2a Standard I/O Serial Port 2
Adapter sio tablet_2 Tablet Adapter
Aio node aio Asynchronous I/O
Bus sys mca Microchannel Bus
Cdrom scsi scsd SCSI Multimedia CD-ROM Drive
Disk scsi 2000 mb, 2.0 gb scsi Disk Drive
Diskette siofd fd Diskette Drive
If EN en Standard Ethernet Network Interface
If EN ie3 IEEE 802.3 Ethernet Network Interface
If LO lo Loopback Network Interface
Ioplanar sys ioplanar_2 I/O Planar
Keyboard std_k kb101 United States keyboard
Lft node lft Low Function Terminal Subsystem
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume lvsubclass lvtype Logical volume
Logical_volume vgsubclass vgtype Volume group
Lvm lvdd LVM Device Driver
Memory sys simm 32 MB Memory SIMM
Memory sys simm 32 MB Memory SIMM
Memory sys simm 32 MB Memory SIMM
Memory sys simm 32 MB Memory SIMM
Mouse std_m mse_3b 3 button mouse
Planar sys sysplanar3 System Planar
Processor sys proc1 Processor
Pty Asynchronous Pseudo-Terminal
Rcm node rcm Rendering Context Manager Subsystem
Sys node sys1 System Object
Sysunit sys sysunit System Unit
Tape scsi 8mm5gb 5.0 GB 8mm Tape Drive
Tcpip TCPIP inet Internet Network Extension
The device on the lower layer depends on the device on the upper layer. For example, a device of the 8mm5gb type depends on the SCSI function subclass.
. The layers and dependencies in AIX are stored in the ODM database.
2. Object Database
ODMObject Database Management) refers to the Object-Oriented Database Management, which is responsible for managing and storing system information. The device configuration Database is also under its Management scope. ODM is managed by database> Object Class> Object layer. For example, the device configuration database consists of predefined and customized object classes. Predefined) contains all the device objects supported by AIX, and custom object class customized) contains the actually existing device objects in the system.
1) object class
An object class is a set of objects with the same definition. This definition is similar to the structure definition in C language. The object class is usually stored in the/etc/objrepos object warehouse abbreviation) directory, or the directory specified by the ODMDIR environment variable. For example, if the configuration information of the actually connected device object is saved in the/etc/objrepos/CuDv file, you can use the odmshow command to display its definition.
# Odmshow CuDv
Class CuDv {
Char name [16];
Short status;
Short chgstatus;
Char ddins [16];
Char location [16];
Char parent [16];
Char connwhere [16];
Link PdDv uniquetype PdDvLn [48];
};
Each item in the CuDv object class is a descriptor. When an object is added to the CuDv object class, each descriptor is assigned a value. For example, a SCSI hard disk with a location code 00-00-0S-00 stores the code in the location descriptor.
2) object
An object is a specific item in an object class. Each object has a set of configuration parameters corresponding to the descriptor defined in the object class. For example, to view the objects in the CuDv object class and their corresponding values, enter the following command:
# Odmget CuDv
CuDv:
Name = "hdisk0"
Status = "1"
Chgstatus = "2"
Ddins = "scdisk"
Location = "00-00-0S-00"
Parent = "scsi0"
Connwhere = "00"
PdDvLn = "disk/scsi/1000 mb"
Each row above corresponds to the descriptor defined in the CuDv object class. The last line is very important. It shows the hierarchy of the device. disk is a function class, scsi is a function subclass, and 1000 mb is a type subclass.
3. Add a device command line)
When a device is added or deleted, the ODM modifies the device configuration database. If you use AIX device management commands such as mkdev, rmdev, lsdev, lsattr, and chdev to configure the device, you must be familiar with the device hierarchy and ODM. However, there are two tools that can greatly simplify the work: The systmgr command and SMIT.
The cmdmgr command, that is, the Configuration Manager, can be used to automatically configure devices in the system. This command can also be called at system startup. At runtime, it reads rules from the Config_Rules object class, which is actually some commands used to configure the device, by creating a device file and installing the driver to make the device available. You can use the odmget Config_Rules command to view these rules. Therefore, one method to add a 5 GB 8mm SCSI tape drive is:
1. Host power-off
2. Connect the device
3. device power-on
4. Start the host
During system boot, systmgr automatically identifies the new device and makes it available. If you enter the following command, you can see that the tape drive has been configured:
# Lsdev-C-c tape
Rmt0 Available 00-00-0S-1, 0 5.0 GB 8mm Tape Drive
"Available" is the status of the tape drive. One device can only be in one of three states: undefined, defined, and available. If the tape drive is in the undefined state, it has not been configured by ipvmgr; if it is in the defined State, its configuration data is saved in the User-defined database, but not available yet. Once a defined device is bound to the core, it is in the available status. Rabbitmgr will first make sure that your device is defined and then make it available.
Cfgmgr can also be executed in the command line. If you add a device similar to a tape drive to a running system, you can run the cmdmgr command to make it available. Alternatively, if you have an available device that does not turn on the power when it is started, rabbitmgr will set it to defined state. If you want to make it available, you can power on the device and run the cmdmgr command again.
4. Add a device to SMIT)
Connect the device to the system, turn on the power, and run SMIT to configure it. Enter the smit device in the command line and you will see:
Devices
Move cursor to desired item and press Enter.
Install/Configure Devices Added After IPL
Printer/Plotter
TTY
Asynchronous Adapters
PTY
Console
Fixed Disk
Disk Array
......
......
Select the expected item and press Enter. If you want to add a 8mm drive in this way, select
Choose Tape Drive. The screen output is as follows:
Tape Drive
Move cursor to desired item and press Enter.
List All Defined Tape Drives
List All Supported Tape Drives
Add a Tape Drive
Change/Show Characteristics of a Tape Drive
Remove a Tape Drive
Configure a Defined Tape Drive
Generate Error Report
Trace a Tape Drive
Select Add a Tape Drive. A list of supported tape drives is displayed, which is similar to the following:
Tape Drive Type
Move cursor to desired item and press Enter.
1200mb-c scsi 1.2 GB 1/4-Inch Tape Drive
150 mb scsi 150 MB 1/4-Inch Tape Drive
3490e scsi 3490E Autoloading Tape Drive
48
4mm2gb scsi 2.0 GB 4mm Tape Drive
......
......
This table comes from the predefined device object class. If you want to add a non-ibm scsi Tape Drive, select ostscsi Other SCSI Tape Drive, which is a common SCSI option. In the example, select 8mm5gb scsi5.0 GB 8mm Tape Drive. Then a dialog box asking about the parent card is displayed:
Parent Adapter
Move cursor to desired item and press Enter.
Scsi0 Available 00-00-0S Standard scsi I/O Controller
Select scsi0 Available 00-00-0S Standard scsi I/O Controller.
Finally, you will get the following screen output:
Add a Tape Drive
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[Entry Fields]
Tape Drive type 8mm5gb
Tape Drive interface scsi
Description 5.0 GB 8mm Tape Drive
Parent adapter scsi0
* CONNECTION address [] +
BLOCK size 0 = variable length) [1024] + #
Use device buffers during writes yes +
Use EXTENDED file marks no +
DENSITY setting #1 140 +
DENSITY setting #2 20 +
Use data COMPRESSION yes +
The only entry required here is the CONNECTION address, which is your SCSI address. You can modify other parameters as needed. The advantage of using SMIT to add a device is that you can crop your configuration as needed, while Mgr will add a device based on the default attribute. If the scsi id of the tape drive is set to 6 in this example, you should enter 6 or 0 in the CONNECTIONaddress field. Press Enter. SMIT will call the mkdev command and configure the drive to available.
5. devices not defined by ODM
Predefined object classes support all types of devices, most of which are IBM products. However, there are also common device objects. To view the list of such objects, enter the following command:
# Lsdev-P | grep-I other
Printer osp rs232 Other serial printer
Printer osp rs422 Other serial printer
Printer opp parallel Other parallel printer
Tape ost scsi Other SCSI Tape Drive
Cdrom oscd scsi Other SCSI CD-ROM Drive
Cdrom scsd scsi Other SCSI CD-ROM Drive
Disk osdisk scsi Other SCSI Disk Drive
Disk scsd scsi Other SCSI Disk Drive
Rwoptical osomd scsi Other SCSI Read/Write Optical
Rwoptical scsd scsi Other SCSI Read/Write Optical
If your device is not in the predefined object class, but is similar to the objects listed above, it will work normally if you select this type of object when adding the device in SMIT, this is usually the case when megamgr encounters a device that you don't know. If the device cannot work normally, you only need to modify the pre-defined object class, write the necessary device program, and sometimes write the device driver to install the software to support the device. For more information, see Kernel Extensions and Device Programming Concepts.
6. delete a device
When you move a device from the system, or make it in the power-off status, systmgr sets the device to defined State during the next system restart. If you do not want to see the devices in the defined status, you can use the rmdev command to delete them. The syntax of rmdev is:
# Rmdev-l Name
Name indicates the logical Name of the device. The first column of lsdev-C command output is the logical name of the device. To delete the 8mm drive, enter the following command:
# Rmdev-l rmt0
This command retains the configuration information of the rmt0 device in the User-defined database and changes its status to defined. To completely delete the tape drive from the User-Defined database, enter:
# Rmdev-d-l rmt0
The above operations can also be implemented through SMIT. You only need to enter the smit device and select the correct menu option to delete the selected device, which includes the option to retain the device in the User-Defined database.
Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html