sd(7) DEVICES AND MODULES sd(7)
NAME
sd - SCSI disk device driver
SYNOPSIS
/dev/sd[00-07]
/dev/rsd[00-07]
DESCRIPTION
sd is the SCSI disk device driver. This driver supports 3
types of SCSI drives:
Sealed (Winchester) hard disk drives
Magneto-optical drives
CD-ROM drives
sd recognizes direct access drives (SCSI device type 0x00)
and read-only direct access devices (SCSI device type 0x05).
The SCSI disk subsystem may consist of up to 8 partitions in
different disk sizes; for example, 286MB or 640MB. The
files /dev/dsk/c0d0s0 ... /dev/dsk/c0d0s7 refer to different
partitions of the first SCSI disk.
The /dev/dsk files provide access to the disk via the
system's normal buffering mechanism. There is also a raw
(character) interface which provides for direct transfer of
a specified number of bytes between the disk and a location
in the user's address space. The names of the raw disk
files are in directory /dev/rdsk and are the same as the
corresponding /dev/dsk files. In raw I/O the read or write
must begin on a word boundary; transfer counts can be as
small as a single byte.
Disk device file names are in the following format:
/dev/{r}dsk/c#d#s#
where r indicates a raw interface to the disk, the c# indi-
cates the controller number, d# indicates the device
attached to the controller (unit number) and s# indicates
the partition number of the disk.
For a controller with more than one SCSI bus, the controller
numbers are defined as follows:
c0 - c7 first SCSI bus
c8 - c15 second SCSI bus
...
The unit number of the internal SCSI hard disk is usually 0
1
sd(7) DEVICES AND MODULES sd(7)
(d0).
The first partition of the root disk is usually used for the
root file system. The second partition of the root disk is
used for swap space.
Partition number 2 (/dev/dsk/c#d0s2, /dev/rdsk/c#d0s2) in
the disk partition table is used for the entire disk.
SUPPORTED DEVICES
The devices supported by the driver are described in
/usr/include/io/sddefs.h. At boot time, the driver reads
the volume table of contents (VTOC) and uses this informa-
tion to determine the sizes and offsets of the different
partitions on a disk.
For those disks without a valid label, the device informa-
tion table, sddevinfo, in /usr/include/io/sddefs.h is used
to calculate capacity and partition sizes. Thus, it is very
important that a valid VTOC exist on the disk.
New devices can be supported by adding device information to
this table. However, avoid changing data recorded in an
existing device information table.
Refer to /usr/include/io/sdreg.h for the format of a device
information table.
Devices with removeable media are automatically spun up or
down at open and close, respectively. While the device is
open, attempts to eject the media are not allowed.
IOCTLS
sd ioctls are located in the following files:
/usr/include/io/dkio.h
/usr/include/io/sdreg.h
/usr/include/io/scu.h
/usr/include/io/cdctl.h
/usr/include/io/diskinfo.h
/usr/include/io/disklabel.h
/usr/include/io/dk.h
FILES
/dev/dsk/c#d0s#
/dev/rdsk/c#d0s#
/usr/include/io/sddefs.h disk device information file
/usr/include/io/sdreg.h ioctl command/structure defini-
tion
/usr/include/io/dkio.h ioctl command/structure defini-
tion
/usr/include/io/scu.h ioctl command/structure defini-
tion
2
sd(7) DEVICES AND MODULES sd(7)
/usr/include/io/cdctl.h ioctl command/structure defini-
tion for CD-ROM
SEE ALSO
format(1M) media format command
fmthard(1M) disk label and partition command
prtvtoc(1M) print label command
newfs(1M) front end for mkfs
/etc/disktab disk partition table
3