rmdev Command

Purpose

Removes a device from the system.

Syntax

rmdev { -l | -p }Name [ -d | -S ] [  -f File ] [ -h ] [ -q ] [  -R ] [ -g ]

Description

Note: The -l flag cannot be specified if -p is specified. If the -R flag is specified along with the -p flag, it will be ignored.

The rmdev command unconfigures or both unconfigures and undefines the device specified with the device logical name using the -l Name flag. The default action unconfigures the device but retains its device definition in the Customized Devices object class.

If you specify the -S flag, the rmdev command sets the device to the Stopped state for devices that support the Stopped state. If you specify the -d flag, the rmdev command deletes the device definition from the Customized Devices object class (undefines). If you do not specify the -d flag, the rmdev command sets the device to the Defined state (unconfigures). If you specify the -R flag, the rmdev command acts on any children of the device as well.

Use the -p flag along with the parent device's logical name to unconfigure or delete all of the children devices. The children are unconfigured or deleted in the same recursive fashion as described for the -R flag, but the specified device itself is not unconfigured or deleted.

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

You can also use the Devices application in Web-based System Manager, or the System Management Interface Tool (SMIT)smit rmdev fast path to run this command.

Flags

Item Description
-d Removes the device definition from the Customized Devices object class. This flag cannot be used with the -S flag.
-f File Reads the necessary flags from the File parameter.
-g Forces the remove operation to run on a locked device.
-h Displays the command usage message.
-l Name Specifies the logical device, indicated by the Name parameter, in the Customized Devices object class. This flag cannot be used with the -p flag.
-p Name Specifies the parent logical device (indicated by the Name parameter) in the Customized Devices object class, with children that must be removed. This flag may not be used with the -l flag.
-q Suppresses the command output messages from standard output and standard error.
-R Specifies to unconfigure the device and its children. When used with the -d or -S flags, the children are undefined or stopped, respectively.
-S Makes the device unavailable by calling the Stop method if the device has a Stop method. This flag cannot be used with the -d flag.

Exit Status

This command returns the following exit values:
Item Description
0 Successful completion.
>0 An error occurred.

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_Stop Device name
DEV_Unconfigure Device name
DEV_Remove Device name

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 unconfigure the cd0 CD-ROM device while retaining its device definition in the Customized Devices object class, type the following:
    rmdev  -l cd0
    The system displays a message similar to the following:
    cd0 defined
  2. To remove the cd0 CD-ROM device definition from the Customized Devices object class, type the following:
    rmdev  -d  -l cd0
    The system displays a message similar to the following:
    cd0 deleted
  3. To unconfigure the scsi1 SCSI adapter and all of its children while retaining their device definitions in the Customized Devices object class, type the following:
    rmdev  -R -l scsi1
    The system displays a message similar to the following:
    rmt0 Defined
    hdisk1 Defined
    scsi1 Defined
  4. To unconfigure the children of the scsi1 SCSI adapter, but not the adapter itself, while retaining their device definitions in the Customized Devices object class, type the following:
    rmdev  -p scsi1
    The system displays a message similar to the following:
    rmt0 Defined
    hdisk1 Defined
  5. To unconfigure the children of the pci1 PCI bus and all other devices under them while retaining their device definitions in the Customized Devices object class, type the following:
    rmdev  -p pci1
    The system displays a message similar to the following:
    rmt0 Defined
    hdisk1 Defined
    scsi1 Defined
    ent0 Defined

Files

Item Description
/usr/sbin/rmdev Contains the rmdev command.