JavaScript is required to for searching.
跳过导航链接
退出打印视图
Oracle Solaris 管理:设备和文件系统     Oracle Solaris 11 Information Library (简体中文)
search filter icon
search icon

文档信息

关于本书

1.  管理可移除介质(概述)

2.  管理可移除介质(任务)

3.  访问可移除介质(任务)

4.  写入 CD 和 DVD(任务)

5.  管理设备(概述/任务)

6.  动态配置设备(任务)

7.  使用 USB 设备(概述)

8.  使用 USB 设备(任务)

在 Oracle Solaris OS 中管理 USB 设备(任务列表)

使用 USB 海量存储设备(任务列表)

使用 USB 海量存储设备

使用 USB 磁盘设备

使用非符合 USB 海量存储设备

如何使用非符合 USB 海量存储设备

热插拔 USB 海量存储设备

如何添加 USB 海量存储设备

如何添加 USB 相机

如何移除 USB 海量存储设备

准备使用 USB 海量存储设备

如何显示 USB 设备信息

如何在 USB 海量存储设备中创建文件系统

如何在 USB 海量存储设备中修改分区和创建 PCFS 文件系统

如何在 USB 海量存储设备中创建 Solaris 分区和修改分片

如何挂载或取消挂载 USB 海量存储设备

USB 海量存储设备的疑难解答提示

禁用特定的 USB 驱动程序

如何禁用特定的 USB 驱动程序

如何移除未使用的 USB 设备链接

使用 USB 音频设备(任务列表)

使用 USB 音频设备

热插拔多个 USB 音频设备

如何添加 USB 音频设备

如何确定系统的主音频设备

如何更改主 USB 音频设备

USB 音频设备问题疑难解答

音频设备所有权要点

使用 cfgadm 命令热插拔 USB 设备(任务列表)

使用 cfgadm 命令热插拔 USB 设备

如何显示 USB 总线信息 (cfgadm)

如何取消配置 USB 设备

如何配置 USB 设备

如何以逻辑方式断开 USB 设备连接

如何以逻辑方式连接 USB 设备

如何以逻辑方式断开 USB 设备子树连接

如何重置 USB 设备

如何更改多重配置 USB 设备的缺省配置

9.  使用 InfiniBand 设备(概述/任务)

10.  管理磁盘(概述)

11.  管理磁盘(任务)

12.  SPARC:设置磁盘(任务)

13.  x86:设置磁盘(任务)

14.  使用 COMSTAR 配置存储设备

15.  配置和管理 Oracle Solaris Internet 存储名称服务 (Internet Storage Name Service, iSNS)

16.  format 实用程序(参考)

17.  管理文件系统(概述)

18.  创建和挂载文件系统(任务)

19.  配置附加交换空间(任务)

20.  复制文件和文件系统(任务)

21.  管理磁带机(任务)

索引

使用 USB 海量存储设备

支持以下 USB 可移除海量存储设备:

有关将 USB 海量存储设备用于 Oracle Solaris ZFS 文件系统的信息,请参见USB 设备的新增功能

有关 Oracle Solaris OS 所支持的 USB 设备的完整列表,请参见:

http://www.oracle.com/us/sun/index.html

在以前的 Solaris 发行版中,所有的 USB 存储设备都被标识为可移除介质设备,这些设备可提供以下许多优点,包括自动挂载。在 Oracle Solaris 11 发行版中,USB 海量存储设备被标识为可热插拔设备,而且具有 USB 可移除设备的优点(如下所述)。有关可热插拔行为的更多信息,请参见USB 和 1394 (FireWire) 支持

有关使用 USB 海量存储设备的更多信息,请参见 scsa2usb(7D)

使用 USB 磁盘设备

USB 磁盘设备显示为可移除介质设备。USB 磁盘设备不是通过 fd(磁盘)驱动程序进行管理的。发出用于 fd(本机磁盘)驱动程序的 ioctl(2) 调用的应用程序将失败。仅发出 read(2)write(2) 调用的应用程序将成功。其他应用程序(如 SunPCI 和 rmformat)也将成功。

将 USB 磁盘设备视为 SCSI 可移除介质设备。可在 /media 目录下访问该设备。

有关如何使用 USB 磁盘设备的更多信息,请参见第 1 章

使用非符合 USB 海量存储设备

即使某些设备未将其自身标识为符合 USB 海量存储类,或以不正确的方式标识其自身,USB 海量存储驱动程序也仍可能支持这些设备。scsa2usb.conf 文件包含一个属性覆盖列表,其中列有供应商 ID、产品 ID、用于匹配海量存储设备的修订版,以及用于覆盖缺省设备属性的字段。缺省情况下,会注释掉此列表中的项。要启用对特定设备的支持,可以复制并取消注释这些项。

如果将 USB 海量存储设备连接至运行此 Solaris 发行版的系统,但该系统无法使用它,则可以检查 /kernel/drv/scsa2usb.conf 文件,查看是否存在与该设备对应的注释掉的项。根据 scsa2usb.conf 文件中给出的信息,查看是否可以使用覆盖信息支持特定设备。

有关推荐的 USB 海量存储设备的列表,请转至:

http://www.oracle.com/us/sun/index.html

有关更多信息,请参见 scsa2usb(7D)

如何使用非符合 USB 海量存储设备

  1. 成为管理员。
  2. /etc/driver/drv/scsa2usb.conf 文件中添加项。

    以下项适用于 USB 内存条。

    attribute-override-list = "vid=* reduced-cmd-support=true";
  3. 重新引导系统或执行以下操作:
    1. 移除该设备。
    2. 手动更新驱动程序。
      # update_drv -f scsa2usb
    3. 添加该设备。

热插拔 USB 海量存储设备

热插拔设备是指在未关闭操作系统或未关闭系统电源的情况下添加或移除设备。所有的 USB 设备都是可热插拔设备。

可移除介质管理器现在可以识别热插拔设备。一旦插入该设备,便会在几秒钟内对其进行挂载。如果未发生任何情况,请查看该设备是否已挂载。

确保可移除介质服务正在运行。

# svcs hal dbus rmvolmgr
STATE          STIME    FMRI
online         May_03   svc:/system/dbus:default
online         May_03   svc:/system/hal:default
online         May_03   svc:/system/filesystem/rmvolmgr:default

如果文件系统有效并且可以进行识别,则可以从该设备将其挂载。

如果设备上的文件系统无法进行自动挂载,请尝试手动挂载。

热移除设备之前,应在 eject -l 命令的别名中找到该设备的名称。然后,弹出该设备的介质。如果不执行此操作,该设备会被释放,并且端口可再次使用,但是该设备中的文件系统可能已被破坏。

热插拔 USB 设备时,系统的设备分层结构中会立即显示该设备,如 prtconf 命令输出所示。移除 USB 设备时,如果未使用该设备,则会从系统的设备分层结构中移除该设备。

如果拔除设备时正在使用该设备,则该设备节点仍然存在,但控制该设备的驱动程序将停止该设备中的所有活动。向此设备发出的任何新的 I/O 活动都会返回错误。

在这种情况下,系统会提示插入原始设备。如果该设备不再可用,请停止应用程序。几秒钟后,端口将再次可用。


注 - 移除活动的设备或打开的设备可能会损害数据完整性。移除设备之前应始终先将其关闭,但连接的键盘和鼠标除外(可在活动状态时将其移除)。


如何添加 USB 海量存储设备

  1. 成为管理员。
  2. 连接 USB 海量存储设备。
  3. 验证是否已添加 USB 设备。

    例如:

    $ rmformat
     Looking for devices...
           1. Logical Node: /dev/rdsk/c3t0d0p0
              Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0
              Connected Device: SanDisk  Cruzer Micro     0.3
              Device Type: Removable
              Bus: USB
              Size: 245.0 MB
              Label: <None>
              Access permissions: Medium is not write protected.
  4. 验证设备是否在 /media 目录下自动挂载。

    例如:

    $ ls /media/NONAME
    aa  bb

    还可以使用 rmmount -l 命令列出可挂载设备的路径和别名。如果设备已挂载在 /media 目录下,将看到与以下内容类似的输出:

    $ rmmount -l
    /dev/dsk/c3t0d0p0:1  rmdisk0,NONAME,/media/NONAME

如何添加 USB 相机

如果相机的介质使用 PCFS 文件系统,其将进行自动挂载。如果该设备未绑定至 scsa2usb 驱动程序,请使用 libusb 应用程序来传送图片。有关更多信息,请参阅 /usr/sfw/share/doc/libusb/libusb.txt

  1. 成为管理员。
  2. 插入并打开 USB 相机。

    系统将为相机创建一个逻辑设备。插入相机后,会将输出写入 /var/adm/messages 文件,以确认设备的连接。系统会将相机视为存储设备。

  3. 检查写入 /var/adm/messages 文件的输出。
    # more /var/adm/messages

    通过检查此输出,可以确定已创建的逻辑设备,这样便可以使用该设备来访问图像。其输出与以下内容类似:

    Jul 15 09:53:35 buffy usba: [ID 349649 kern.info]    OLYMPUS, C-3040ZOOM,
     000153719068
    Jul 15 09:53:35 buffy genunix: [ID 936769 kern.info] scsa2usb1 is 
    /pci@0,0/pci925,1234@7,2/storage@2
    Jul 15 09:53:36 buffy scsi: [ID 193665 kern.info] sd3 at scsa2usb1: 
    target 0 lun 0

    请通过执行以下操作,使该设备与可挂载的 /dev/dsk 链路项匹配:

    # ls -l /dev/dsk/c*0 | grep /pci@0,0/pci925,1234@7,2/storage@2
     lrwxrwxrwx   1 root     root          58 Jun 14  2010 c3t0d0p0 ->
     ../../devices/pci@0,0/pci925,1234@7,2/storage@2/disk@0,0:a
  4. 挂载 USB 相机文件系统。

    该相机的文件系统很可能是 PCFS 文件系统。如果文件系统是 PCFS,则该文件系统应进行自动挂载。

    要在 x86 系统上手动挂载文件系统,可以使用类似以下内容的语法:

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

    要在 SPARC 系统上手动挂载文件系统,可以使用类似以下内容的语法:

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

    有关取消挂载文件系统的信息,请参见挂载和取消挂载 Oracle Solaris 文件系统

    有关挂载不同 PCFS 文件系统的信息,请参见 mount_pcfs(1M)

  5. 验证图像文件是否可用。

    例如:

    # ls /mnt/DCIM/100OLYMP/
    P7220001.JPG*  P7220003.JPG*  P7220005.JPG*
    P7220002.JPG*  P7220004.JPG*  P7220006.JPG*
  6. 查看并处理 USB 相机所创建的图像文件。

    例如:

    # /usr/dt/bin/sdtimage P7220001.JPG &
  7. 断开相机连接之前,取消挂载文件系统。

    例如:

    # umount /mnt
  8. 可选关闭并断开相机连接。

如何移除 USB 海量存储设备

  1. 成为管理员。
  2. 停止使用该设备的所有活动应用程序。
  3. 取消挂载该设备。
    $ rmumount NONAME

    或者,以管理员身份使用 umount 命令。例如:

    # umount /media/NONAME

    有关取消挂载 USB 设备的更多信息,请参见如何挂载或取消挂载 USB 海量存储设备

  4. 移除该设备。

准备使用 USB 海量存储设备

无论是否使用可移除介质服务,都可以访问有关可移除介质的信息。有关使用 GNOME 的文件管理器访问可移除介质相关信息的信息,请参见 GNOME 桌面文档。

格式化 USB 设备后,通常会将该设备挂载于 /media/ label 目录下。

对于字符设备,对应的设备节点是在 /dev/rdsk 目录下创建的,而对于块设备,对应的设备节点是在 /dev/dsk 目录下创建的。设备链接是在热插拔设备时创建的。有关更多信息,请参见 scsa2usb(7D)

如果无法通过可移除介质服务标识设备,请尝试手动挂载设备。首先,使用 rmformat 命令确定设备路径,然后使用 mount 命令以管理员身份手动挂载设备。

如果通过可移除介质服务挂载了设备,可以通过使用 rmumount 命令来取消挂载设备。如果手动挂载了设备,可以使用 umount 命令以管理员身份取消挂载设备。

有关挂载和取消挂载 USB 设备的更多信息,请参见如何挂载或取消挂载 USB 海量存储设备

如何显示 USB 设备信息

如何在 USB 海量存储设备中创建文件系统

必须先格式化 USB 磁盘,然后才能向其中添加文件系统。所有其他的 USB 海量存储设备只需一个文件系统即可使用。格式化 USB 设备时,请牢记以下要点:


注 - 如果需要格式化 USB 磁盘,请仅执行步骤 4-5。


  1. 成为管理员。
  2. 向系统中添加 USB 设备。 有关对 USB 设备进行热插拔的信息,请参见:
  3. (可选的)标识 USB 设备。

    例如:

    # rmformat
    Looking for devices...
         1. Logical Node: /dev/rdsk/c2t0d0p0
            Physical Node: /pci@0,0/pci108e,534a@2,1/hub@7/floppy@1/disk@0,0
            Connected Device: MITSUMI  USB FDD          1039
            Device Type: Floppy drive
            Bus: USB
            Size: 1.4 MB
            Label: <None>
            Access permissions: Medium is not write protected.

    在本示例中,磁盘设备为 c2t0d0p0

  4. 将磁盘插入磁盘驱动器中(如有必要)。
  5. 格式化该磁盘(如有必要)。
    % rmformat -F long raw-device

    例如,在 SPARC 系统上:

    % rmformat -F long /dev/rdsk/c2t0d0s2

    例如,在 x86 系统上:

    % rmformat -F long /dev/rdsk/c3t0d0p0
  6. 确定文件系统类型并确保取消挂载设备。然后,选择以下操作之一:

    有关取消挂载 USB 设备的更多信息,请参见如何挂载或取消挂载 USB 海量存储设备

    • 创建 PCFS 文件系统。

      # mkfs -F pcfs -o nofdisk,size=size raw-device

      以 512 字节块为单位指定 -size 选项。

      以下示例说明如何在 SPARC 系统中的 1.4 MB 磁盘上创建 PCFS 文件系统:

      # mkfs -F pcfs /dev/rdsk/c2t0d0p0
      Construct a new FAT file system on /dev/rdsk/c2t0d0p0: (y/n)? y

      以下示例说明如何在 x86 系统中的 1.4 MB 磁盘上创建 PCFS 文件系统:

      # mkfs -F pcfs /dev/rdsk/c2t0d0s2
      Construct a new FAT file system on /dev/rdsk/c2t0d0s2: (y/n)? y

      以下示例说明如何在 SPARC 系统中的 100 MB USB 内存条上创建 PCFS 文件系统:

      # mkfs -F pcfs /dev/rdsk/c5t0d0s2:c

      以下示例说明如何在 x86 系统中的 100 MB USB 内存条上创建 PCFS 文件系统:

      # mkfs -F pcfs /dev/rdsk/c5t0d0p0:c

      完成此命令可能要用几分钟时间。

    • 创建传统 UFS 文件系统。

      # newfs raw-device

      例如:

      # newfs /dev/rdsk/c4t0d0s7

      对于大容量 USB 硬盘,请考虑使用 newfs -f 4096 选项或 newfs -T 选项。


      注 - 由于磁盘的存储容量有限,因此 UFS 文件系统开销会占用磁盘上的大部分空间。


    有关在 USB 海量存储设备中创建 PCFS 文件系统和修改分片的详细示例,请参见以下两个过程。

如何在 USB 海量存储设备中修改分区和创建 PCFS 文件系统

以下步骤介绍如何删除现有分区、创建新分区,然后在 USB 设备中创建 PCFS 文件系统。执行此任务之前,请确保先备份所有数据。

  1. 成为管理员。
  2. 启动 fdisk 实用程序。

    例如:

    # fdisk /dev/rdsk/c3t0d0p0
  3. 通过选择选项 3 来删除分区。

    例如:

          Total disk size is 29 cylinders
                 Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
              1       Active    Solaris2          1    28      28     97
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Enter Selection: 3
  4. 选择要删除的分区号。

    例如:

          Total disk size is 29 cylinders
                 Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
              1       Active    Solaris2          1    28      28     97
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Specify the partition number to delete (or enter 0 to exit): 1
    
    Partition deleted.
  5. 创建分区。

    例如:

          Total disk size is 29 cylinders
                 Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
    
    WARNING: no partitions are defined!
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Enter Selection: 1
  6. 选择 FAT32 分区类型。
          Total disk size is 29 cylinders
                 Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
    
    WARNING: no partitions are defined!
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Select the partition type to create:
       1=SOLARIS2  2=UNIX        3=PCIXOS     4=Other    
       5=DOS12     6=DOS16       7=DOSEXT     8=DOSBIG
       9=DOS16LBA  A=x86 Boot    B=Diagnostic C=FAT32
       D=FAT32LBA  E=DOSEXTLBA   F=EFI        0=Exit? c
  7. 指定此分区所使用的磁盘百分比。
           Total disk size is 29 cylinders
                  Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
    
    WARNING: no partitions are defined!
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Select the partition type to create:
    Specify the percentage of disk to use for this partition (or type "c" to 
    specify the size in cylinders). 100
  8. 选择新分区应为活动分区还是非活动分区。
                  Total disk size is 29 cylinders
                  Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
    
    WARNING: no partitions are defined!
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Select the partition type to create:
    Should this become the active partition? If yes, it  will be activated 
    each time the computer is reset or turned on.
    Please type "y" or "n". n
  9. 更新磁盘配置并退出。
          Total disk size is 29 cylinders
                 Cylinder size is 2048 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
              1                 Win95 FAT32       1    28      28     97
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Enter Selection: 5
  10. 在此分区中创建 PCFS 文件系统。

    在创建新的文件系统之前,确保取消挂载设备。有关取消挂载 USB 设备的更多信息,请参见如何挂载或取消挂载 USB 海量存储设备

    例如:

    # mkfs -F pcfs -o fat=32 /dev/rdsk/c3t0d0p0:c
    Construct a new FAT file system on /dev/rdsk/c3t0d0p0:c: (y/n)? y

如何在 USB 海量存储设备中创建 Solaris 分区和修改分片

以下步骤说明如何创建 Solaris 分区和修改分片。

执行此任务之前,请务必备份所有数据。

  1. 成为超级用户。
  2. 启动 fdisk 实用程序。

    例如:

    # fdisk /dev/rdsk/c5t0d0s2
    No fdisk table exists. The default partition for the disk is:
    
      a 100% "SOLARIS System" partition
    
    Type "y" to accept the default partition,  otherwise type "n" to edit the
     partition table.
    y
  3. 显示当前的分片。

    例如:

    # prtvtoc /dev/rdsk/c5t0d0s2
    * /dev/rdsk/c5t0d0s2 partition map
    *
    * Dimensions:
    *     512 bytes/sector
    *      63 sectors/track
    *     255 tracks/cylinder
    *   16065 sectors/cylinder
    *    5836 cylinders
    *    5836 accessible cylinders
    *
    * Flags:
    *   1: unmountable
    *  10: read-only
    *
    *                          First     Sector    Last
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
           0      0    00          0  93755340  93755339
           2      0    00          0  93755340  93755339
  4. 创建包含分片信息的文本文件。

    例如:

    slices: 0 = 0, 5GB, "wm", "home" :
            1 = 8225280000, 6GB :
            2 = 0, 44GB, "wm", "backup" :
            6 = 16450560000, 15GB

    请确保每个分片都从柱面边界开始。例如,分片 1 的初始大小为 822280000 字节,即柱面大小与 1000 的乘积(以字节为单位)。

    有关更多信息,请参见 rmformat(1) 中的 -s 选项说明。

  5. 通过包含以上创建的分片文件来创建分片。

    例如:

    # rmformat -s slice_file /dev/rdsk/c5t0d0s2
  6. 查看新的分片信息。

    例如:

    # prtvtoc /dev/rdsk/c5t0d0s2
    * /dev/rdsk/c5t0d0s2 partition map
    *
    * Dimensions:
    *     512 bytes/sector
    *      63 sectors/track
    *     255 tracks/cylinder
    *   16065 sectors/cylinder
    *    5836 cylinders
    *    5836 accessible cylinders
    *
    * Flags:
    *   1: unmountable
    *  10: read-only
    *
    * Unallocated space:
    *       First     Sector    Last
    *       Sector     Count    Sector
    *    10485760   5579240  16064999
    *    28647912   3482088  32129999
    *    63587280  30168060  93755339
    *
    *                          First     Sector    Last
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
           0      8    00          0  10485760  10485759
           1      3    01   16065000  12582912  28647911
           2      5    00          0  92274688  92274687
           6      4    00   32130000  31457280  63587279

如何挂载或取消挂载 USB 海量存储设备

以下步骤说明了如何挂载和取消挂载 USB 海量存储设备。

  1. 成为超级用户或控制台用户。
  2. (可选的)标识该设备。

    例如:

    $ rmformat
     Looking for devices...
           1. Logical Node: /dev/rdsk/c3t0d0p0
              Physical Node: /pci@0,0/pci108e,534a@2,1/storage@3/disk@0,0
              Connected Device: SanDisk  Cruzer Micro     0.3
              Device Type: Removable
              Bus: USB
              Size: 245.0 MB
              Label: <None>
              Access permissions: Medium is not write protected.

    在本示例中,物理磁盘设备为 c2t0d0p0

  3. 选择以下操作之一以挂载或取消挂载 USB 海量存储设备:
    • 以控制台用户身份挂载 USB 海量存储设备。

      可以使用含有设备别名、挂载点或设备路径的 rmmount 命令,类似以下内容:

      $ rmmount rmdisk0
      $ rmmount NONAME
      $ rmmount /dev/dsk/c3t0d0p0:1

      例如:

      $ rmmount NONAME
      NONAME /dev/dsk/c2t0d0p0 mounted
      $ ls /media/NONAME
      AA.TXT
    • 以控制台用户身份取消挂载 USB 海量存储设备。

      例如:

      $ rmumount NONAME  
      NONAME /dev/dsk/c2t0d0p0 unmounted
    • 以超级用户身份挂载 USB 海量存储设备。

      本示例说明如何挂载包含 UFS 文件系统的设备:

      # mount /dev/dsk/c1t0d0s2 /mnt

      本示例说明如何在 SPARC 系统上挂载包含 PCFS 文件系统的设备:

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

      本示例说明如何在 x86 系统上挂载包含 PCFS 文件系统的设备:

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

      本示例说明如何挂载包含只读 HSFS 文件系统的 CD:

      # mount -F hsfs -o ro /dev/dsk/c1t0d0s2 /mnt
    • 以超级用户身份取消挂载 USB 海量存储设备。

      首先,确保无人正在使用该设备中的文件系统。

      例如:

      # fuser -c -u /mnt
      # umount /mnt
  4. 弹出该设备(对于 DVD、CD 或磁盘设备,此操作可选)。

    例如:

    # eject /dev/rdsk/c1t0d0s2

USB 海量存储设备的疑难解答提示

如果在添加或移除 USB 海量存储设备时遇到问题,请牢记以下提示。

请检查 /var/adm/messages 文件中枚举该设备时出现的故障。对于枚举故障,插入 USB 集线器,或移除集线器并将其直接连接至根 USB 集线器。

禁用特定的 USB 驱动程序

通过禁用 USB 设备的客户机驱动程序,可以禁用特定类型的 USB 设备。例如,通过禁用驱动 USB 打印机的 usbprn 驱动程序,可以禁用这些打印机。禁用 usbprn 不会影响其他种类的设备,如 USB 存储设备。

下表提供了一些 USB 设备类型及其对应的驱动程序。

设备类型
要禁用的驱动程序
音频
usb_acusb_as
HID(通常为键盘和鼠标)
hid
存储
scsa2usb
打印机
usbprn
串行
usbser_edge

如果禁用仍与系统连接的 USB 设备的驱动程序,则会显示类似如下的控制台消息:

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

如何禁用特定的 USB 驱动程序

  1. 成为超级用户。
  2. /etc/system 文件中排除驱动程序别名项。

    例如,包含以下排除语句,用于排除 usbprn 驱动程序。

    exclude: usbprn
  3. 重新引导系统。
    # init 6

如何移除未使用的 USB 设备链接

如果在系统电源关闭时移除 USB 设备,请使用此过程。在系统电源关闭时移除 USB 设备可能会保留不存在设备的设备链接。

  1. 成为超级用户。
  2. 关闭可能正在访问该设备的所有应用程序。
  3. 移除特定 USB 类的未使用的链路。

    例如:

    # devfsadm -C -c audio

    或者,直接移除悬而未决的链路:

    # devfsadm -C