Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next

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
    .
    .
    .
    cdrom0 -> /vol/dev/rdsk/c0t6d0/audio_cd   (Generic CD device)
    zip0 -> /vol/dev/rdsk/c1t0d0/zip100       (USB Zip device)
    zip1 -> /vol/dev/rdsk/c2t0d0/fat32        (USB Zip device)
    rmdisk0 -> /vol/dev/rdsk/c5t0d0/unnamed_rmdisk (Peerless, HD or floppy)
    rmdisk1 -> /vol/dev/rdsk/c4t0d0/clik40    (Generic USB storage)

  2. Select one of the following to mount or unmount a USB mass storage device.

    1. Mount a USB mass storage device by using the device aliases listed previously.

      $ volrmmount -i device-alias

      This example shows how to mount a USB Zip drive (/rmdisk/zip0).

      $ volrmmount -i zip0 

    2. Unmount a USB mass storage device.

      $ volrmmount -e device-alias

      This example shows how to unmount a USB Zip drive (/rmdisk/zip0).

      $ volrmmount -e zip0

  3. 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 the device is not unmounted already. The command also terminates any active applications that access the device.


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

  1. See How to Prepare to Use USB Mass Storage Devices Without vold Running for information on disabling vold.

  2. Become superuser.

  3. (Optional) Identify the diskette device.

    For example:

    # cd /dev/rdsk
    # devfsadm -C
    # ls -l c*0 | grep usb
    lrwxrwxrwx   1 root  root   55 Mar  5 10:35 c2t0d0s0 ->
    ../../devices/pci@1f,0/usb@c,3/storage@3/disk@0,0:a,raw

    In this example, the diskette device is c2t0d0s0.

  4. Select one of the following to mount or unmount a USB mass storage device.

    1. Mount a USB mass storage device.

      # mount [ -F fstype ] block-device mount-point

      This example shows how to mount a device with a UFS file system.

      # mount /dev/dsk/c1t0d0s2 /mnt

      This example shows how to mount a device with a PCFS file system.

      # mount -F pcfs /dev/dsk/c1t0d0s0:c /mnt

      This example shows how to mount a CD with a read-only HSFS file system.

      # mount -F hsfs -o ro /dev/dsk/c1t0d0s2 /mnt

    2. Unmount a USB mass storage device.

      First, be sure no one is using the file system on the device.

      For example:

      # fuser -c -u /mnt
      # umount /mnt

    3. Eject the device.

      # eject /dev/[r]dsk/cntndnsn

      For example:

      # eject /dev/rdsk/c1t0d0s2 

Disabling Specific USB Drivers

You can disable specific types of USB devices by disabling their client driver. For example, USB printers can be disabled by disabling the usbprn driver that directs them. Disabling usbprn does not affect other kinds of devices, such as USB storage devices.

Be careful that device types are disabled on both frameworks. You cannot disable device types on one framework only. The following table identifies some USB device types and their corresponding drivers.

Device Type

Driver to Disable

audio

usb_ac and usb_as

HID (usually keyboard and mouse

hid

storage

scsa2usb

printer

usbprn

serial

usbser_edge

If you disable a driver for a USB device that is still connected to the system, you will see a console message similar to the following:

usba10: WARNING: usba:    no driver found for device name

ProcedureHow to Disable Specific USB Drivers

  1. Become superuser.

  2. Record the driver aliases that you are about to remove.

    # cp /etc/driver_aliases /etc/driver_aliases.orig

  3. Identify the specific USB driver alias name.

    For example:

    # grep usbprn /etc/driver_aliases
    usbprn "usbif,class7.1.1"
    usbprn "usbif,class7.1.2"

  4. Remove the driver alias entry.

    For example:

    # update_drv -d -i '"usbif,class7.1.1"' usbprn
    # update_drv -d -i '"usbif,class7.1.2"' usbprn

  5. Reboot the system.

    # init 6

ProcedureHow to Remove Unused USB Device Links

Use this procedure if a USB device is removed while the system is powered off. It is possible that removing the USB device while the system is powered off will leave device links for devices that do not exist.

  1. Become superuser.

  2. Close all applications that might be accessing the device.

  3. Remove the unused links for a specific USB class.

    For example:

    # devfsadm -C -c audio

    Or, just remove the dangling links:

    # devfsadm -C

Previous Previous     Contents     Index     Next Next