|
|
Chapter 29 Accessing Devices (Overview)This chapter provides information about how to access the devices on a system. This is a list of the overview information in this chapter. For overview information about configuring devices, see Chapter 26, Managing Devices (Tasks). Accessing DevicesYou need to know how to specify device names when using commands to manage disks, file systems, and other devices. In most cases, you can use logical device names to represent devices that are connected to the system. Both logical and physical device names are represented on the system by logical and physical device files. How Device Information Is CreatedWhen 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. For more information on device hierarchy, see OpenBoot 3.x Command Reference Manual. How Devices Are ManagedThe devfsadm command manages the special device files in the /dev and /devices directories. By default, the devfsadm command attempts to load every driver in the system and attach to all possible device instances. Then, devfsadm creates the device files in the /devices directory and the logical links in the /dev directory. In addition to managing the /dev and /devices directories, the devfsadm command also maintains the path_to_inst(4) instance database. Both reconfiguration boot processing and updating the /dev and /devices directories in response to dynamic reconfiguration events is handled by devfsadmd, the daemon version of the devfsadm command. This daemon is started from the /etc/rc* scripts when a system is booted. Since the devfsadmd daemon automatically detects device configuration changes generated by any reconfiguration event, there is no need to run this command interactively. For more information, see devfsadm(1M). Device Naming ConventionsDevices are referenced in three ways in the Solaris environment.
Logical Disk Device NamesLogical device names are used to access disk devices when you:
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. Figure 29–1 Logical Device Names
Specifying the Disk SubdirectoryDisk 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.
The following table shows which interface is required for some commonly used disk and file system commands. Table 29–1 Device Interface Type Required by Some Frequently Used Commands
Specifying the SliceThe string that you use to identify a specific slice on a specific disk depends on the controller type, either direct or bus-oriented. The following table describes the different types of direct or bus-oriented controllers on different platforms. Table 29–2 Controller Types
The conventions for both types of controllers are explained in the following subsections. Note – Controller numbers are assigned automatically at system initialization. The numbers are strictly logical and imply no direct mapping to physical controllers. x86: Disks With Direct ControllersTo specify a slice on a disk with an IDE controller on an IA based system, follow the naming convention shown in the following figure. Figure 29–2 IA: Disks with Direct Controllers
To indicate the entire Solaris fdisk partition, specify slice 2 (s2). If you have only one controller on your system, w is usually 0. SPARC: Disks With Bus-Oriented ControllersTo specify a slice on a disk with a bus-oriented controller, SCSI for instance, on a SPARC based system, follow the naming convention shown in the following figure. Figure 29–3 SPARC: Disks With Bus-Oriented Controllers
On a SPARC based system with directly connected disks such as the IDE disks on a Ultra10, the naming convention is the same as that for systems with bus-oriented controllers. If you have only one controller on your system, w is usually 0. For SCSI controllers, x is the target address 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). x86: Disks With SCSI ControllersTo specify a slice on a disk with a SCSI controller on an IA based system, follow the naming convention shown in the following figure. Figure 29–4 IA: Disks with SCSI Controllers
If you have only one controller on your system, v is usually 0. For SCSI controllers, w is the target address 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 NamesLogical tape device files are found in the /dev/rmt/* directory as symbolic links from the /devices directory. Figure 29–5 Logical Tape Device Names
The first tape device connected to the system is 0 (/dev/rmt/0). Tape density values (l, m, h, c, and u) are described in Chapter 51, Managing Tape Drives (Tasks). Logical Removable Media Device NamesSince removable media is managed by volume management (vold), the logical device name is usually not used unless you want to mount the media manually. The logical device name that represents the removable media devices on a system are described in Chapter 18, Accessing Removable Media (Tasks). |
||||||||||||||||||||||||||