SOLARIS 9 EXAM OBJECTIVES COVERED IN THIS CHAPTER:
Describe the basic architecture of a local disk and the naming conventions for disk devices as used in the Solaris operating environment.
Explain when and how to list devices, reconfigure devices, perform disk partitioning, and relabel a disk in a Solaris operating environment using the appropriate files, commands, options,
A computer system is basically a
Hard disks are another common system device. Even though some client systems are capable of functioning without one, hard disks are one of the more critical
Although it would be possible to describe every device type you could possibly put into your computer, it would be
As a systems administrator, you should be able to add devices to your system. Depending on your computer's role, either as a stand-alone system or on a network, various peripherals are needed. They could include a tape drive for system
Regardless of the type of device you wish to install, you need to install another component that enables the device to work with Solaris. This
When Solaris boots, the system
Autoconfiguration makes memory usage more efficient, because drivers are loaded only when they are needed. This eliminates "memory hogging" that happens in other operating systems requiring the driver to load and stay perma+++nently loaded in memory. These types of programs are called Terminate and Stay Residents (TSRs). Also, because the kernel is configured dynamically, it's reconfigured automatically-there is no need to reboot the system to rebuild the kernel when loading and unloading device drivers for testing purposes.
Multiple files compose the kernel. The platform-generic portion of the kernel is a file called
. The platform-specific kernel portion is
Solaris comes bundled with many device drivers and natively supports a wide array of hardware products. The pre-installed drivers are located in the /kernel/drv and /platform /` uname -m `/kernel/drv directories.
The ` uname -m ` variable used in this chapter refers to the output that your machine produces when you use the uname -m command. For example, the Sun Blade 100 (part of the sun4u family) would have a platform-specific kernel module of /platform/sun4u/kernel/unix .
If you purchase a device that does not have a driver built into Solaris, you will need to obtain a driver from the device manufacturer. Solaris drivers come in two
Solaris has three commands to display system and device configuration information:
prtconf displays system configuration information. This includes the hardware platform, memory, and device configuration. The output of prtconf will vary widely, based on the devices installed in your computer. Here is a sample portion of a prtconf output:
# prtconf System Configuration: Sun Microsystems sun4u Memory
size: 256 Megabytes System Peripherals (Software Nodes): SUNW,Sun-Blade-100 packages (driver not attached) SUNW,builtin-drivers (driver not attached) deblocker (driver not attached) disk-label (driver not attached) terminal-emulator (driver not attached) obp-tftp (driver not attached) dropins (driver not attached) kbd-translator (driver not attached) ufs- file-system(driver not attached) openprom (driver not attached) client-services (driver not attached) pci, instance #0 ebus, instance #1 flashprom (driver not attached) eeprom(driver not attached) idprom (driver not attached) isa, instance #0 dma, instance #0 floppy, instance #0 parallel, instance #0 power, instance #0 serial, instance #0 serial, instance #1 network, instance #0 usb, instance #0 mouse, instance #0 keyboard, instance #1 ide, instance #0 disk (driver not attached) cdrom(driver not attached) dad, instance #0 sd, instance #0 SUNW,m64B, instance #0 pci, instance #0 SUNW,UltraSPARC-IIe, instance #0 #
Devices are listed in a hierarchical structure, just as the system sees them. All devices that have drivers installed are listed with their instance number. The first instance of each device type will be instance #0. If there are multiple types of the same device, such as serial ports, the second device will be instance #1.
One message you see a lot of in this output is (driver not attached) . This could mean a few things. One possibility is that the device does not have a driver installed. More likely, though, is that the device is simply not being used at the moment. The computer producing this output has a CD-ROM, but the output says the driver is not attached. The CD-ROM does work, and if accessed, the driver will be automatically loaded.
sysdef lists device configuration information, including recognized system hardware, pseudo devices, loadable modules, and some kernel tunable parameters. Here is a portion from a sysdef output:
# sysdef * * Hostid 83150d18 * sun4u Configuration * Devices * pci, instance #0 network, instance #0 ide, instance #0 disk (driver not attached) cdrom (driver not attached) dad, instance #0 sd, instance #0 pseudo, instance #0 clone, instance #0 * * Loadable Objects * * Loadable Object
Path= /platform/sun4u/kernel * genunix unix drv/dma drv/power drv/cpc hard link: sys/cpc drv/sparcv9/su * * System Configuration * swap files swapfiledev swaplo blocks free /dev/dsk/c0t0d0s1 136,1 16 1049312 926880 * * Tunable Parameters * 2449408 maximum memory allowed in buffer cache (bufhwm) 1866 maximum number of processes (v.v_proc) 99 maximum global priority in sys class (MAXCLSYSPRI) 1861 maximum processes per user id (v.v_maxup) 30 auto update time limit in seconds (NAUTOUP) * * IPC Shared Memory * 8388608 max shared memory segment size (SHMMAX) 100 shared memory identifiers (SHMMNI) * * Time Sharing Scheduler Tunables * 60 maximum time sharing userpriority (TSMAXUPRI) SYS system class name(SYS_NAME) #
In all, sysdef can easily produce more than 20 pages of output. To make the information useful, you might want to consider using sysdef more .
The last display command is
# dmesg Tue Aug 20 18:16:42 MDT 2002 Aug 20 17:15:36 Q-Sol genunix: [ID 172905 kern.notice] Copyright \ 1983-2002 Sun Microsystems, Inc. All rights reserved. Aug 20 17:15:36 Q-Sol Use is subject to license terms. Aug 20 17:15:36 Q-Sol genunix: [ID 678236 kern.info] \ Ethernet address = 0:3:ba:15:d:18 Aug 20 17:15:47 Q-Sol genunix: [ID 936769 kern.info] uata0 is /pci@1f,0/ide@d Aug 20 17:15:48 Q-Sol swapgeneric: [ID 308332 kern.info] root on \ /pci@1f, 0/ide@d/disk@0,0:a fstype ufs Aug 20 17:15:49 Q-Sol usba: [ID 855233 kern.info] USB-device: keyboard@4, \ hid1 at bus address 3 Aug 20 17:15:50 Q-Sol unix: [ID 882636 kern.warning] WARNING: \ interrupt level 15 not serviced Aug 20 17:17:06 Q-Sol pseudo: [ID 129642 kern.info] pseudo-device: lockstat0 Aug 20 17:17:07 Q-Sol pcipsy: [ID 370704 kern.
info] PCI-device: pci@5, pci_pci0 #
dmesg shows the date and time of the message, the computer and module generating the message, and then the message or warning itself. Like sysdef , dmesg can produce dozens of pages of output.
Most standard PC devices are compatible with Solaris. Generally speaking, if the device is SCSI, IDE, PCI, or USB, it will work with Solaris. The biggest question is, does the device come with a Solaris device driver? Adding a device to Solaris is accomplished with the following steps:
Log in as root, or assume the superuser or equivalent role.
Prepare Solaris for a reconfiguration boot by creating a /reconfigure file.
# touch /reconfigure
Shut down the computer.
Install the new device into the computer. If the device requires parameter configuration, ensure that the device will not conflict with previously installed
Power on the computer.
After logging in, attempt to access the new device.
If you are unable to access the device, you might need to install the device driver. To install the driver, place the installation media (usually a floppy disk or CD-ROM) into the appropriate drive and use the pkgadd command. For more information on pkgadd , see Chapter 2, "Installation."
If after installing the driver, the device still does not work, it's time to troubleshoot. Check and
Solaris 9 supports the dynamic reconfiguration of devices. If the device and device adapter support hot plugging, you can add or remove devices without rebooting Solaris. If the peripherals that you are configuring do not support hot plugging, you will need to reboot Solaris in order to reconfigure the devices.
Hot plugging is the ability to add or remove components while the system is running. When hot-plugged components are added or removed, Solaris reconfigures the system in a process known as dynamic reconfiguration . With the cfgadm command, you can hot plug and dynamically reconfigure USB and SCSI devices on all Solaris 9 platforms, and PCI devices on Intel platforms.
The cfgadm command not only enables you to add or remove devices while the system is running, but it walks you through the steps required to properly add or remove the device. This command enables you to display and change system component configurations, test devices, and display configuration help messages.
Whereas nearly all USB devices support hot plugging, some SCSI and PCI controllers do not. To see whether your SCSI or PCI adapter supports hot plugging under Solaris 9, check with your hardware vendor or look up your device in the Solaris 9 Hardware Compatibility List .
command displays information about attachment points.
are locations within the system where dynamic reconfiguration can occur. All attachment points have two parts. The first is the
, which is the location in the system that can accept the device. The second is the
With no arguments, the cfgadm command displays the current status of hot-pluggable devices in the system:
# cfgadm Ap_Id Type Receptacle Occupant Condition c0 scsi-bus connected configured unknown usb0/1 unknown empty unconfigured ok usb0/2 usb-mouse connected configured ok usb0/3 unknown empty unconfigured ok usb0/4 usb-kbd connected configured ok #
The Ap_Id represents the attachment point ID. Attachment point IDs can be represented by either their physical or logical name. The physical Ap_Id is the physical name of the attachment point, and the logical Ap_Id is a user-friendly name for the physical point. By default, the logical Ap_Id is displayed by cfgadm .
Receptacles can be in one of three states: connected, disconnected, or empty. Connected means the receptacle has an occupant, and the occupant is available for system access. A disconnected state means that the receptacle has an occupant but has isolated the occupant from normal system operations. This is useful for testing and configuration purposes. Empty implies that the receptacle does not have any
Occupants can be listed as either configured or unconfigured. Configured means that the device is operational. Unconfigured means that the device cannot be accessed for use but can be accessed for configuration purposes.
The Ap_Id can be in one of five conditions: unknown, ok, failing, failed, or unusable. The condition is calculated dynamically. If a working device experiences a critical failure, its condition might go from ok to failing or failed. Devices that are failing, failed, or unusable cannot be used by the system.
The detailed procedures for configuring hot-pluggable USB, SCSI, and PCI adapters are beyond the scope of this book. For more information,
Devices in Solaris 9 can be accessed in most cases by either their physical device name or their logical device name. The physical and logical device
Not only does
directories, it also maintains the
file. This file keeps track of mappings of physical device names to instance
devfsadmd , the daemon version of devfsadm , manages the dynamic updating of the /devices and /dev directories. This daemon is started automatically during the boot process by run control (rc) scripts, so no manual intervention is needed.
The Solaris operating system
The physical device name represents the device's full pathname in the system device hierarchy. Although this name is
Most file system commands use logical device names. This is because multiple file systems can be on one physical device (a hard disk), and referring to the disk as a whole would not properly recognize the logical divisions. Logical device names are stored in the /dev directory and are symbolically linked to files in the /devices directory.
Instance names are essentially abbreviations for devices, as designated by the kernel. These names are stored in the /etc/path_to_inst file.
The key to using device management utilities is to understand which naming convention the application is looking for. For example, the
Whereas a physical name can refer to the specific hard disk, a logical name is required to isolate divisions, or slices, within the disk. Although different commands require different interface names, the two standards used are raw device interfaces and block device interfaces. The only real difference between the two is how information is read from the devices. Raw devices can transfer only small amounts of data at a time, whereas block devices can use a buffer and therefore transfer more information at once. Generally speaking, larger disk transfers increase the efficiency of the disk.
For commands that require the raw disk interface, device names in the /dev/rdsk directory are used. Block device names are stored in the /dev/dsk directory. Accessing disks based on raw and block device names is covered in more depth in Chapter 7, "File System Management."