1 .\" $NetBSD: sd.4,v 1.16 2003/06/27 18:44:51 wiz Exp $
4 .\" Julian Elischer <julian@freebsd.org>. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd SCSI and ATAPI disk driver
35 .Cd "sd* at scsibus? target ? lun ?"
36 .Cd "sd3 at scsibus0 target 3 lun 0"
37 .Cd "sd* at atapibus? drive ? flags 0x0000"
41 driver provides support for
43 bus and Advanced Technology Attachment Packet Interface
46 It allows the disk to be divided up into a set of pseudo devices called
48 In general the interfaces are similar to those described by
53 device has a fairly low level interface to the system,
55 devices have a much higher level interface and talk to the system via a
62 adapter must also be separately configured into the system
65 disk can be configured.
69 adapter is probed during boot, the
71 bus is scanned for devices.
72 Any devices found which answer as
74 type devices will be attached to the
78 For the use of flags with ATAPI devices, see
82 .\"releases prior to 2.1, the first found was attached as
87 .\"Beginning in 2.1 it became possible to lock down the assignment of
90 .\"bus to particular units of the
94 .\"for details on kernel configuration.
98 .\"driver allows the disk to have two levels of partitioning.
99 .\"One layer, called the
101 .\"is used to separate the
103 .\"areas of the disk from areas used by other operating systems.
104 .\"The second layer is the native
106 .\"partitioning scheme,
108 .\"which is used to subdivide the
110 .\"slices into areas for individual filesystems and swap spaces.
111 .\"For more information, see
118 is used to partition the drive into filesystems.
121 portion of the disk resides within a native partition, and another
122 program is used to create the
126 For example, the i386 port uses
128 to partition the disk into a
131 This allows sharing the disk with other operating systems.
133 .\"If an uninitialized disk is opened, the slice table will be
134 .\"initialized with a fictitious
136 .\"slice spanning the entire disk. Similarly, if an uninitialized
138 .\".No non- Ns Tn FreeBSD )
139 .\"slice is opened, its disklabel will be initialized with parameters returned
140 .\"by the drive and a single
142 .\"partition encompassing the entire slice.
143 .\".Sh KERNEL CONFIGURATION
144 .\"It is only necessary to explicitly configure one
146 .\"device; data structures are dynamically allocated as disks are found
150 .Sh CONFIGURATION OPTIONS
153 options may be applied to
155 disks as well as to other disks.
157 .Bl -tag -width SD_IO_TIMEOUT
159 Set the number of retries that will be performed for operations it
160 makes sense to retry (e.g., normal reads and writes). The default
163 Set amount of time, in milliseconds, a normal read or write is expected
164 to take. The defaults is sixty seconds (60000 milliseconds). This is used
165 to set watchdog timers in the
167 HBA driver to catch commands that might have died on the device.
174 disks as well as to other disks.
175 They are defined in the header file
178 .Bl -tag -width DIOCSDINFO
180 .\"Usually used to set up a bad-block mapping system on the disk.
182 .\"drive incorporate their own bad-block mapping so this command is not
185 Read, from the kernel, the in-core copy of the disklabel for the drive.
186 This may be a fictitious disklabel if the drive has never
187 been initialized, in which case it will contain information read
192 Give the driver a new disklabel to use.
196 disklabel to the disk.
198 Keep or drop the in-core disklabel on the last close.
200 Enable or disable the driver's software
201 write protect of the disklabel on the disk.
203 Give the driver a new disklabel to use.
206 write the new disklabel to the disk.
208 Lock the media cartridge into the device, or unlock a cartridge previously
210 Used to prevent user and software eject while the media is in use.
212 Eject the media cartridge from a removable device.
219 commands may be used with the
221 driver, but only against the
223 (whole disk) partition.
225 If a removable device is attached to the
227 driver, then the act of changing the media will invalidate the
228 disklabel and information held within the kernel.
229 To avoid corruption, all accesses to the device will be discarded
230 until there are no more open file descriptors referencing the
232 During this period, all new open attempts will be rejected.
233 When no more open file descriptors reference the device, the first
234 next open will load a new set of parameters (including disklabel)
237 .Bl -tag -width /dev/rsdXXXXX -compact
238 .It Pa /dev/sd Ns Ar u Ns Ar p
245 .It Pa /dev/rsd Ns Ar u Ns Ar p
267 driver was originally written for
269 2.5, and was ported to
272 It was later ported to