Administration Supplement for Solaris Platforms
검색에만이 책은
PDF로 이 문서 다운로드

Accessing Devices on an x86 System

5

This chapter includes the following topics:
  • Device naming conventions
  • Accessing disk and tape devices
  • Accessing CD-ROM devices
This chapter describes the device naming conventions used when accessing peripheral devices such as CD-ROM devices, disks, and tapes.
If you are already familiar with the Solaris 2.x device naming conventions, use the following table to proceed directly to the task-oriented chapters.
Chapter 6, "Booting an x86 System"page 39
Chapter 7, "Setting Up Disks on Your x86 System"page 55
Chapter 8, "Managing File Systems on an x86 System"page 69

x86 Device Naming Conventions in the Solaris 2.x Environment

Device naming conventions in the Solaris 2.x environment are based on logical, not physical, names.
  • A physical device name is derived from how a device is connected to the system at boot time.
  • Logical device names represent the physical devices and are used to access devices when using administration commands.
The device files representing the physical devices names are stored in the /devices directory with a symbolic link to the logical device names in the /dev directory.
The next subsections provide reference material for the various administrative tasks involving disks, tapes, and diskettes described in future chapters of this book and in other books.
x86 Accessing Disk Devices
Many administration commands take arguments that refer to a particular disk or disk slice.
As shown below, you 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.

Imported image(360x70)

x86 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.
  • 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 reference man page for that command.
Table 5-1 shows which interface is required for a few commonly used disk and file-system commands.
Table 5-1
CommandInterface TypeExample of Use
dfBlockdf /dev/dsk/c0t3d0s6
fsckRawfsck -p /dev/rdsk/c0t0d0s0
mountBlockmount /dev/dsk/c1t0d0s7 /export/home/ziggy
newfsRawnewfs /dev/rdsk/c0t0d1s1
prtvtocRawprtvtoc /dev/rdsk/c0t0d0s2
x86 Specifying the Slice
The string you use to identify a specific slice on a specific disk depends on the controller type, either direct (IDE) or bus-oriented (SCSI). The conventions for both types of controllers are explained in the following subsections.
Disks With IDE Controllers To specify a slice on a disk with an IDE controller, follow the naming convention shown in the figure below.

그래픽

Figure 5-1

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.
Disks With SCSI Controllers To specify a slice on a disk with a SCSI controller, follow the naming convention shown in the figure below.

그래픽

Figure 5-2

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

x86 - Controller numbers are assigned automatically at system initialization. The numbers are strictly logical and imply no direct mapping to physical controllers.

x86 Accessing Tape Devices
Logical tape device files are found in the /dev/rmt directory as symbolic links from the /devices directory.

Imported image(360x102)

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.
See the File System Administration guide for more information about accessing tape devices.

x86 Identifying Disk Devices on Your System

If you can't identify the type of disks connected to a system based on the order in which they were added to the system, use the following commands to discover the disk types.
Use the ls -l command to associate a logical device name with its physical device name:

  # ls -l /dev/rdsk/c0t0d0s0  
  lrwxrwxrwx   1 root     root          44 Feb  2 18:08  
  /dev/rdsk/c0t0d0s0 ->  
  ../../devices/eisa/dpt@5c88,0/cmdk@0,0:a,raw  

In the above example, disk 0, target 0 (cmdk@0,0) is connected to the first DPT host adapter (dpt@5...), which is connected to the EISA device (eisa).
Use the format utility output to identify the disks that are recognized on the system. The format output displays a disk's logical and physical device name along with information about the disk's cylinders, heads, and sectors.

  # format  
  Searching for disks...done  
  AVAILABLE DISK SELECTIONS:  
         0. c0t0d0 <DEFAULT cyl 507 alt 2 hd 64 sec 32>  
            /eisa/dpt@5c88,0/cmdk@0,0  
         1. c0t3d0 <DEFAULT cyl 1852 alt 2 hd 15 sec 74>  
            /eisa/dpt@5c88,0/cmdk@3,0  
  Specify disk (enter its number):  

Use the dmesg command to associate the physical and logical device name to the disk's marketing name which appears in brackets <>. The size of the disk might also be displayed in this output after the Product identifier.
In the example output below, match the Diskn identifier with the target number in the logical device name (cwtxdysz) displayed in the format example above.

  # dmesg | grep Disk  
  Disk0:<Vendor 'MAXTOR  ' Product 'LXT-535S        '>  
  Disk3:<Vendor 'SEAGATE ' Product 'ST11200N SUN1.05'>