System Administration Guide, Volume 1

Chapter 26 Accessing Devices (Overview)

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 24, Device Management (Overview).

Accessing Devices

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.

How Device Information Is Created

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 the OpenBoot 3.x Command Reference Manual for more information on device hierarchy.

Device Naming Conventions

Devices are referenced in three ways in the Solaris environment.

Logical Disk Device Names

Logical 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.

Graphic

Specifying the Disk Subdirectory

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.

The following table shows which interface is required for a few commonly used disk and file system commands.

Table 26-1 Device Interface Type Required by Some Frequently Used Commands

Command 

Interface Type 

Example of Use 

df(1M)

Block 

df /dev/dsk/c0t3d0s6

fsck(1M)

Raw 

fsck -p /dev/rdsk/c0t0d0s0

mount(1M)

Block 

mount /dev/dsk/c1t0d0s7 /export/home

newfs(1M)

Raw 

newfs /dev/rdsk/c0t0d1s1

prtvtoc(1M)

Raw 

prtvtoc /dev/rdsk/c0t0d0s2

Specifying the Slice

The string 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 26-2 Controller Types

Direct controllers 

Bus-Oriented Controllers 

Xylogics (SPARC) 

SCSI (SPARC/IA) 

IDE (IA) 

IPI (SPARC) 

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.


SPARC: Disks With Direct Controllers

To specify a slice on a disk with a direct controller on a SPARC based system, follow the naming convention shown in the figure below.

Graphic

To indicate the whole disk, specify slice 2 (2).

If you have only one controller on your system, x will always be 0.

IA: Disks With Direct Controllers

To specify a slice on a disk with an IDE controller on an IA based system, follow the naming convention shown in the figure below.

Graphic

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.

SPARC: Disks With Bus-Oriented Controllers

To 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.

Graphic

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

IA: Disks With SCSI Controllers

To specify a slice on a disk with a SCSI controller on an IA based system, follow the naming convention shown in the following figure.

Graphic

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 Names

Logical tape device files are found in the /dev/rmt/* directory as symbolic links from the /devices directory.

Graphic

The first tape device connected to the system is 0 (/dev/rmt/0), which might 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 47, Managing Tape Drives (Tasks).

Logical CD-ROM Device Names

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 14, Guidelines for Using CDs and Diskettes (Overview) for information on accessing your CD-ROM device.