Remove the old release infrastructure documentation inherited from
[dragonfly.git] / share / man / man4 / da.4
1 .\" Copyright (c) 1996
2 .\"     Julian Elischer <julian@FreeBSD.org>.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\"
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD: src/share/man/man4/da.4,v 1.22.2.7 2001/10/01 13:07:23 dd Exp $
27 .\" $DragonFly: src/share/man/man4/da.4,v 1.3 2004/03/11 12:28:55 hmp Exp $
28 .\"
29 .Dd October 15, 1998
30 .Dt DA 4
31 .Os
32 .Sh NAME
33 .Nm da
34 .Nd SCSI Direct Access device driver
35 .Sh SYNOPSIS
36 .Cd device da
37 .Cd device da1 at scbus0 target 4 unit 0
38 .Sh DESCRIPTION
39 The
40 .Nm
41 driver provides support for all
42 .Tn SCSI
43 devices of the direct access class that are attached to the system
44 through a supported
45 .Tn SCSI
46 Host Adapter.
47 The direct access class includes disk, magneto-optical,
48 and solid-state devices.
49 .Pp
50 A
51 .Tn SCSI
52 Host
53 adapter must also be separately configured into the system
54 before a
55 .Tn SCSI
56 direct access device can be configured.
57 .Sh PARTITIONING
58 The
59 .Nm
60 driver allows the disk to have two levels of partitioning.
61 One layer, called the
62 .Dq slice layer ,
63 is used to separate the
64 .Dx
65 areas of the disk from areas used by other operating systems.
66 The second layer is the native
67 .Bx 4.4
68 partitioning scheme,
69 .Xr disklabel 5 ,
70 which is used to subdivide the
71 .Dx
72 slices into areas for individual filesystems and swap spaces.
73 For more information, see
74 .Xr fdisk 8
75 and
76 .Xr disklabel 8 ,
77 respectively.
78 .Pp
79 If an uninitialized disk is opened, the slice table will be
80 initialized with a fictitious
81 .Dx
82 slice spanning the entire disk.  Similarly, if an uninitialized
83 (or
84 .No non- Ns Dx )
85 slice is opened, its disklabel will be initialized with parameters returned
86 by the drive and a single
87 .Sq Li c
88 partition encompassing the entire slice.
89 .Sh CACHE EFFECTS
90 Many direct access devices are equipped with read and/or write caches.
91 Parameters affecting the device's cache are stored in mode page 8,
92 the caching control page.  Mode pages can be examined and modified
93 via the
94 .Xr camcontrol 8
95 utility.
96 .Pp
97 The read cache is used to store data from device-initiated read ahead
98 operations as well as frequently used data.  The read cache is transparent
99 to the user and can be enabled without any adverse effect.  Most devices
100 with a read cache come from the factory with it enabled.  The read cache
101 can be disabled by setting the
102 .Tn RCD
103 (Read Cache Disable) bit in the caching control mode page.
104 .Pp
105 The write cache can greatly decrease the latency of write operations
106 and allows the device to reorganize writes to increase efficiency and
107 performance.  This performance gain comes at a price.  Should the device
108 lose power while its cache contains uncommitted write operations, these
109 writes will be lost.  The effect of a loss of write transactions on
110 a file system is non-deterministic and can cause corruption.  Most
111 devices age write transactions to limit vulnerability to a few transactions
112 recently reported as complete, but it is none-the-less recommended that
113 systems with write cache enabled devices reside on an Uninterruptible
114 Power Supply (UPS).  The
115 .Nm
116 device driver ensures that the cache and media are synchronized upon
117 final close of the device or an unexpected shutdown (panic) event.  This
118 ensures that it is safe to disconnect power once the operating system
119 has reported that it has halted.  The write cache can be enabled by
120 setting the
121 .Tn WCE
122 (Write Cache Enable) bit in the caching control mode page.
123 .Sh TAGGED QUEUING
124 The
125 .Nm
126 device driver will take full advantage of the SCSI feature known as tagged
127 queueing.  Tagged queueing allows the device to process multiple transactions
128 concurrently, often re-ordering them to reduce the number and length of
129 seeks.  To ensure that transactions to distant portions of the media,
130 which may be deferred indefinitely by servicing requests nearer the current
131 head position, are completed in a timely fashion, an ordered tagged
132 transaction is sent every 15 seconds during continuous device operation.
133 .Sh BAD BLOCK RECOVERY
134 Direct Access devices have the capability of mapping out portions of
135 defective media.  Media recovery parameters are located in mode page 1,
136 the Read-Write Error Recovery mode page.  The most important media
137 remapping features are 'Auto Write Reallocation' and 'Auto Read
138 Reallocation' which can be enabled via the AWRE and ARRE bits,
139 respectively, of the Read-Write Error Recovery page.
140 Many devices do not ship from the factory with these feature enabled.
141 Mode pages can be examined and modifie
142 via the
143 .Xr camcontrol 8
144 utility.
145 .Sh KERNEL CONFIGURATION
146 It is only necessary to explicitly configure one
147 .Nm
148 device; data structures are dynamically allocated as disks are found
149 on the
150 .Tn SCSI
151 bus.
152 .Sh IOCTLS
153 The following
154 .Xr ioctl 2
155 calls apply to
156 .Tn SCSI
157 disks as well as to other disks.  They are defined in the header file
158 .Aq Pa sys/disklabel.h .
159 .Pp
160 .Bl -tag -width DIOCSDINFO
161 .It Dv DIOCSBAD
162 Usually used to set up a bad-block mapping system on the disk.
163 .Tn SCSI
164 drives incorporate their own bad-block mapping so this command is not
165 implemented.
166 .It Dv DIOCGDINFO
167 Read, from the kernel, the in-core copy of the disklabel for the
168 drive.
169 This may be a fictitious disklabel if the drive has never
170 been initialized, in which case it will contain information read
171 from the
172 .Tn SCSI
173 inquiry commands.
174 .It Dv DIOCSDINFO
175 Give the driver a new disklabel to use.
176 The driver
177 .Em will not
178 write the new
179 disklabel to the disk.
180 .It Dv DIOCWLABEL
181 Enable or disable the driver's software
182 write protect of the disklabel on the disk.
183 .It Dv DIOCWDINFO
184 Give the driver a new disklabel to use.
185 The driver
186 .Em will
187 write the new disklabel to the disk.
188 .El
189 .Sh NOTES
190 If a device becomes invalidated (media is removed, device becomes unresponsive)
191 the disklabel and information held within the kernel about the device will
192 be invalidated.  To avoid corruption of a newly inserted piece of media or
193 a replacement device, all accesses to the device will be discarded until
194 the last file descriptor referencing the old device is closed.  During this
195 period, all new open attempts will be rejected.
196 .Sh FILES
197 .Bl -tag -width /dev/rsdXXXXX -compact
198 .It Pa /dev/rda Ns Ar u
199 raw mode
200 .Tn SCSI
201 disk unit
202 .Ar u ,
203 accessed as an unpartitioned device
204 .Sm off
205 .It Pa /dev/da Ar u Pa s Ar n
206 .Sm on
207 block mode
208 .Tn SCSI
209 disk unit
210 .Ar u ,
211 slice
212 .Ar n ,
213 accessed as an unpartitioned device
214 .Sm off
215 .It Pa /dev/rda Ar u Pa s Ar n
216 .Sm on
217 raw mode
218 .Tn SCSI
219 disk unit
220 .Ar u ,
221 slice
222 .Ar n ,
223 accessed as an unpartitioned device
224 .It Pa /dev/da Ns Ar u Ns Ar p
225 block mode
226 .Tn SCSI
227 disk unit
228 .Ar u ,
229 first
230 .Dx
231 slice, partition
232 .Ar p
233 .It Pa /dev/rda Ns Ar u Ns Ar p
234 raw mode
235 .Tn SCSI
236 disk unit
237 .Ar u ,
238 first
239 .Dx
240 slice, partition
241 .Ar p
242 .Sm off
243 .It Xo
244 .Pa /dev/da
245 .Ar u
246 .Pa s
247 .Ar n
248 .Ar p
249 .Xc
250 .Sm on
251 block mode
252 .Tn SCSI
253 disk unit
254 .Ar u ,
255 .Ar n Ns th
256 slice, partition
257 .Ar p
258 .Sm off
259 .It Xo
260 .Pa /dev/rda
261 .Ar u
262 .Pa s
263 .Ar n
264 .Ar p
265 .Xc
266 .Sm on
267 raw mode
268 .Tn SCSI
269 disk unit
270 .Ar u ,
271 .Ar n Ns th
272 slice, partition
273 .Ar p
274 .El
275 .Sh DIAGNOSTICS
276 None.
277 .Sh SEE ALSO
278 .Xr ad 4 ,
279 .Xr disklabel 5 ,
280 .Xr disklabel 8 ,
281 .Xr fdisk 8
282 .Sh HISTORY
283 The
284 .Nm
285 driver was written for the
286 .Tn CAM
287 .Tn SCSI
288 subsystem by
289 .An Justin T. Gibbs .
290 Many ideas were gleaned from the
291 .Nm sd
292 device driver written and ported from
293 .Tn Mach
294 2.5
295 by
296 .An Julian Elischer .
297 Support for slices was written by
298 .An Bruce Evans .