在 Oracle® Solaris 11.2 中管理设备

退出打印视图

更新时间: 2014 年 7 月
 
 

显示设备配置信息

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

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

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

运行 prtconfsysdef 命令时,输出可能会在特定设备实例旁显示以下与驱动程序相关的消息行:

device, instance #number (driver not attached)

缺少驱动程序可能指示以下情况之一:

  • 设备没有驱动程序可用。

  • 由于设备未在使用,当前未连接任何驱动程序。当设备未在使用时,其驱动程序会自动卸载。

  • 由于设备本身在该设备实例中不存在,当前未连接任何驱动程序。

    由于系统进程会一直监视系统设备,因此该消息通常指示缺少设备。

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

  • dumpadm

  • format

  • mkfsnewfs

  • swap

    实用程序可能会检测到以下使用情况之一:

  • 设备是 ZFS 存储池的一部分

  • 设备是转储设备或交换设备

  • /etc/vfstab 文件中存在设备的已挂载文件系统或某个项

例如,使用 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 及其他命令显示系统配置信息的不同方法。

示例 1-1  显示基于 SPARC 的系统中的所有设备
$ /usr/sbin/prtconf -v | more
Memory size: 32640 Megabytes
System Peripherals (Software Nodes):

SUNW,SPARC-Enterprise-T5220
.
.
.
location: /dev/chassis/SUN-Storage-J4400.0918QAKA24/SCSI_Device__2/disk
Device Minor Nodes:                    The detailed disk information is described in this section.
dev=(27,40)
dev_path=/pci@0/pci@0/pci@8/pci@0/pci@a/LSILogic,sas@0/sd@2,0:a
spectype=blk type=minor
dev_link=/dev/dsk/c4t2d0s0
dev_path=/pci@0/pci@0/pci@8/pci@0/pci@a/LSILogic,sas@0/sd@2,0:a,raw
spectype=chr type=minor
dev_link=/dev/rdsk/c4t2d0s0
Device Minor Layered Under:
mod=zfs accesstype=blk
dev_path=/pseudo/zfs@0
Minor properties:
name='Nblocks' type=int64 items=1 dev=(27,40)
value=0000000074702c8f
name='Size' type=int64 items=1 dev=(27,40)
value=000000e8e0591e00
.
.
.
示例 1-2  显示基于 SPARC 的系统中某个特定设备的信息

在本示例中,显示了 /dev/dsk/c4t2d0s0sd 实例编号。

# prtconf -v /dev/dsk/c4t2d0s0 | grep instance
sd, instance #5
示例 1-3  仅显示与系统连接的设备
# prtconf | grep -v not
示例 1-4  显示设备使用情况信息

在本示例中,fuser 命令用于显示正在访问 /dev/console 设备的进程。

# fuser -d /dev/console
/dev/console:     5742o    2269o   20322o     858o
示例 1-5  显示基于 x86 的系统的系统配置信息
# 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
.
.
.
示例 1-6  显示基于 x86 的系统的设备配置信息
# 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)
.
.
.