Removes a device from the system.
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.
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.
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. |
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_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.
rmdev -l cd0
The system displays
a message similar to the following: cd0 defined
rmdev -d -l cd0
The
system displays a message similar to the following: cd0 deleted
rmdev -R -l scsi1
The
system displays a message similar to the following: rmt0 Defined
hdisk1 Defined
scsi1 Defined
rmdev -p scsi1
The
system displays a message similar to the following: rmt0 Defined
hdisk1 Defined
rmdev -p pci1
The
system displays a message similar to the following: rmt0 Defined
hdisk1 Defined
scsi1 Defined
ent0 Defined
Item | Description |
---|---|
/usr/sbin/rmdev | Contains the rmdev command. |