Adds a device to the system.
mkdev { -c Class -s Subclass -t Type } [ -l Name ] [ -a Attribute=Value ] ... [ -d | -S | -R ] [ -f File ] [ -h ] [ -p ParentName ] [ -q ] [ -w ConnectionLocation ]
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 previously-defined parents of the specified device that are not already configured. 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 of the device. If you do not use the -l flag, a name will be automatically generated and assigned. Not all devices support user-supplied names.
When using the mkdev command, you can supply the flags either on the command line or in the specified -f File flag.
You can use the Web-based System Manager Devices application (wsm devices fast path), or the System Management Interface Tool (SMIT) smit mkdev fast path to run this command.
| Item | Description |
|---|---|
| -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. Multiple attribute-value 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 necessary flags from the File parameter. |
| -h | Displays the command usage message. |
| -l Name | Specifies the predefined 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 it is 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 cannot be used 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. |
| Item | Description |
|---|---|
| 0 | Successful completion. |
| >0 | An error occurred. |
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 |
mkdev -d -c tape -t4mm2gb -s scsi -p scsi0 -w 5,0
The
system displays a message similar to the following: rmt4 defined
mkdev -l rmt0
The
system displays a message similar to the following: rmt0 available
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
| Item | Description |
|---|---|
| /usr/sbin/mkdev | Contains the mkdev command. |