chdev Command

Purpose

Changes the characteristics of a device.

Syntax

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

Description

The chdev command changes the characteristics of the specified device with the given device logical name that is specified with 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 in the specified -f File flag.

When the -P, -U, and -T flags are not 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 is left unchanged. This is useful in cases where a device cannot be changed because it is in use. In cases where the device is in use, 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.

If the –U flag is specified, the database is updated to reflect the changes, and the device is changed while the device remains in the Available state. This option is applicable only to attributes that can be updated while the device is in the Available state. When the –U flag is specified the database is updated with the attributes that are provided with the –U flag and the device is changed to the current values of all attributes that can be updated while the device is in the Available state. See the lsattr command to determine whether the device supports this attribute type.

The -T flag is used to make a temporary change in the device without the change being reflected in the database.The device temporary reverts to the characteristics that are described in the database when the system is restarted. All devices do not support the -P, -U, and -T flags. If a device is in the Defined state, changes are applied only to the database.

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

You can use the Devices application in Web-based System Manager (wsm) or the System Management Interface Tool (SMIT) smit chdev fast path to change device characteristics.

Flags

Item Description
-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 necessary flags from the named File parameter.
-g Forces the change operation to take place on a locked device.
-h Displays the command usage message.
-l Name Specifies the device logical name 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 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.
-p ParentName Specifies the new device logical name of the parent device in the Customized Devices object class. Use this flag 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.
-U Changes the characteristics of the device while allowing the device to remain in the Available state. This flag cannot be used with the -P or -T flag. Not all devices and attributes support the -U flag.
-w ConnectionLocation Specifies the new connection location of the device on the parent. Use this flag 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 Events

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

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To change the retension instructions of the rmt0 4mm SCSI tape drive 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 the following:
    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 tok0 token-ring adapter to preset values as described in the changattr file, enter the following:
    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 scsi0 SCSI adapter that cannot be changed made unavailable due to available disk drives connected to it, enter the following:
    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 move the defined tty11 tty device to port 0 on the sa5 serial adapter, enter the following:
    chdev  -l tty11  -p sa5  -w 0
    The system displays a message similar to the following:
    tty11 changed
  5. To change the maximum number of processes allowed per user to 100, enter the following:
    chdev -l sys0 -a maxuproc=100
    The system displays a message similar to the following:
    sys0 changed
  6. To delete the alias4=10.3.4.3 Object Data Manager (ODM) entry from the en2 standard Ethernet network interface, enter the following:
    chdev -l en2 -a delalias4=10.3.4.3
    The system displays a message similar to the following:
    en2 changed
  7. To delete the alias6=fe80::20b4:40ff:fe00:f016/64 ODM entry from the en3 standard Ethernet network interface, enter the following:
    chdev -l en3 -a delalias6=fe80::20b4:40ff:fe00:f016/64
    The system displays a message similar to the following:
    en3 changed
  8. To enable dynamic tracking for a FC adapter:
    chdev -l fscsix -a dyntrk=yes
  9. To enable fast_fail for a FC adapter:
    chdev -l fscsix -a fc_err_recov=fast_fail

Files

Item Description
/usr/sbin/chdev Specifies the command file.