SD(4) NetBSD Programmer's Manual SD(4) NNAAMMEE ssdd - SCSI disk driver SSYYNNOOPPSSIISS ssdd** aatt ssccssiibbuuss?? ttaarrggeett ?? lluunn ?? ssdd33 aatt ssccssiibbuuss00 ttaarrggeett 33 lluunn 00 DDEESSCCRRIIPPTTIIOONN The ssdd driver provides support for a SCSI disk. It allows the disk to be divided up into a set of pseudo devices called _p_a_r_t_i_t_i_o_n_s. In general the interfaces are similar to those described by wd(4). Where the wd(4) device has a fairly low level interface to the system, SCSI devices have a much higher level interface and talk to the system via a SCSI host adapter (e.g., ahc(4)). A SCSI adapter must also be sep- arately configured into the system before a SCSI disk can be configured. When the SCSI adapter is probed during boot, the SCSI bus is scanned for devices. Any devices found which answer as `_D_i_r_e_c_t' type devices will be attached to the ssdd driver. PPAARRTTIITTIIOONNIINNGG On many systems disklabel(8) is used to partition the drive into filesys- tems. On some systems the NetBSD portion of the disk resides within a native partition, and another program is used to create the NetBSD por- tion. For example, the i386 port uses fdisk(8) to partition the disk into a BIOS level partition. This allows sharing the disk with other operating systems. IIOOCCTTLLSS The following ioctl(2) calls apply to SCSI disks as well as to other disks. They are defined in the header file <_d_i_s_k_l_a_b_e_l_._h>. DIOCGDINFO Read, from the kernel, the in-core copy of the disklabel for the drive. This may be a fictitious disklabel if the drive has never been initialized, in which case it will contain in- formation read from the SCSI inquiry commands. DIOCSDINFO Give the driver a new disklabel to use. The driver _w_i_l_l _n_o_t write the new disklabel to the disk. DIOCWLABEL Enable or disable the driver's software write protect of the disklabel on the disk. DIOCWDINFO Give the driver a new disklabel to use. The driver _w_i_l_l write the new disklabel to the disk. DIOCLOCK Lock the media cartridge into the device, or unlock a car- tridge previously locked. Used to prevent user and software eject while the media is in use. DIOCEJECT Eject the media cartridge from a removable device. In addition, the scsi(4) general iiooccttll() commands may be used with the ssdd driver, but only against the `c' (whole disk) partition. NNOOTTEESS If a removable device is attached to the ssdd driver, then the act of changing the media will invalidate the disklabel and information held within the kernel. To avoid corruption, all accesses to the device will be discarded until there are no more open file descriptors referencing the device. During this period, all new open attempts will be rejected. When no more open file descriptors reference the device, the first next open will load a new set of parameters (including disklabel) for the drive. FFIILLEESS /dev/sd_u_p block mode SCSI disk unit _u, partition _p /dev/rsd_u_p raw mode SCSI disk unit _u, partition _p DDIIAAGGNNOOSSTTIICCSS None. SSEEEE AALLSSOO wd(4), disklabel(5), disklabel(8), fdisk(8) HHIISSTTOORRYY The ssdd driver was originally written for Mach 2.5, and was ported to FreeBSD by Julian Elischer. It was later ported to NetBSD. NetBSD January 18, 1996 2