Solaris 8 System Administration Supplement

About USB in the Solaris Environment

The following section describes specific information you should know about USB in the Solaris environment.

USB Keyboards and Mouse Devices

Keep only one USB keyboard and mouse on the system at all times because multiple USB keyboards and mouse devices are not supported in the Solaris environment. See the following items for specific details.

USB Host Controller and Root Hub

A USB hub is responsible for:

The USB host controller has an embedded hub called the root hub. The ports that are visible at the back panel are the ports of the root hub. The USB host controller is responsible for:

USB Hub Devices

USB Storage Devices

Removable mass storage devices such as USB Zip, Jaz, Clik!, SmartMedia, CompactFlash, and ORB are supported, starting with the Solaris 8 10/00 release. See scsa2usb(7D) for a complete list of devices supported in the Solaris environment.

These devices can be managed with or without volume management. See vold(1M) for information on managing devices with volume management.

Managing USB Mass Storage Devices With vold Running

If you are running Solaris Common Desktop Environment (CDE), the USB removable mass storage devices are managed by the Removable Media Manager component of the CDE File Manager. See dtfile(1) for more information on the CDE File Manager.


Note -

You must include the /usr/dt/man in your MANPATH variable to display the man pages listed in this section. You must also have /usr/dt/bin in your path and have CDE running to use these commands, or have a DISPLAY variable set to use these commands remotely.


The following table identifies the commands Removable Media Manager uses to manage storage devices from the CDE environment.

Command  

Task 

sdtmedia_format(1)

Format and label USB devices 

sdtmedia_prop(1)

Display properties of the device  

sdtmedia_prot(1)

Change device protection 

sdtmedia_slice(1)

Create or modify slices on the device  

After the USB device is formatted, it is usually mounted under the /rmdisk/label directory. See rmmount.conf(4) or vold.conf(4) for details on how to configure removable storage devices.

The following procedures describe how to manage USB mass storage devices with volume management. The device nodes are created under the /vol/dev directory. See scsa2usb(7D) for more information. The following procedures also describe how to add or remove hot-pluggable USB mass storage devices. Hot-plugging a device means the device is added or removed without shutting down the operating system or powering off the system.

How to Mount or Unmount a USB Mass Storage Device With vold Running

  1. Display device aliases for all removable mass storage devices, including USB mass storage devices.


    $ eject -n
    .
    .
    .
    rmdisk0 -> /vol/dev/rdsk/c4t0d0/clik40    (Generic USB storage)
    cdrom0 -> /vol/dev/rdsk/c0t6d0/audio_cd   (Generic CD device)
    zip1 -> /vol/dev/rdsk/c2t0d0/fat32        (USB Zip device)
    zip0 -> /vol/dev/rdsk/c1t0d0/zip100       (USB Zip device)
    jaz0 -> /vol/dev/rdsk/c3t0d0/jaz1gb       (USB Jaz device)
  2. Mount a USB mass storage device by using the device aliases listed previously.


    $ volrmmount -i device-alias
    

    This example mounts a USB Jaz drive under /rmdisk/jaz0.


    $ volrmmount -i jaz0 
    

  3. Unmount a USB mass storage device.


    $ volrmmount -e device-alias
    

    This example unmounts a USB Zip drive from /rmdisk/zip0.


    $ volrmmount -e zip0
    
  4. Eject a USB device from a generic USB drive.


    $ eject device-alias
    

    For example:


    $ eject rmdisk0
    

    Note -

    The eject command also unmounts the device, if it is not unmounted already. The command also terminates any active applications that access the device.


How to Remove a Hot-Pluggable USB Mass Storage Device With vold Running

The following procedure uses a Zip drive as an example of removing a hot-pluggable USB device with vold running.

  1. Unmount the device.


    $ volrmmount -e zip0
    
  2. (Optional) Stop any active applications that are using the device.

  3. Eject the device.


    $ eject zip0
    
  4. Become superuser and stop vold.


    # /etc/init.d/volmgt stop
    
  5. Remove the USB mass storage device.

  6. Start vold.


    # /etc/init.d/volmgt start
    

How to Add a Hot-Pluggable USB Mass Storage Device With vold Running

This procedure describes how to add a hot-pluggable USB device with vold running.

  1. Insert the USB mass storage device.

  2. Restart vold.


    # pkill -HUP vold
    
  3. Verify the device has been added.


    $ ls device-alias
    

Managing USB Mass Storage Devices Without vold Running

You can use USB mass storage devices without the volume manager (vold) running. Here are two ways to avoid using the volume manager.

  1. Stop vold by issuing this command.


    # /etc/init.d/volmgt stop
    
  2. Keep vold running, but do not register the USB mass storage devices with it. Remove volume manager registration of USB mass storage devices by commenting the following line in the /etc/vold.conf file, like this:


    # use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d

    Once this line is commented, restart vold.


    # pkill -HUP vold_pid
    

    Caution - Caution -

    If you comment out this line and there are other SCSI or ATAPI Zip or Jaz removable devices in the system, vold registration for these devices would be disabled as well.


    See vold.conf(4) for details.

The following procedures describe how to manage USB mass storage devices without vold(1M) running. The device nodes are created under the /dev/rdsk directory for character devices and under the /dev/dsk directory for block devices. See scsa2usb(7D) for details.

How to Mount or Unmount a USB Mass Storage Device Without vold Running

  1. Become superuser.

  2. Mount a USB mass storage device.


    # mount -F fs-type /dev/rdsk/cntndnsn /mount-point
    
  3. Unmount a USB mass storage device.


    # umount /mount-point
    
  4. Eject the device.


    # eject /dev/[r]dsk/cntndnsn
    

How to Remove a Hot-Pluggable USB Mass Storage Device Without vold Running

This procedure describes how to remove a hot-pluggable USB device without vold running.

  1. Become superuser.

  2. Remove the hot-pluggable USB device.

    1. Unmount the device.


      # umount /mount-point
      
    2. (Optional) Stop any active applications that are using the device.

    3. Remove the device.

How to Add a Hot-Pluggable USB Mass Storage Device Without vold Running

This procedure describes how to add a hot-pluggable USB device without vold running.

  1. Add a hot-pluggable USB device into the USB port.

  2. Verify the USB device has been added.


    $ ls /dev/rdsk/cntndnsn
    

SPARC Only: USB Power Management

If the system has enabled power management, the USB framework makes a best effort to power-manage all devices. Power-managing a USB device involves the hub driver to suspend the port to which the device is connected. The device might or might not support remote wakeup. If the device supports remote wakeup, it wakes up the hub it is connected to, depending on the event, such as moving the mouse. The host system could also wake the device if an application sends an I/O to it.

All HID (keyboard, mouse, and so forth), hub, and storage devices are power-managed by default if they support the remote wake up capability. A USB printer is power-managed only between two print jobs.

When you power-manage to reduce power consumption, USB leaf devices are powered down first, and after some delay, the parent hub is powered down. When all devices that are connected to this hub's ports are powered down, the hub is powered down after some delay. Avoid cascading many hubs to achieve the most efficient power management.

Hot-Plugging USB Devices

When you plug in a USB device, the device is immediately seen in the system's device hierarchy as displayed in the prtconf(1M) command output. When you remove a USB device, the device is removed from the system's device hierarchy, unless the device is in use.

If the USB device is in use when it is removed, the hot-plug behavior is a little different. If a device is in use when it is unplugged, the device node remains, but the driver controlling this device stops all activity on the device. Any new I/O activity issued to this device is returned with an error.

In this situation, the system prompts you to plug in the original device. To recover from accidentally removing a busy USB device, do the following:

  1. Plug the original device into the same port.

  2. Stop the application that is using the device.

  3. Remove the device.

The USB port remains unusable until the original device has been plugged in again. If the device is no longer available, the port remains unusable until the next reboot.


Note -

Data integrity might be impaired if you remove an active or open device. Always close the device before removing, except the console keyboard and mouse, which can be moved while active.


USB Cables

Never use USB cable extenders that are available in the market. Always use a hub with longer cables to connect devices. Always use fully rated (12 Mbit/sec) 20/28 AWG cables for connecting USB devices.