La commande 'chdev' permet de modifier certaines caractéristiques d'un périphérique.

Il peut s'agir de la taille de bloc pour un lecteur de bande, d'une profondeur de queue pour un disque ou de délai de réaction pour une carte fibre.

La syntaxe de la commande est : 'chdev -l -a option=Value'. option est un paramètre visible par la commande 'lsdev -l device'

Pour une taille de bloc, on peut faire  un 'chdev -l rmt0 -a block_size=1024' par exemple.

ou bien pour une carte réseau :"chdev -l ent0 -a media_speed='100_Full_Duplex'  "

 

La commande 'chdev' est également utilisée pour récupérer un PVID dans le cas d'un cluster ou de problème de reconnaissance.

La syntaxe est alors : 'chdev -a pv=yes -l hdiskX'

 

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 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 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. If a device that is in the Defined state, changes are only applied 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

-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.
-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.
-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 Event
Information
DEV_Change
Parameters to the method the cfgmgr command calls.

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, type 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, type 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, type
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, type 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, type the following:

chdev -l sys0 -a maxuproc=100
The system displays a message similar to the following:

sys0 changed

Files

/usr/sbin/chdev
Specifies the command file.

Related Information

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

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

The System management interface tool in Operating system and device management tells you about the SMIT application.

icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone