Previous Page
Next Page

Logical Device Name

The final stage of the autoconfiguration process involves the creation of the logical device name to reflect the new set of devices on the system. To see a list of logical device names for the disks connected to a SPARC system, execute a long listing on the /dev/dsk directory, as follows:

ls -l /dev/dsk

total 96
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s0 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s1 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:b
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s2 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:c
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s3 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:d
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s4 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:e
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s5 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:f
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s6 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:g
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s7 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:h

*Output has been truncated.

On the second line of output from the ls -l command, notice that the logical device name c0t0d0s0 is linked to the physical device name, as shown in the following:

../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a

On Sun SPARC systems, you'll see an eight string logical device name for each disk slice that contains the controller number, the target number, the disk number, and the slice number (c#t#d#s#).

Controller number (c#)

Identifies the host bus adapter (HBA), which controls communications between the system and disk unit. The controller number is assigned in sequential order, such as c0, c1, c2, and so on.

Target number (t#)

Target numbers, such as t0, t1, t2, and t3, correspond to a unique hardware address that is assigned to each disk, tape, or CD-ROM. Some external disk drives have an address switch located on the rear panel. Some internal disks have address pins that are jumpered to assign that disk's target number.

Disk number (d#)

The disk number is also known as the logical unit number (LUN). This number reflects the number of disks at the target location. The disk number is always set to 0 on embedded SCSI controllers.

Slice number (s#)

A slice number ranging from 0 to 7.


X86-based Solaris systems have a different disk naming convention, but before describing the logical device name for a disk on an x86-based system, it's worth pointing out a fundamental difference between disk slicing on a SPARC system and disk slicing on an x86-based system. Disk partitioning on the Solaris for the x86 platform has one more level than that of Solaris for SPARC. On Solaris for SPARC, slices and partitions are one and the same; on Solaris for x86, slices are "subpartitions" of a PC partition. This was done to allow Solaris to coexist with other PC operating systems, such as for dual boot configurations.

This difference in slicing brings some differences in the naming of disk devices on a Solaris x86-based PC. Slices are created in the first Solaris partition on a drive and, for SCSI disks, are named the same as on the Solaris for SPARC (c#t#d0s#). However, because slices are within a PC partition, the PC partitions have their own device names. The entire drive is named c#t#d0p0, and the PC partitions (maximum of 4) are c#t#d0p1 through c#t#d0p4. To support the x86 environment, the format utility also has an added command called fdisk to deal with the PC partitions.

Solaris x86-based systems have 16 slices versus 8 for SPARC. On the x86 PC, slice 8 is used to hold boot code and slice 9 is used for alternate sectors on some types of disks. Higher slices are available for use, but not supported by format at this time.

The major differences between the logical device names used on SPARC-based systems versus x86-based systems are as follows:

  • c is the controller number.

  • t is the SCSI target number.

  • s is the slice number.

  • p represents the fdisk partition (not slice partition).

  • d is the LUN number or IDE Drive Number.

If an IDE drive is used, d is used to determine MASTER or SLAVE and the t is not used for IDE drives. For example, two controllers are installed on an x86 PC:

  • c0 is an IDE controller.

  • c1 is a SCSI controller.

On an x86-based Solaris system, the following devices are listed in the /dev/dsk directory:

c0d0p0      c0d0s7        c1t0d0s4     c1t1d0s15    c1t2d0s12    c1t5d0s1     c1t6d0p3
c0d0p1      c0d0s8        c1t0d0s5     c1t1d0s2     c1t2d0s13    c1t5d0s10    c1t6d0p4
c0d0p2      c0d0s9        c1t0d0s6     c1t1d0s3     c1t2d0s14    c1t5d0s11    c1t6d0s0
c0d0p3      c1t0d0p0      c1t0d0s7     c1t1d0s4     c1t2d0s15    c1t5d0s12    c1t6d0s1
c0d0p4      c1t0d0p1      c1t0d0s8     c1t1d0s5     c1t2d0s2     c1t5d0s13    c1t6d0s10
c0d0s0      c1t0d0p2      c1t0d0s9     c1t1d0s6     c1t2d0s3     c1t5d0s14    c1t6d0s11
c0d0s1      c1t0d0p3      c1t1d0p0     c1t1d0s7     c1t2d0s4     c1t5d0s15    c1t6d0s12
c0d0s10     c1t0d0p4      c1t1d0p1     c1t1d0s8     c1t2d0s5     c1t5d0s2     c1t6d0s13
c0d0s11     c1t0d0s0      c1t1d0p2     c1t1d0s9     c1t2d0s6     c1t5d0s3     c1t6d0s14
c0d0s12     1t0d0s1       c1t1d0p3     c1t2d0p0     c1t2d0s7     c1t5d0s4     c1t6d0s15
c0d0s13     c1t0d0s10     c1t1d0p4     c1t2d0p1     c1t2d0s8     c1t5d0s5     c1t6d0s2
c0d0s14     c1t0d0s11     c1t1d0s0     c1t2d0p2     c1t2d0s9     c1t5d0s6     c1t6d0s3
c0d0s15     c1t0d0s12     c1t1d0s1     c1t2d0p3     c1t5d0p0     c1t5d0s7     c1t6d0s4
c0d0s2      c1t0d0s13     c1t1d0s10    c1t2d0p4     c1t5d0p1     c1t5d0s8     c1t6d0s5
c0d0s3      c1t0d0s14     c1t1d0s11    c1t2d0s0     c1t5d0p2     c1t5d0s9     c1t6d0s
c0d0s4      c1t0d0s15     c1t1d0s12    c1t2d0s1     c1t5d0p3     c1t6d0p0     c1t6d0s7
c0d0s       c1t0d0s2      c1t1d0s13    c1t2d0s10    c1t5d0p4     c1t6d0p1     c1t6d0s8
c0d06       c1t0d0s3      c1t1d0s14    c1t2d0s11    c1t5d0s0     c1t6d0p2     c1t6d0s9

It's easy to see which devices are IDE disks because they do not have a "t" in the logical device name, while the SCSI disks with "c1" have a target number listed. This system has one IDE drive and five SCSI drives listed, targets 0, 1, 2, 5, and 6 (t6 is typically the CD-ROM).

Note

In this text and in the examples, unless otherwise noted, I will be using SPARC-based logical device names.


On both SPARC-based and x86-based systems, the logical device name is the name that the system administrator uses to refer to a particular device when running various Solaris file system commands. For example, if running the mount command, use the logical device name /dev/dsk/c0t0d0s7 to mount the file system /home:

mount /dev/dsk/c0t0d0s7 /home

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 if you do any of the following:

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

  • Repair a file system.

Logical devices are organized in subdirectories under the /dev directory by their device types, as shown in Table 1.3.

Table 1.3. Device Directories

Directory

Description of Contents

/dev/dsk

Block interface to disk devices

/dev/rdsk

Raw or character interface to disk devices

/dev/rmt

Tape devices

/dev/term

Serial line devices

/dev/cua

Dial-out modems

/dev/pts

Pseudo terminals

/dev/fbs

Frame buffers

/dev/sad

STREAMS administrative driver

/dev/md

Metadevices managed by Solaris Volume Manager (SVM)

/dev/vx

Devices managed by Veritas Volume Manager


Block and Raw Devices

Disk drives have an entry under both the /dev/dsk and /dev/rdsk directories. The /dsk directory refers to the block or buffered device file, and the /rdsk directory refers to the character or raw device file. The "r" in rdsk stands for "raw." You may even hear these devices referred to as "cooked" and "uncooked" devices. If you are not familiar with these devices, refer to Chapter 2, "Installing the Solaris 10 Operating Environment," where block and character devices are described.

The /dev/dsk directory contains the disk entries for the block device nodes in /devices, as shown in the following command output:

# ls -l /dev/dsk
total 96
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s0 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s1 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:b
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s2 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:c
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s3 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:d
lrwxrwxrwx   1 root     root          46 Mar 23 15:05 c0t0d0s4 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:e
...
...

The /dev/rdsk directory contains the disk entries for the character device nodes in /devices, as shown in the following command:

# ls -l /dev/rdsk
total 96
lrwxrwxrwx   1 root     root          50 Mar 23 15:05 c0t0d0s0 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw
lrwxrwxrwx   1 root     root          50 Mar 23 15:05 c0t0d0s1 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:b,raw
lrwxrwxrwx   1 root     root          50 Mar 23 15:05 c0t0d0s2 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:c,raw
lrwxrwxrwx   1 root     root          50 Mar 23 15:05 c0t0d0s3 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:d,raw
lrwxrwxrwx   1 root     root          50 Mar 23 15:05 c0t0d0s4 -> \
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:e,raw

*Output has been truncated.

You should now have an understanding of how Solaris identifies disk drives connected to the system. The remainder of this chapter describes how to create file systems on these devices. It will also describe how to manage file systems and monitor disk space usage, some of the fundamental concepts you'll need for the first exam.

Exam Alert

Make sure you understand when to use a raw device and when to use a buffered device. You'll encounter several questions on the exam where you will need to select either the raw or buffered device for a particular command.



Previous Page
Next Page