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

文档信息

前言

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

2.  写入 CD 和 DVD(任务)

3.  管理设备(任务)

在设备管理方面的新增功能?

支持 USB 3.0 设备

有关其他设备管理任务的参考信息

管理 Oracle Solaris 中的设备

x86: 确定设备支持

关于设备驱动程序

如何定制驱动程序配置

设备的自动配置

自动配置的功能和优点

不受支持的设备所需的内容

显示设备配置信息

driver not attached 消息

使用中的设备错误检查

如何显示系统配置信息

解决有故障的设备

如何解决有故障的设备

向系统添加外围设备

如何添加外围设备

如何添加设备驱动程序

访问设备

如何创建设备信息

如何管理设备

设备命名约定

逻辑磁盘设备名称

指定磁盘子目录

直接控制器和面向总线的控制器

带有直接控制器的磁盘

带有面向总线的控制器的磁盘

逻辑磁带设备名称

逻辑可移除介质设备名称

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

5.  管理 USB 设备(任务)

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

7.  管理磁盘(概述)

8.  管理磁盘使用(任务)

9.  管理磁盘(任务)

10.  设置磁盘(任务)

11.  使用 COMSTAR 配置存储设备(任务)

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

13.  format 实用程序(参考信息)

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

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

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

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

18.  管理磁带机(任务)

索引

管理 Oracle Solaris 中的设备

以下各节提供关于管理 Oracle Solaris 中的设备所用功能的概述信息:

有关访问设备的信息,请参见访问设备

x86: 确定设备支持

您可以使用设备检测工具确定本 Oracle Solaris 发行版中是否支持 x86 硬件。有关更多信息,请转至 http://www.oracle.com/webfolder/technetwork/hcl/hcts/device_detect.jsp

关于设备驱动程序

一台计算机通常会使用大量外围设备和海量存储设备。例如,您的系统可能装有磁盘驱动器、键盘和鼠标,以及某种 DVD 刻录器。

其他常用的设备包括以下各项:

Oracle Solaris 软件并不直接与所有这些设备进行通信。每种类型的设备都要求不同的数据格式、协议和传输率。

设备驱动程序是一种底层程序,通过它操作系统可与特定硬件通信。驱动程序可用作操作系统对该硬件的“解释程序”。

如何定制驱动程序配置

在 Oracle Solaris 11 发行版中,驱动程序定制在 /etc/driver/drv 目录中,而非 /kernel 目录,与以前的发行版一样。此改进意味着在系统升级时,您的驱动程序定制不会被覆盖。在升级期间保留 /etc/driver/drv 目录中的文件。

对驱动程序配置进行定制通常意味着添加或修改每设备参数或者添加或修改影响所有设备的全局属性。

  1. 成为管理员。
  2. 将初始的供应商所提供的 driver.conf 文件复制到 /etc/driver/drv 目录中。例如:
    # cp /kernel/drv/sd.conf /etc/driver/drv/sd.conf
  3. 修改参数条目并保存文件。

    例如,sd.conf 包括目标 0,lun 0 处的 sd 设备的以下条目:

    name="sd" class="scsi" target=0 lun=0;

    若要为该设备添加 retries 参数,请按照以下所示修改现有的条目:

    name="sd" class="scsi" target=0 lun=0 retries=4;
  4. 显示定制的属性值。例如:
    # prtconf -vu
    sd, instance #1
               Admin properties:
                   name='retries' type=int items=1
                       value=00000004

设备的自动配置

内核包含一个小的通用核心,其中带有一个平台特定的组件和一组模块。在本 Oracle Solaris 发行版中,内核是自动配置的。

内核模块是用于在系统上执行特定任务的一个软件组件。可装入内核模块的一个示例是访问设备时装入的设备驱动程序。

内核模块在下表中介绍。

表 3-2 Solaris 内核模块的说明

位置
目录内容
/platform/`uname -m`/kernel
平台特定的内核组件
/kernel
引导系统所需的通用于所有平台的内核组件
/usr/kernel
特定指令集内通用于所有平台的内核组件

系统可确定在引导时与其连接的设备。然后,内核会对其自身进行动态配置,将所需的模块装入内存中。此时,在访问磁盘和磁带等设备时就会装入设备驱动程序。此过程称为自动配置,因为所有的内核模块在需要时都会自动装入。

通过修改 /etc/system 文件,可以定制装入内核模块的方式。有关修改此文件的说明,请参见 system(4)

自动配置的功能和优点

自动配置的优点如下:

向系统中添加新设备(和驱动程序)时会使用自动配置功能。在以前的发行版中,将设备添加到关闭的系统中时,有必要执行重新配置引导。设备配置增强功能使得在将设备添加到关闭的系统中时,无需重新配置引导。

如果系统组件支持热插拔,当系统仍在运行时,可以在 Oracle Solaris OS 中添加、移除或更换设备。有关热插拔设备的信息,请参见第 4 章

不受支持的设备所需的内容

Oracle Solaris 发行版中包括支持各种标准设备所需的设备驱动程序。可以在 /kernel/drv/platform/`uname -m`/kernel/drv 目录中找到这些驱动程序。

但是,如果购买了不受支持的设备,制造商应该提供正确安装、维护和管理设备所需的软件。

该软件至少包括设备驱动程序及其关联的配置 (.conf) 文件。.conf 文件驻留在 drv 目录中。该软件可能还包括定制维护和管理实用程序,因为该设备可能与 Oracle Solaris 实用程序不兼容。

有关不受支持的设备所需内容的更多信息,请与设备制造商联系。

显示设备配置信息

下表介绍了三个可用于显示系统和设备配置信息的命令。

命令
说明
手册页
prtconf
显示系统配置信息,包括系统设备分层结构描述的内存总量和设备配置。通过此命令显示的输出取决于系统的类型。
sysdef
显示设备配置信息,包括系统硬件、伪设备、可装入模块以及选定的内核参数。
dmesg
显示系统诊断消息以及从上次系统重新引导以来与系统连接的设备的列表。

有关用于标识系统上设备的设备名称的信息,请参见设备命名约定

driver not attached 消息

prtconfsysdef 命令可能会显示以下与驱动程序有关的消息:

device, instance #number (driver not attached)

此消息并不总是表示驱动程序不可用于此设备。此消息表示当前没有向设备实例附加任何驱动程序,因为此节点中不存在任何设备或者设备未在使用中。驱动程序是在访问设备时自动装入的。如果设备未在使用中,则会卸载这些驱动程序。

使用中的设备错误检查

指定的设备在使用中时,用以下实用程序进行检测:

这些增强功能说明这些实用程序可能会检测以下某些使用情况:

例如,如果尝试使用 format 实用程序访问某个活动的设备,您将看到类似于以下内容的消息:

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <FUJITSU-MAY2073RCSUN72G-0401 cyl 8921 alt 2 hd 255 sec 63>
          /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@0,0
          /dev/chassis/SYS/HD0/disk
       1. c1t1d0 <FUJITSU-MAY2073RCSUN72G-0401-68.37GB>
          /pci@0,0/pci1022,7450@2/pci1000,3060@3/sd@1,0
          /dev/chassis/SYS/HD1/disk
Specify disk (enter its number): 0
selecting c1t0d0
[disk formatted]
/dev/dsk/c1t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M).


FORMAT MENU:
.
.
.

如何显示系统配置信息

使用 prtconfsysdef 命令的输出可确定与系统连接的磁盘、磁带和 DVD 设备。这些命令的输出会在设备实例旁边显示 driver not attached 消息。由于这些设备始终受某个系统进程监视,因此 driver not attached 消息通常明确表示该设备实例中不存在任何设备。

使用 sysdef 命令可显示系统配置信息,其中包括伪设备、可装入模块以及选定的内核参数。

示例 3-1 显示系统配置信息

基于 x86 的系统会显示以下 prtconf 输出。

# prtconf
System Configuration:  Oracle Corporation  i86pc
Memory size: 8192 Megabytes
System Peripherals (Software Nodes):

i86pc
    scsi_vhci, instance #0
    pci, instance #0
        pci108e,4843, instance #0
        pci8086,25e2, instance #0
            pci8086,3500, instance #7
                pci8086,3510, instance #9
                pci8086,3518, instance #10
                    pci108e,4843, instance #0
                    pci108e,4843, instance #1
            pci8086,350c, instance #8
        pci8086,25e3 (driver not attached)
        pci8086,25f8, instance #2
            pci108e,286, instance #0
                disk, instance #0
                disk, instance #2
                disk, instance #3
                disk, instance #1
        pci8086,25e5 (driver not attached)
        pci8086,25f9 (driver not attached)
        pci8086,25e7 (driver not attached)
        pci108e,4843, instance #0 (driver not attached)
        pci108e,4843, instance #1
        pci108e,4843, instance #2 (driver not attached)
        pci108e,4843 (driver not attached)
        pci108e,4843 (driver not attached)
        pci108e,4843 (driver not attached)
        pci108e,4843 (driver not attached)
        pci8086,2690, instance #6
            pci108e,125e, instance #2
            pci108e,125e, instance #3
        pci108e,4843, instance #0
        pci108e,4843, instance #1
            device, instance #0
                keyboard, instance #0
                mouse, instance #1
        pci108e,4843, instance #2
        pci108e,4843, instance #3
        pci108e,4843, instance #0
            storage, instance #0
                disk, instance #4
.
.
.

基于 x86 的系统会显示以下 sysdef 输出:

# sysdef
* Hostid
*
  29f10b4d
*
* i86pc Configuration
*
*
* Devices
*
+boot (driver not attached)
memory (driver not attached)
aliases (driver not attached)
chosen (driver not attached)
i86pc-memory (driver not attached)
i86pc-mmu (driver not attached)
openprom (driver not attached)
options, instance #0
packages (driver not attached)
delayed-writes (driver not attached)
itu-props (driver not attached)
isa, instance #0
    motherboard (driver not attached)
    pnpADP,1542, instance #0
    asy, instance #0
    asy, instance #1
    lp, instance #0 (driver not attached)
    fdc, instance #0
        fd, instance #0
        fd, instance #1 (driver not attached)
    kd (driver not attached)
    kdmouse (driver not attached)
.
.
.

解决有故障的设备

设备弃用机制通过故障管理框架 (fault management framework, FMA) 将设备隔离为有故障。通过该功能,可以安全且自动地禁用故障设备,从而避免数据丢失、数据损坏或紧急情况和系统停机。弃用过程安全地执行,考虑弃用设备后的系统稳定性。

永远不弃用关键设备。如果需要手动更换弃用的设备,除了执行手动更换步骤以外,还应在更换设备后使用 fmadm repair 命令,以便系统知道设备已更换。

有关更多信息,请参见 fmadm(1M)

有关设备弃用的一般消息显示在控制台上,并写入 /var/adm/messages 文件中,以使您了解弃用的设备。例如:

Aug 9 18:14 starbug genunix: [ID 751201 kern.notice] NOTICE: One or more I/O devices have been retired

可以使用 prtconf 命令来确定特定的弃用设备。例如:

# prtconf
.
.
.
pci, instance #2
        scsi, instance #0
            disk (driver not attached)
            tape (driver not attached)
            sd, instance #3
            sd, instance #0 (retired)
        scsi, instance #1 (retired)
            disk (retired)
            tape (retired)
    pci, instance #3
        network, instance #2 (driver not attached)
        network, instance #3 (driver not attached)
    os-io (driver not attached)
    iscsi, instance #0
    pseudo, instance #0 
.
.
.

如何解决有故障的设备

使用下面的步骤解决有故障的设备或已弃用的设备。

还可以使用 zpool statusfmadm 命令查看 ZFS 设备问题或故障信息。有关 ZFS 设备问题或故障信息,请参见《Oracle Solaris 11.1 管理:ZFS 文件系统》中的第 10  章 "Oracle Solaris ZFS 故障排除和池恢复"

  1. 使用 fmadm faulty 命令确定发生故障的设备。例如:
    # fmadm faulty
    --------------- ------------------------------------  -------------- ---------
    TIME            EVENT-ID                              MSG-ID SEVERITY
    --------------- ------------------------------------  -------------- ---------
    Jun 20 16:30:52 55c82fff-b709-62f5-b66e-b4e1bbe9dcb1  ZFS-8000-LR Major
    
    Problem Status    : solved
    Diag Engine       : zfs-diagnosis / 1.0
    System
        Manufacturer  : unknown
        Name          : ORCL,SPARC-T3-4
        Part_Number   : unknown
        Serial_Number : 1120BDRCCD
        Host_ID       : 84a02d28
    
    ----------------------------------------
    Suspect 1 of 1 :
       Fault class : fault.fs.zfs.open_failed
       Certainty   : 100%
       Affects     : zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/
    pool_name=pond/vdev_name=id1,sd@n5000c500335dc60f/a
       Status      : faulted and taken out of service
    
       FRU
         Name             : "zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/
    pool_name=pond/vdev_name=id1,sd@n5000c500335dc60f/a"
            Status        : faulty
    
    Description : ZFS device 'id1,sd@n5000c500335dc60f/a' in pool 'pond' failed to
                  open.
    
    Response    : An attempt will be made to activate a hot spare if available.
    
    Impact      : Fault tolerance of the pool may be compromised.
    
    Action      : Use 'fmadm faulty' to provide a more detailed view of this event.
                  Run 'zpool status -lx' for more information. Please refer to the
                  associated reference document at
                  http://support.oracle.com/msg/ZFS-8000-LR for the latest service
                  procedures and policies regarding this diagnosis.
  2. 更换有故障或弃用的设备或清除设备错误。例如:
    # zpool clear pond c0t5000C500335DC60Fd0

    如果设备发生间歇错误,但没有更换该设备,则可以尝试清除先前的错误。

  3. 清除 FMA 故障。例如:
    # fmadm repaired zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/ \
    pool_name=pond/vdev_name=id1,sd@n5000c500335dc60f/a
    fmadm: recorded repair to of zfs://pool=86124fa573cad84e/vdev=25d36cd46e0a7f49/
    pool_name=pond/vdev_name=id1,sd@n5000c500335dc60f/a
  4. 确认故障已清除。
    # fmadm faulty

    如果错误已被清除,则 fmadm faulty 命令不会返回任何内容。