This part provides instructions for managing devices in the Solaris 2.x environment. This part contains these chapters.
Provides a high-level overview of device configuration and step-by-step instructions for configuring devices. |
|
Provides an overview of device naming conventions and instructions for accessing devices. |
The chapter provides overview information about managing peripheral devices in the Solaris 2.x 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 2.x 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.
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 | |
Adding a modem | |
Adding a printer |
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.
The kernel, consisting of a small generic core with a platform-specific component and a set of modules, is configured automatically in the Solaris 2.x 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 Chapter 66, Tuning Kernel Parameters (Tasks) for instructions on modifying this file.
The benefits of autoconfiguration are:
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.
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.
Device drivers needed to support a wide range of standard devices are included in the Solaris 2.x 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 2.x utilities, and may require custom maintenance and administrative utilities.
Contact your device manufacturer for more information.
Adding a new peripheral device usually involves:
Shutting down the system
Connecting the device to the system
Rebooting the system
Use the procedure below to add the following devices to a system:
CD-ROM
Secondary disk drive
Tape drive
SBUS card
In some cases, you may have to add a third-party device driver to support the new device.
Become superuser.
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.
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. |
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.
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.
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.
Turn on the power to the system.
The system will boot to multiuser mode and the login prompt will be displayed.
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.
This procedure assumes that the device has already been added to the system. If not, see "How to Add a Peripheral Device".
Become superuser.
Place the tape, diskette, or CD-ROM into the drive.
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. |
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 # |
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 |
Three commands are used to display system and device configuration information:
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. |
See "Device Naming Conventions" for information on the device names used to identify devices on the system.
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.
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.
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 |
The following prtconf output is displayed on a SPARC system.
# prtconf System Configuration: Sun Microsystems sun4c Memory size: 32 Megabytes System Peripherals (Software Nodes): SUNW,Sun 4_50 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) zs, instance #0 zs, instance #1 audio (driver not attached) eeprom (driver not attached) counter-timer (driver not attached) memory-error (driver not attached) interrupt-enable (driver not attached) auxiliary-io (driver not attached) sbus, instance #0 dma, instance #0 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 following sysdef output is displayed from an x86 system.
# sysdef * * Hostid * 24b02304 * * i86pc Configuration * * * Devices * eisa, instance #0 kd, instance #0 eha, instance #0 cmdk, instance #0 cmdk, instance #1 (driver not attached) cmdk, instance #2 (driver not attached) cmdk, instance #3 (driver not attached) cmdk, instance #4 (driver not attached) cmdk, instance #5 (driver not attached) cmdk, instance #6 . . . |
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 system.
# dmesg Dec 12 16:22 SunOS Release 5.6 Version [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. pac: enabled - SuperSPARC cpu0: TI,TMS390Z50 (mid 8 impl 0x0 ver 0x3 clock 50 MHz) mem = 32768K (0x2000000) avail mem = 28016640 Ethernet address = 8:0:20:79:7a:e5 root nexus = SUNW,SPARCstation-20 iommu0 at root: obio 0xe0000000 sbus0 at iommu0: obio 0xe0001000 espdma0 at sbus0: SBus slot f 0x400000 esp0: esp-options=0x46 esp0 at espdma0: SBus slot f 0x800000 sparc ipl 4 sd3 at esp0: target 3 lun 0 sd3 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 sd5 at esp0: target 5 lun 0 sd5 is /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@5,0 root on /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0:a fstype ufs obio0 at root zs0 at obio0: obio 0x100000 sparc ipl 12 zs0 is /obio/zs@0,100000 zs1 at obio0: obio 0x0 sparc ipl 12 zs1 is /obio/zs@0,0 cgsix0 at sbus0: SBus slot 2 0x0 SBus level 5 sparc ipl 9 cgsix0 is /iommu@f,e0000000/sbus@f,e0001000/cgsix@2,0 cgsix0: screen 1152x900, single buffered, 1M mappable, rev 11 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 102804K # |
The following dmesg output is displayed from an x86 system.
# dmesg Nov 12 10:30 SunOS Release 5.6 Version [UNIX(R) System V Release 4.0] Copyright (c) 1983-1997, Sun Microsystems, Inc. mem = 15992K (0xf9e000) avail mem = 12070912 root nexus = i86pc eisa0 at root EISA-device: dpt6 Disk0: <Vendor `MAXTOR ` Product `LXT-535S `> cmdk0 at dpt6 target 0 lun 0 cmdk0 is /eisa/dpt@5c88,0/cmdk@0,0 Disk6: <Vendor `SONY ` Product `CD-ROM CDU-8012 `> cmdk6 at dpt6 target 6 lun 0 cmdk6 is /eisa/dpt@5c88,0/cmdk@6,0 EISA-device: asy0 asy0 is /eisa/asy@3f8,0 Ethernet address = 0:0:c0:68:14:5d SMC WD8003/WD8013 driver: type=WD8013W addr=00 00 c0 68 14 5d EISA-device: smc0 smc0 is /eisa/smc@0,c0000 dump on /dev/dsk/c0t0d0s1 size 32756K NOTICE: GIO_KEYMAP type 0 NOTICE: PIO_KEYMAP type 0 NOTICE: INSTALLING new map of type USL FORMAT NOTICE: IN i8042_acquire NOTICE: out i8042_acquire NOTICE: rv was 1 NOTICE: IN i8042_release NOTICE: about to enable keyboard NOTICE: out i8042_release Nov 30 17:19:31 sendmail[171]: network daemon starting |
This chapter provides information about how system administrators access the devices on their systems.
This is a list of overview information in this chapter.
For overview information about configuring devices, see Chapter 19, Device Management (Overview/Tasks).
System administrators need to know how to specify device names when using commands to manage disks, file systems, and other devices. In most cases, system administrators use logical device names to represent devices connected to the system. Both logical and physical device names are represented on the system by logical and physical device files.
When a system is booted for the first time, a device hierarchy is created to represent all the devices connected to the system. The kernel uses the device hierarchy information to associate drivers with their appropriate devices, and provides a set of pointers to the drivers that perform specific operations. See OpenBoot 3.x Command Reference Manual for more information on device hierarchy information.
Devices are referenced in three ways in the Solaris 2.x environment.
Physical device name - Represents the full device pathname in the device information hierarchy. Physical device names are displayed using the following commands:
dmesg
format
sysdef
prtconf
Physical device files are found in the /devices directory.
Instance name - Represents the kernel's abbreviation name for every possible device on the system. For example, sd0 and sd1 represent the instance names of two disk devices. Instance names are mapped in the /etc/path_to_inst file and are displayed using the following commands:
dmesg
sysdef
prtconf
Logical device name - Used by system administrators with most file system commands to refer to devices. See Table 20-1 for a list of file commands that use logical device names. Logical device files in the /dev directory are symbolically linked to physical device files in the /devices directory.
Logical device names are used to access disk devices when you:
Add a new disk to the system
Move a disk from one system to another
Access (or mount) a file system residing on a local disk
Back up a local file system
Many administration commands take arguments that refer to a disk slice or file system.
Refer to a disk device by specifying the subdirectory to which it is symbolically linked (either /dev/dsk or /dev/rdsk), followed by a string identifying the particular controller, disk, and slice.
Disk and file administration commands require the use of either a raw (or character) device interface, or a block device interface. The distinction is made by how data is read from the device.
Raw device interfaces transfer only small amounts of data at a time. Block device interfaces include a buffer from which large blocks of data are read at once.
Different commands require different interfaces.
When a command requires the raw device interface, specify the /dev/rdsk subdirectory. (The "r" in rdsk stands for "raw.")
When a command requires the block device interface, specify the /dev/dsk subdirectory.
When you're not sure whether a command requires use of /dev/dsk or /dev/rdsk, check the man page for that command.
Table 20-1 shows which interface is required for a few commonly used disk and file system commands.
Table 20-1 Device Interface Type Required by Some Frequently Used Commands
Command |
Interface Type |
Example of Use |
---|---|---|
Block |
df /dev/dsk/c0t3d0s6 |
|
Raw |
fsck -p /dev/rdsk/c0t0d0s0 |
|
Block |
mount /dev/dsk/c1t0d0s7 /export/home/ziggy |
|
Raw |
newfs /dev/rdsk/c0t0d1s1 |
|
Raw |
prtvtoc /dev/rdsk/c0t0d0s2 |
The string you use to identify a specific slice on a specific disk depends on the controller type, either direct or bus-oriented. Table 20-2 describes the different types of direct or bus-oriented controllers on different platforms.
Table 20-2 Controller Types
Direct controllers |
Bus-Oriented Controllers |
---|---|
Xylogics (SPARC) |
SCSI (SPARC/x86) |
IDE (x86) |
IPI (SPARC) |
The conventions for both types of controllers are explained in the following subsections.
Controller numbers are assigned automatically at system initialization. The numbers are strictly logical and imply no direct mapping to physical controllers.
To specify a slice on a disk with a direct controller on a SPARC system, follow the naming convention shown in Figure 20-1.
To indicate the whole disk, specify slice 2 (2).
If you have only one controller on your system, x will always be 0.
To specify a slice on a disk with an IDE controller on an x86 system, follow the naming convention shown in Figure 20-2.
To indicate the entire Solaris fdisk partition, specify slice 2 (s2).
If you have only one controller on your system, w will always be 0.
To specify a slice on a disk with a bus-oriented controller (SCSI, for instance) on a SPARC system, follow the naming convention shown in Figure 20-3.
If you have only one controller on your system, w will always be 0.
For SCSI controllers, x is the target address as set by the switch on the back of the unit, and y is the logical unit number (LUN) of the drive attached to the target. If the disk has an embedded controller, y is usually 0.
To indicate the whole disk, specify slice 2 (s2).
To specify a slice on a disk with a SCSI controller on an x86 system, follow the naming convention shown in Figure 20-4.
If you have only one controller on your system, v will always be 0.
For SCSI controllers, w is the target address as set by the switch on the back of the unit, and x is the logical unit number (LUN) of the drive attached to the target. If the disk has an embedded controller, x is usually 0.
To indicate the entire Solaris fdisk partition, specify slice 2 (s2).
Logical tape device files are found in the /dev/rmt/* directory as symbolic links from the /devices directory.
The first tape device connected to the system is 0 (/dev/rmt/0), which may be one of the following types: QIC-11, QIC-24, QIC-150, or Exabyte. Tape density values (l, m, h, c, and u) are described in Chapter 38, Managing Tape Drives (Tasks).
The logical device name that represents the first CD-ROM device on a system is /dev/dsk/c0t6d0s0.
Since CD-ROMS are managed by Volume Management, the logical CD-ROM device name is usually not used unless you want to mount the CD manually. See Chapter 11, Guidelines for Using CDs and Diskettes (Overview), for information on accessing your CD-ROM device.