System Administration Guide, Volume 1

SCSI Hot Plugging With the cfgadm Command

The following section describes various SCSI hot plugging tasks with the cfgadm command.

The procedures in this section use specific devices as examples to illustrate how to use the cfgadm command to hot plug SCSI components. The device information that you supply, and is displayed with the cfgadm command, depends on your system configuration.

How to Display Configuration Information for all Devices

SCSI controllers c0 and c1 and the devices attached to them provide examples of the type of device configuration information that can be displayed with the cfgadm command.


Note -

If the SCSI device is not supported by the cfgadm command, it does not display in the cfgadm command output.


  1. Become superuser.

  2. Display information about attachment points on the system.


    # cfgadm -l
    Ap_Id                Type         Receptacle   Occupant     Condition
    c0                   scsi-bus     connected    configured   unknown
    c1                   scsi-bus     connected    configured   unknown

    In this example, c0 and c1 represent two SCSI controllers.

  3. Display information about a system's SCSI controllers and their attached devices.


    # cfgadm -al 
    Ap_Id                Type         Receptacle   Occupant     Condition
    c0                   scsi-bus     connected    configured   unknown
    c0::dsk/c0t0d0       disk         connected    configured   unknown
    c0::rmt/0            tape         connected    configured   unknown
    c1                   scsi-bus     connected    configured   unknown
    c1::dsk/c1t3d0       disk         connected    configured   unknown
    c1::dsk/c1t4d0       unavailable  connected    unconfigured unknown

    Note -

    The cfgadm -l commands displays info about SCSI HBAs but not SCSI devices. Use the cfgadm -al command to display information about SCSI devices such as disk and tapes.


In the following examples, only SCSI attachment points are listed. The attachment points displayed on your system will depend on your system configuration.

How to Unconfigure a SCSI Controller

SCSI controller c1 provides an example of unconfiguring a SCSI controller.

  1. Become superuser.

  2. Unconfigure a SCSI controller.


    # cfgadm -c unconfigure c1
    
  3. Verify the SCSI controller is unconfigured.


    # cfgadm -al
    Ap_Id                 Type         Receptacle   Occupant     Condition
    c0                    scsi-bus     connected    configured   unknown
    c0::dsk/c0t0d0        disk         connected    configured   unknown
    c0::rmt/0             tape         connected    configured   unknown
    c1                    scsi-bus     connected    unconfigured unknown

    Notice that the Occupant column specifies unconfigured, indicating that the SCSI bus has no configured occupants.

How to Configure a SCSI Controller

SCSI controller c1 provides an example of configuring a SCSI controller.

  1. Become superuser.

  2. Configure a SCSI controller.


    # cfgadm -c configure c1
    
  3. Verify the SCSI controller is configured.


    # cfgadm -al
    Ap_Id                Type         Receptacle   Occupant     Condition
    c0                   scsi-bus     connected    configured   unknown
    c0::dsk/c0t0d0       disk         connected    configured   unknown
    c0::rmt/0            tape         connected    configured   unknown
    c1                   scsi-bus     connected    configured   unknown
    c1::dsk/c1t3d0       disk         connected    configured   unknown
    c1::dsk/c1t4d0       unavailable  connected    unconfigured unknown

    The previous unconfigure procedure removed all devices on the SCSI bus. Now all the devices are configured back into the system.

How to Configure a SCSI Device

SCSI disk c1t4d0 provides an example of configuring a SCSI device.

  1. Become superuser.

  2. Identify the device to be configured.


     
    cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       unavailable   connected    unconfigured unknown
  3. Configure a specific SCSI device.


    # cfgadm -c configure c1::dsk/c1t4d0
    
  4. Verify the SCSI device is configured.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown

How to Disconnect a SCSI Controller

Disconnecting a SCSI device must be done with caution, particularly when dealing with controllers for disks containing critical file systems such as root (/), usr, var, and the swap partition. The dynamic reconfiguration software cannot detect all cases where a system hang may result. Use this command with caution.

SCSI controller c1 provides an example of disconnecting a SCSI device.

  1. Become superuser.

  2. Verify the device is connected before disconnecting it.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown
  3. Disconnect a SCSI controller.


    # cfgadm -c disconnect c1
    WARNING: Disconnecting critical partitions may cause system hang.
    Continue (yes/no)? y
    

    Caution - Caution -

    This command suspends all I/O activity on the SCSI bus until the cfgadm -c connect command is used. The cfgadm command does some basic checking to prevent critical partitions from being disconnected, but it cannot detect all cases. Inappropriate use of this command may result in a system hang and could require a system reboot.


  4. Verify the SCSI bus is disconnected.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   unavailable   disconnected configured   unknown
    c1::dsk/c1t10d0      unavailable   disconnected configured   unknown
    c1::dsk/c1t4d0       unavailable   disconnected configured   unknown

    The controller and all the devices attached to it are disconnected from the system.

How to Connect a SCSI Controller

SCSI controller c1 provides an example of connecting a SCSI controller.

  1. Become superuser.

  2. Verify the device is disconnected before connecting it.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   unavailable   disconnected configured   unknown
    c1::dsk/c1t10d0      unavailable   disconnected configured   unknown
    c1::dsk/c1t4d0       unavailable   disconnected configured   unknown
  3. Connect a SCSI controller.


    # cfgadm -c connect c1
    
  4. Verify the SCSI controller is connected.


    # cfgadm -al 
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown

SPARC: How to Add a SCSI Device to a SCSI Bus

SCSI controller c1 provides an example of how to add a SCSI device to a SCSI bus.


Note -

When adding devices, the ap_id of the SCSI HBA (controller) to which the device is attached is specified, not the ap_id of the device itself.


  1. Become superuser.

  2. Identify the current SCSI configuration.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
  3. Add a SCSI device to a SCSI bus.


    # cfgadm -x insert_device c1
    Adding device to SCSI HBA: /devices/sbus@1f,0/SUNW,fas@1,8800000
    This operation will suspend activity on SCSI bus: c1
    Continue (yes/no)? y
    SCSI bus quiesced successfully.
    It is now safe to proceed with hotplug operation.
    Enter y if operation is complete or n to abort (yes/no)? y
    
    1. Type y at the Continue (yes/no)? prompt to proceed.

      I/O activity on the SCSI bus will be suspended while the hot-plug operation is in progress.

    2. Connect the device and then power it on.

    3. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt after the new device has been inserted.

  4. Verify the device has been added.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown

    A new disk has been added to controller c1.

SPARC: How to Replace an Identical Device on a SCSI Controller

SCSI disk c1t4d0 provides an example of replacing an identical device on a SCSI controller.

  1. Become superuser.

  2. Identify the current SCSI configuration.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown
  3. Replace a device on the SCSI bus with another device of the same type.


    # cfgadm -x replace_device c1::dsk/c1t4d0
    Replacing SCSI device: /devices/sbus@1f,0/SUNW,fas@1,8800000/sd@4,0
    This operation will suspend activity on SCSI bus: c1
    Continue (yes/no)? y
    SCSI bus quiesced successfully.
    It is now safe to proceed with hotplug operation.
    Enter y if operation is complete or n to abort (yes/no)? y
    
    1. Type y at the Continue (yes/no)? prompt to proceed.

      I/O activity on the SCSI bus will be suspended while the hot-plug operation is in progress.

    2. Power off the device to be removed and remove it. Add the replacement device, which should be of the same type and at the same address (target and lun) as the device to be removed. Then power it on.

    3. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt after the device has been replaced.

  4. Verify the device has been replaced.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown

SPARC: How to Remove a SCSI Device

SCSI disk c1t4d0 provides an example of removing a device on a SCSI controller.

  1. Become superuser.

  2. Identify the current SCSI configuration.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown
    c1::dsk/c1t4d0       disk          connected    configured   unknown
  3. Remove a SCSI device from the system.


    # cfgadm -x remove_device c1::dsk/c1t4d0
    Removing SCSI device: /devices/sbus@1f,0/SUNW,fas@1,8800000/sd@4,0
    This operation will suspend activity on SCSI bus: c1
    Continue (yes/no)? y
    SCSI bus quiesced successfully.
    It is now safe to proceed with hotplug operation.
    Enter y if operation is complete or n to abort (yes/no)? y 
    

    1. Type y at the Continue (yes/no)? prompt to proceed.

      I/O activity on the SCSI bus will be suspended while the hot-plug operation is in progress.

    2. Power off the device to be removed and remove it.

    3. Type y at the Enter y if operation is complete or n to abort (yes/no)? prompt after the device has been removed.

  4. Verify the device has been removed from the system.


    # cfgadm -al
    Ap_Id                Type          Receptacle   Occupant     Condition
    c0                   scsi-bus      connected    configured   unknown
    c0::dsk/c0t0d0       disk          connected    configured   unknown
    c0::rmt/0            tape          connected    configured   unknown
    c1                   scsi-bus      connected    configured   unknown
    c1::dsk/c1t3d0       disk          connected    configured   unknown

SPARC: Troubleshooting SCSI Configuration Problems

Error Message

cfgadm: Component system is busy, try again: failed to offline:
     device path
          Resource              Information
     ------------------  --------------------------
     /dev/dsk/c1t0d0s0   mounted filesystem "/file-system"
Cause

You attempted to remove or replace a device with a mounted file system.

Solution

Unmount the file system listed in the error message and try the cfgadm operation again.