Return to Solaris Home Page.


Understanding Disk Device Files (i.e. breaking down c0t2d0s7)

by Jeff Hunter, Sr. Database Administrator

Overview

Under Solaris, one of the most involved UNIX devices to understand is the disk device file. Here are several key points that may help:

/etc/vfstab

To see the difference between the block device and character device for a device, consider the following. The /etc/vfstab contains entries for a single filesystem on a Solaris server:
/dev/dsk/c0t2d0s7 /dev/rdsk/c0t2d0s7 /opt ufs 3 yes - 
The first 2 fields in the above entry, list the same disk device as both a block device ("dsk") and character device ("rdsk"). The block device is used by mount when mounting the filesystem while the character device is used by fsck when checking the filesystem and newfs when creating the filesystem.. Both fields must be present in /etc/vfstab.

Breaking Down c0t2d0s7

This section breaks down the different components of a disk device file. In this example, I will be using the disk device file: c0t2d0s7. The four components of the disk device file are: controller, target, LUN and slice/partition and further defined in the following table:

c0 This device is attached to controller #0. On a SPARCstation this is usually the on-board SCSI or IDE controller. If this is a PC it usually refers to the first IDE controller on the motherboard.
t2 The device is target #2 - (i.e. the second device on this controller.) On a SCSI controller this is the SCSI target ID and is usually set via a switch on any external enclosure or by jumpers on the disk itself. On an IDE controller target #2 refers to the second IDE disk. With IDE this is generally determined by the device's position on the IDE cable.
d0 The device is Logical Unit / "LUN" #0 (the first) on this target. Under SCSI a single target can support up-to eight devices. This is rarely seen in practice, but some hardware raid controllers use LUNs.
s7 Slice or Partition number 7. Under Solaris, this relates to the partition number as set when using the format command.



Last modified on: Saturday, 18-Sep-2010 18:23:41 EDT
Page Count: 48574