System Administration Guide, Volume I

Chapter 19 Device Management (Overview/Tasks)

The chapter provides overview information about managing peripheral devices in the Solaris environment.

This is a list of overview information in this chapter.

This is a list of step-by-step instructions in this chapter.

For information about accessing devices, see Chapter 20, Accessing Devices (Overview).

Device management in the Solaris environment usually includes adding and removing peripheral devices from systems, possibly adding a third-party device driver to support a device, and displaying system configuration information.

What's New in Device Management?

This section provides information about Solaris 7 features related to device management.

Dynamic Reconfiguration

Dynamic reconfiguration, available on certain SPARC servers, allows a service provider to remove replace hotpluggable system I/O boards in a running system, eliminating the time lost in rebooting. Also, if a replacement board is not immediately available, the system administrator can use dynamic reconfiguration to shut down a failing board while allowing the system to continue operation.

See your hardware manufacturer's documentation for informaiton about whether dynamic reconfiguration is supported on your server.

x86: SCSI Disk Driver (sd)

In previous Solaris release, SCSI disk suport on the Intel platform was handled by the cmdk driver. In the Solaris 7 release, this support is handled by the sd driver. This driver is similar to the SCSI disk driver on Solaris SPARC platforms, which is also named sd.

There is no change in the administration of these devices. System administrators will see references to sd instead of cmdk in the output of prtconf, sysdef, and dmesg commands, as well as the format utility.

Features and functionality are a superset of the features supplied by cmdk, so applications (which use logical disk names in /dev/dsk will not be affected by the driver change. x86 systems with IDE devices will still use the cmdkdriver.

Where to Find Device Management Tasks

Table 19-1 describes where to find step-by-step procedures for adding serial devices, such as printers and modems, and peripheral devices, such as a disk, CD-ROM, or tape drive to your system.

Table 19-1 Where to Find Instructions for Adding a Device

For Information On ... 

See the Following  

Adding a disk 

Chapter 23, SPARC: Adding a Disk (Tasks) or Chapter 24, x86: Adding a Disk (Tasks)

Adding a CD-ROM or tape device  

"How to Add a Peripheral Device"

Adding a modem 

"Managing Terminals and Modems (Overview)" in System Administration Guide, Volume II

Adding a printer 

"Print Management (Overview)" in System Administration Guide, Volume II

About Device Drivers

A computer typically uses a wide range of peripheral and mass-storage devices. Your system, for example, probably has a SCSI disk drive, a keyboard and a mouse, and some kind of magnetic backup medium. Other commonly used devices include CD-ROM drives, printers and plotters, light pens, touch-sensitive screens, digitizers, and tablet-and-stylus pairs.

The Solaris software does not directly communicate with all these devices. Each type of device requires different data formats, protocols, and transmission rates.

A device driver is a low-level program that allows the operating system to communicate with a specific piece of hardware. The driver serves as the operating system's "interpreter" for that piece of hardware.

Automatic Configuration of Devices

The kernel, consisting of a small generic core with a platform-specific component and a set of modules, is configured automatically in the Solaris environment.

A kernel module is a hardware or software component that is used to perform a specific task on the system. An example of a loadable kernel module is a device driver that is loaded when the device is accessed.

The platform-independent kernel is /kernel/genunix. The platform-specific component is /platform/`uname -m`/kernel/unix.

The kernel modules are described in Table 19-2.

Table 19-2 Description of Kernel Modules

Location 

This Directory Contains ... 

/platform/`uname -m` /kernel

Platform-specific kernel components 

/kernel

Kernel components common to all platforms that are needed for booting the system 

/usr/kernel

Kernel components common to all platforms within a particular instruction set 

The system determines what devices are attached to it at boot time. Then the kernel configures itself dynamically, loading needed modules into memory. At this time, device drivers are loaded when devices, such as disk and tape devices, are accessed for the first time. This process is called autoconfiguration because all kernel modules are loaded automatically when needed.

You can customize the way in which kernel modules are loaded by modifying the /etc/system file. See "Tuning Kernel Parameters (Tasks)" in System Administration Guide, Volume II for instructions on modifying this file.

Features and Benefits

The benefits of autoconfiguration are:

The autoconfiguration process is used by a system administrator when adding a new device (and driver) to the system. At this time, the administrator performs a reconfiguration boot so the system will recognize the new device.

What You Need For Unsupported Devices

Device drivers needed to support a wide range of standard devices are included in the Solaris environment. These drivers can be found in the /kernel/drv and /platform/`uname -m`/kernel/drv directories.

However, if you've purchased an unsupported device, the manufacturer should provide the software needed for the device to be properly installed, maintained, and administered.

At a minimum, this software includes a device driver and its associated configuration (.conf) file. The .conf files reside in the drv directories. In addition, the device may be incompatible with Solaris utilities, and may require custom maintenance and administrative utilities.

Contact your device manufacturer for more information.

Adding a Peripheral Device to a System

Adding a new peripheral device usually involves:

Use the procedure below to add the following devices to a system:

In some cases, you may have to add a third-party device driver to support the new device.

How to Add a Peripheral Device

  1. Become superuser.

  2. Follow steps 2 and 3 of "How to a Add a Device Driver" if you need to add a device driver to support the device.

  3. Create the /reconfigure file.


    # touch /reconfigure
    

    The /reconfigure file will cause the Solaris software to check for the presence of any newly installed devices the next time you turn on or boot your system.

  4. Shut down the system.


    # shutdown -i0 -g30 -y
    

    -i0

    Brings the system to the 0 init state, which is the appropriate state for turning the system power off for adding and removing devices. 

    -g30

    Shuts the system down in 30 seconds. The default is 60 seconds. 

    -y

    Continues the system shutdown without user intervention; otherwise, you are prompted to continue the shutdown process. 

  5. Turn off power to the system after it is shut down.

    On SPARC Platforms ... 

    On Intel Platforms ... 

    It is safe to turn off power if the ok or > prompt is displayed.

    It is safe to turn off power if the type any key to continue prompt is displayed.

    Refer to the hardware installation guide that accompanies your system for the location of the power switch.

  6. Turn off power to all external devices.

    For location of power switches on any peripheral devices, refer to the hardware installation guides that accompany your peripheral devices.

  7. Install the peripheral device making sure the device you are adding has a different target number than the other devices on the system.

    You will often find a small switch located at the back of the disk for this purpose.

    Refer to the hardware installation guide that accompanies the peripheral device for information on installing and connecting the device.

  8. Turn on the power to the system.

    The system will boot to multiuser mode and the login prompt will be displayed.

  9. Verify that the peripheral device has been added by attempting to access the device. See Chapter 20, Accessing Devices (Overview) for information on accessing the device.

How to a Add a Device Driver

This procedure assumes that the device has already been added to the system. If not, see "How to Add a Peripheral Device".

  1. Become superuser.

  2. Place the tape, diskette, or CD-ROM into the drive.

  3. Use the pkgadd command install the driver.


    # pkgadd -d device package-name
    

    -d device

    Identifies the device pathname. 

    package-name

    Identifies the package name that contains the device driver. 

  4. Verify that the package has been added correctly by using the pkgchk command. The system prompt returns with no response if the package is installed correctly.


    # pkgchk packagename
    #

Example--Adding a Device Driver

The following example installs and verifies a package called XYZdrv.


# pkgadd XYZdrv
(licensing messages displayed)
.
.
.
Installing XYZ Company driver as <XYZdrv>
.
.
.
Installation of <XYZdrv> was successful.
# pkgchk XYZdrv
#

Displaying Device Configuration Information

Three commands are used to display system and device configuration information:

prtconf(1M)

Displays system configuration information, including total amount of memory and the device configuration as described by the system's device hierarchy. The output displayed by this command depends upon the type of system. 

sysdef(1M)

Displays device configuration information including system hardware, pseudo devices, loadable modules, and selected kernel parameters.  

dmesg(1M)

Displays system diagnostic messages as well as a list of devices attached to the system since the last reboot. 

See "Device Naming Conventions" for information on the device names used to identify devices on the system.

driver not attached Message

The following driver-related message may be displayed by the prtconf and sysdef commands:


device, instance #number (driver not attached)

This message does not always mean that a driver is unavailable for this device. It means that no driver is currently attached to the device instance because there is no device at this node or the device is not in use. Drivers are loaded automatically when the device is accessed and unloaded when the device is not in use.

Identifying a System's Devices

Use the output of prtconf and sysdef commands to identify which disk, tape, and CD-ROM devices are connected to the system. The output of these commands display the driver not attached messages next to the device instances. Since these devices are always being monitored by some system process, the driver not attached message is usually a good indication that there is no device at that device instance.

For example, the following prtconf output identifies a device at instance #3 and instance #6, which is probably a disk device at target 3 and a CD-ROM device at target 6 of the first SCSI host adapter (esp, instance #0).


$ /usr/sbin/prtconf
.
.
.
 
esp, instance #0
            sd (driver not attached)
            st (driver not attached)
            sd, instance #0 (driver not attached)
            sd, instance #1 (driver not attached)
            sd, instance #2 (driver not attached)
            sd, instance #3
            sd, instance #4 (driver not attached)
            sd, instance #5 (driver not attached)
            sd, instance #6
.
.
.

The same device information can be gleaned from the sysdef output.

How to Display System Configuration Information

Use the prtconf command to display system configuration information.


# /usr/sbin/prtconf

Use the sysdef command to display system configuration information including pseudo devices, loadable modules, and selected kernel parameters.


# /usr/sbin/sysdef

Examples--Displaying System Configuration Information

The following prtconf output is displayed on a SPARC system.


# prtconf
System Configuration:  Sun Microsystems  sun4m
Memory size: 32 Megabytes
System Peripherals (Software Nodes):

SUNW,SPARCstation-10
    packages (driver not attached)
        disk-label (driver not attached)
        deblocker (driver not attached)
        obp-tftp (driver not attached)
    options, instance #0
    aliases (driver not attached)
    openprom (driver not attached)
    iommu, instance #0
        sbus, instance #0
            espdma, instance #0
                esp, instance #0
                    sd (driver not attached)
                    st (driver not attached)
                    sd, instance #0 (driver not attached)
                    sd, instance #1
                    sd, instance #2 (driver not attached)
                    sd, instance #3
                    sd, instance #4 (driver not attached)
                    sd, instance #5 (driver not attached)
                    sd, instance #6 (driver not attached)
.
.
.

The following sysdef output is displayed from an x86 system.


# 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)
.
.
.

How to Display Device Information

Display device information with the dmesg command.


# /usr/sbin/dmesg

The dmesg output is displayed as messages on the system console and identifies which devices are connected to the system since the last reboot.

Examples--Displaying Device Information

The following dmesg output is displayed from a SPARC system.


# dmesg
SunOS Release 5.7 Version generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1998, Sun Microsystems, Inc.
pac: enabled - SuperSPARC
cpu0: TI,TMS390Z50 (mid 8 impl 0x0 ver 0x0 clock 40 MHz)
mem = 32768K (0x2000000)
avail mem = 27803648
Ethernet address = 8:0:20:1f:33:9g
root nexus = SUNW,SPARCstation-10
iommu0 at root: obio 0xe0000000
sbus0 at iommu0: obio 0xe0001000
dma0 at sbus0: SBus slot f 0x400000
dma0 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000
/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000 (esp0):
	esp-options=0x46
esp0 at dma0: SBus slot f 0x800000 sparc ipl 4
esp0 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000
sd1 at esp0: target 1 lun 0
sd1 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
	sd3 at esp0: target 3 lun 0
sd3 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
	root on /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0:a ...
obio0 at root
obio0 at obio0: obio 0x100000 sparc ipl 12
zs0 is /obio/zs@0,100000
obio1 at obio0: obio 0x0 sparc ipl 12
zs1 is /obio/zs@0,0
cpu 0 initialization complete - online
ledma0 at sbus0: SBus slot f 0x400010
le0 at ledma0: SBus slot f 0xc00000 sparc ipl 6
le0 is /iommu@f,e0000000/sbus@f,e0001000/ledma@f,400010/le@f,c00000
dump on /dev/dsk/c0t3d0s1 size 200 MB
# 

The following dmesg output is displayed from an x86 system.


# dmesg
SunOS Release 5.7 Version generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1998, Sun Microsystems, Inc.
mem = 130684K (0x7f9f000)
avail mem = 114970624
root nexus = i86pc
isa0 at root
ISA-device: asy0
asy0 is /isa/asy@1,3f8
ISA-device: asy1
asy1 is /isa/asy@1,2f8
pci0 at root: space 0 offset 0
	IDE device at targ 0, lun 0 lastlun 0x0
	model WDC AC31000H, stat 50, err 0
		cfg 0x427a, cyl 2100, hd 16, sec/trk 63
		mult1 0x8010, mult2 0x108, dwcap 0x0, cap 0xf00
		piomode 0x180, dmamode 0x200, advpiomode 0x1
		minpio 380, minpioflow 180
		valid 0x3, dwdma 0x3, majver 0x0
ata_set_feature: (0x66,0x0) failed
ISA-device: ata0
Disk0:	cmdk0 at ata0 target 0 lun 0
cmdk0 is /isa/ata@1,1f0/cmdk@0,0
root on /isa/ata@1,1f0/cmdk@0,0:a fstype ufs
Number of console virtual screens = 13
cpu 0 initialization complete - online
Ethernet address = 2:7:1:1c:27:e5
.
.
.