[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

chdev Command

Purpose

Changes the characteristics of a device.

Syntax

chdev -l Name-a Attribute=Value ... ] [  -f File ] [ -h ] [  -p ParentName ] [  -P | -T ] [  -q ] [  -w ConnectionLocation ]

Description

The chdev command changes the characteristics of the device specified with the given device logical name (the -l Name flag).The device can be in the Defined, Stopped, or Available state. Some changes may not be allowed when the device is in the Available state. When changing the device characteristics, you can supply the flags either on the command line or from a specified File parameter.

When neither the -P nor the -T flags are specified, the chdev command applies the changes to the device and updates the database to reflect the changes. If the -P flag is specified, only the database is updated to reflect the changes, and the device itself is left unchanged. This is useful in cases where a device cannot be changed because it is in use; in which case, the changes can be made to the database with the -P flag, and the changes will be applied to the device when the system is restarted. The -T flag is used to make a temporary change in the device without the change being reflected in the database. It is temporary in that the device will revert to the characteristics described in the database when the system is restarted. Not all devices support the -P and -T flags. A device that is in the Defined state can only have changes applied to the database.

Attention: To protect the Configuration database, the chdev command is not interruptible. To stop this command before execution is complete could result in a corrupted database.

You can use the Devices application in Web-based System Manager (wsm) to change device characteristics. You could also use the System Management Interface Tool (SMIT) smit chdev fast path to run this command for certain devices.

Flags

-a Attribute=Value Specifies the device attribute value pairs used for changing specific attribute values. The Attribute=Value parameter can use one attribute value pair or multiple attribute value pairs for one -a flag. If you use an -a flag with multiple attribute value pairs, the list of pairs must be enclosed in quotes with spaces between the pairs. For example, entering -a Attribute=Value lists one attribute value pair per flag, while entering -a 'Attribute1=Value1 Attribute2=Value2' lists more than one attribute value pair.
-f File Reads the needed flags from the named File parameter.
-h Displays the command usage message.
-l Name Specifies the device logical name, specified by the Name parameter, in the Customized Devices object class whose characteristics are to be changed.
-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 can be made to the database with the -P flag. By restarting the system, the changes will be applied to the device. This flag cannot be used with the -T flag. Not all devices support the -P flag.
-p ParentName Specifies the new device logical name of the parent device, specified by the ParentName parameter, in the Customized Devices object class. This flag is used only when changing the parent of the device. Not all devices support the -p flag.
-q Suppresses the command output messages from standard output and standard error.
-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.
-w ConnectionLocation Specifies the new connection location on the parent. This flag is used only when changing the connection location of the device. Not all devices support the -w flag.

Security

Access Control: Only the root user and members of the security group should have execute (x) access to this command.

Auditing Event Information
DEV_Change Parameters to the method the cfgmgr command calls.

Examples

  1. To change the retention instructions of a 150M-byte, .25-inch tape drive to rmt0 (so that the drive does not move the tape to the beginning, then to the end, and then back to the beginning each time a tape is inserted or the drive is powered on), enter:
    chdev -l rmt0 -a ret=no
    The system displays a message similar to the following:

    rmt0 changed
  2. To change one or more attributes of the token-ring adapter tok0 to preset values as described in the changattr file, enter:

    chdev -l tok0 -f changattr

    The system displays a message similar to the following:

    tok0 changed
  3. To change the SCSI ID of the available SCSI adapter scsi0 that cannot be made unavailable or changed due to available disk drives connected to it, enter:
    chdev  -l scsi0 -a id=6 -P
    The system displays a message similar to the following:

    scsi0 changed

    To apply the change to the adapter, shutdown and restart the system.

  4. To change the attribute describing which external connector is to be used by adapter ent0, enter:
    chdev  -l ent0  -a bnc_select=dix
    The system displays a message similar to the following:

    ent0 changed

    If an error message is displayed because the device is in use, reissue the chdev command using the -P flag. Shutdown and restart the system to apply the change to the adapter.

  5. To move a defined tty device tty11 to port 0 on another serial adapter sa5, enter:
    chdev  -l tty11  -p sa5  -w 0
    The system displays a message similar to the following:

    tty11 changed
     
    chdev -l sys0 -a maxuproc=100

Files

/usr/sbin/chdev Specifies the command file.

Related Information

The lsattr command, lsconn command, lsdev command, lsparent command, mkdev command, and rmdev command.

The Devices in AIX 5L Version 5.2 System Management Guide: Operating System and Devices provides information about adding, changing, moving, and removing devices.

For information on installing the Web-based System Manager, see Chapter 2: Installation and System Requirements in AIX 5L Version 5.2 Web-based System Manager Administration Guide.

The System Management Interface Tool (SMIT): Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices tells you about the SMIT application.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]