[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

mkdev Command

Purpose

Adds a device to the system.

Syntax

mkdev { -c Class -s Subclass -t Type } [ -l Name ] [ -a Attribute=Value ] ... [ -d | -S | -R ] [ -f File ] [ -h ] [ -p ParentName ] [ -q ] [ -w ConnectionLocation ]

mkdev -l Name [ -h ] [ -q ] [ -S ]

Description

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

The mkdev command either defines and makes available a device with the given device class (-c Class flag), type (-t Type flag), subclass (-s Subclass flag), connection location (-w ConnectionLocation flag), and the device logical name of the parent (-p ParentName flag), or makes available the previously defined device specified by the given device logical name (-l Name flag). You can use any combination of the -c, -s, and -t flags needed to uniquely identify the predefined device.

If you specify the -d flag, the mkdev command only defines the device. If you specify the -S flag, the mkdev command brings the device to the Stopped state, if this state is supported, and does not make the device available. If you do not specify either the -d flag or the -S flag, the mkdev command makes the device available.

If you specify the -R flag, the mkdev command configures any parents of the specified device that are not already configured. Parents must be previously defined. The -R flag is not compatible with the -d and -S flags.

By using the -l flag with the -c, -s, and -t flags, you can specify the name you want the device to be known by. If you do not use the -l flag, a name will be automatically generated and assigned. Not all devices support user-supplied names.

Note: Queue device names must begin with an alphabetic character.

When using the mkdev command, you can supply the flags either on the command line or from the specified File parameter.

You can use the Web-based System Manager Devices application (wsm devices fast path) to run this command. You could also use the System Management Interface Tool (SMIT) smit mkdev fast path to run this command.

Flags

-a Attribute=Value Specifies the device attribute value pairs to be used instead of the defaults. The Attribute=Value variable can be used to specify 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 quotation marks with a blank space 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. This flag cannot be used with the -l flag unless the -c, -s, and -t flags are also used.
-c Class Specifies the device class.
-d Defines the device in the Customized Devices object class. If you specify the -d flag, the mkdev command does not make the device available. This flag cannot be used with the -S flag.
-f File Reads the needed flags from the File parameter.
-h Displays the command usage message.
-l Name Specifies the already defined device, indicated by the Name variable, in the Customized Devices object class when not used with the -c, -s, and -t flags. The -a, -p, and -w flags cannot be used in this case. Queue device names must begin with an alphabetic character.
-p ParentName Specifies the device name, indicated by the ParentName variable, that you want assigned to the device when used with the -c, -s, and -t flags. Not all devices support this feature. This flag cannot be used with the -l flag unless the -c, -s, and -t flags are also used.
-q Suppresses the command output messages from standard output and standard error.
-R Configures any parents of the device that are not already configured. This flag is not compatible with the -d and -S flags.
-S Prevents the device from being set to the Available state. This flag is only meaningful for those devices that support the Stopped state. This flag cannot be used with the -d flag.
-s Subclass Specifies the subclass, indicated by the Subclass variable, of the device.
-t Type Specifies the device type from the Predefined Devices object class.
-w ConnectionLocation Specifies the connection location, indicated by the ConnectionLocation variable, on the parent. This flag cannot be used with the -l flag unless the -c, -s, and -t flags are also used.

Security

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

Auditing Events:

Event Information
DEV_Create Method name, parameters
DEV_Configure Errors
DEV_Start Device name
DEV_Change Parameters

Examples

  1. To define (but not configure) a 150MB, .25-inch Small Computer System Interface (SCSI) tape drive connected to the SCSI adapter scsi0 and using SCSI ID 4 and LUN of 0, enter:
    mkdev -d -c tape -t 150mb  -s scsi 
    -p scsi0 -w 4,0
    The system displays a message similar to the following:
    rmt0 defined
  2. To make an already defined tape device available to use, enter:
    mkdev -l rmt0
    The system displays a message similar to the following:
    rmt0 available
  3. To define and configure an rs-232 tty device connected to port 0 on the 8-port sa3 asynchronous adapter with the speed attribute set to 19200, and other attributes set from the foo file, enter:
    mkdev -t tty -s rs232 -p sa3 -w 0
    -a speed=19200 -f foo
    The system displays a message similar to the following:
    tty0 available

Files

/usr/lpp/msg/En_US/cmdcfg.cat Contains the message catalog file.
/usr/sbin/mkdev Contains the mkdev command.

Related Information

The chdev command, lsattr command, lsconn command, lsdev command, lsparent command, rmdev command.

Device Overview for System Management in the AIX Version 4.3 System Management Guide: Operating System and Devices.

Setting up and running Web-based System Management in AIX Version 4.3 System Management Guide: Operating System and Devices.

System Management Interface Tool (SMIT): Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.


[ Previous | Next | Contents | Glossary | Home | Search ]