This chapter provides overview information and step-by-step instructions for managing peripheral devices, such as disks, CD-ROMs, and tape devices, in the Solaris environment.
This is a list of the step-by-step instructions in this chapter.
This is a list of the overview information in this chapter.
For information about accessing peripheral devices, see Chapter 30, Accessing Devices (Overview).
Device management in the Solaris environment usually involves adding and removing peripheral devices from systems, possibly adding a third-party device driver to support a device, and displaying system configuration information.
The following table describes where to find step-by-step instructions for hot-plugging devices and adding serial devices, such as printers and modems, and peripheral devices, such as a disk, CD-ROM, or tape devices.
Table 27–1 Where to Find Instructions for Adding a Device
Device Management Task |
For More Information |
---|---|
Adding a disk that is not hot-pluggable |
Chapter 34, SPARC: Adding a Disk (Tasks) or Chapter 35, x86: Adding a Disk (Tasks) |
Hot-plugging a SCSI or PCI device |
SCSI Hot-Plugging With the cfgadm Command or x86: PCI Hot-Plugging With the cfgadm Command |
Hot-plugging a USB device | |
Adding a CD-ROM or tape device | |
Adding a modem |
“Managing Terminals and Modems (Overview)” in System Administration Guide: Advanced Administration |
Adding a printer |
“Managing Printing Services (Overview)” in System Administration Guide: Advanced Administration |
A computer typically uses a wide range of peripheral and mass-storage devices. Your system, for example, probably has a 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.
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 the following table.
Table 27–2 Description of Kernel Modules
Location |
Directory Contents |
---|---|
/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. This process is called autoconfiguration because all kernel modules are loaded automatically when they are needed.
You can customize the way in which kernel modules are loaded by modifying the /etc/system file. For instructions on modifying this file, see system(4).
The benefits of autoconfiguration are as follows:
Main memory is used more efficiently because modules are loaded when needed.
There is no need to reconfigure the kernel when new devices are added to the system.
Drivers can be loaded and tested without having to rebuild the kernel and reboot the system.
You will use autoconfiguration is used by a system administrator when you add a new device (and driver) to the system. At this time, you will perform a reconfiguration boot so that the system will recognize the new device.
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 that is 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. This software might also include custom maintenance and administrative utilities since the device might be incompatible with Solaris utilities.
Contact your device manufacturer for more information.
Three commands are used to display system and device configuration information.
Command |
Man Page |
Description |
---|---|---|
prtconf |
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 |
Displays device configuration information including system hardware, pseudo devices, loadable modules, and selected kernel parameters. |
|
dmesg |
Displays system diagnostic messages as well as a list of devices attached to the system since the last reboot. |
For information on the device names that are used to identify devices on the system, see Device Naming Conventions.
The following driver-related message might 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. This message 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.
Use the output of the 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 . . . |
You can use the following command to display only the devices that are attached to the system.
$ prtconf | grep -v not |
You can also glean device information from the sysdef output.
Use the prtconf command to display system configuration information.
# /usr/sbin/prtconf |
Use the sysdef command to display system configuration information that include pseudo devices, loadable modules, and selected kernel parameters.
# /usr/sbin/sysdef |
The following prtconf output is displayed on a SPARC based system.
# prtconf System Configuration: Sun Microsystems sun4u Memory size: 128 Megabytes System Peripherals (Software Nodes): SUNW,Ultra-5_10 packages (driver not attached) terminal-emulator (driver not attached) deblocker (driver not attached) obp-tftp (driver not attached) disk-label (driver not attached) SUNW,builtin-drivers (driver not attached) sun-keyboard (driver not attached) ufs-file-system (driver not attached) chosen (driver not attached) openprom (driver not attached) client-services (driver not attached) options, instance #0 aliases (driver not attached) memory (driver not attached) virtual-memory (driver not attached) pci, instance #0 pci, instance #0 ebus, instance #0 auxio (driver not attached) power, instance #0 SUNW,pll (driver not attached) se, instance #0 su, instance #0 su, instance #1 ecpp (driver not attached) fdthree, instance #0 . . . |
The following sysdef output is displayed from an x86 based 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) . . . |
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.
The following dmesg output is displayed from a SPARC based system.
# dmesg Jan 3 08:44:41 starbug genunix: [ID 540533 kern.notice] SunOS Release 5.9 ... Jan 3 08:44:41 starbug genunix: [ID 913631 kern.notice] Copyright 1983-2002 ... Jan 3 08:44:41 starbug genunix: [ID 678236 kern.info] Ethernet address = ... Jan 3 08:44:41 starbug unix: [ID 389951 kern.info] mem = 131072K (0x8000000) Jan 3 08:44:41 starbug unix: [ID 930857 kern.info] avail mem = 121888768 Jan 3 08:44:41 starbug rootnex: [ID 466748 kern.info] root nexus = Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz) . . . # |
The following dmesg output is displayed from an x86 based system.
# dmesg Jan 2 07:21:46 naboo genunix: [ID 540533 kern.notice] SunOS Release 5.9 Version ... Jan 2 07:21:46 naboo genunix: [ID 913631 kern.notice] Copyright 1983-2002 ... Jan 2 07:21:46 naboo genunix: [ID 897550 kern.info] Using default device ... Jan 2 07:21:46 naboo unix: [ID 168242 kern.info] mem = 130684K (0x7f9f000) Jan 2 07:21:46 naboo unix: [ID 930857 kern.info] avail mem = 116547584 Jan 2 07:21:46 naboo rootnex: [ID 466748 kern.info] root nexus = i86pc Jan 2 07:21:46 naboo rootnex: [ID 349649 kern.info] pci0 at root: ... Jan 2 07:21:46 naboo genunix: [ID 936769 kern.info] pci0 is /pci@0,0 Jan 2 07:21:46 naboo genunix: [ID 678236 kern.info] Ethernet address = ... . . . |
Adding a new (non-hot-pluggable) peripheral device usually involves the following:
Shutting down the system
Connecting the device to the system
Rebooting the system
Use the How to Add a Peripheral Device procedure to add the following devices that are not hot-pluggable to a system:
CD-ROM
Secondary disk drive
Tape drive
SBUS card
In some cases, you might have to add a third-party device driver to support the new device.
For information on hot-plugging devices, see Chapter 28, Dynamically Configuring Devices (Tasks).
Become superuser.
Follow steps 2 and 3 of How to Add a Device Driver if you need to add a device driver to support the device.
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.
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. |
Select one of the following to turn off power to the system after it is shut down.
For SPARC platforms, it is safe to turn off power if the ok prompt is displayed.
For x86 platforms, 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.
Turn off power to all external devices.
For the location of power switches on any peripheral devices, refer to the hardware installation guides that accompany your peripheral devices.
Install the peripheral device, making sure that the device you are adding has a different target number than the other devices on the system.
You often will find a small switch located at the back of the disk for selecting the target number.
Refer to the hardware installation guide that accompanies the peripheral device for information on installing and connecting the device.
Turn on the power to the system.
The system boots to multiuser mode and the login prompt is displayed.
Verify that the peripheral device has been added by attempting to access the device.
For information on accessing the device, see Chapter 30, Accessing Devices (Overview).
This procedure assumes that the device has already been added to the system. If not, see What You Need for Unsupported Devices.
Become superuser.
Place the tape, diskette, or CD-ROM into the drive.
Install the driver.
# pkgadd -d device package-name |
-d device |
Identifies the device path name that contains the package. |
package-name |
Identifies the package name that contains the device driver. |
Verify that the package has been added correctly.
# pkgchk package-name # |
The system prompt returns with no response if the package is installed correctly.
The following example shows how to install and verify a package called XYZdrv.
# pkgadd XYZdrv (licensing messages displayed) . . . Installing XYZ Company driver as <XYZdrv> . . . Installation of <XYZdrv> was successful. # pkgchk XYZdrv # |