summaryrefslogtreecommitdiffstats
path: root/share/man/man4/od.4
blob: ef5b023875eb4785c54d3257f1c2ebe7948e80bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
.\" Copyright (c) 1996,1997 Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
.\"   All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by Shunsuke Akiyama.
.\" 4. Neither the name of the author nor the names of any co-contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY Shunsuke Akiyama AND CONTRIBUTORS ``AS IS''
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL Shunsuke Akiyama OR CONTRIBUTORS BE
.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\"	$Id$
.\"
.Dd March 16, 1997
.Dt OD 4
.Os FreeBSD
.Sh NAME
.Nm od
.Nd SCSI optical disk driver
.Sh SYNOPSIS
.Cd device od
.Cd device od1 at scbus0 target 3 lun 0
.Pp
To use a drive which returns bogus ASC/ASCQ values:
.Cd options OD_BOGUS_NOT_READY
.Pp
To enable an automatic spindown:
.Cd options OD_AUTO_TURNOFF
.Sh DESCRIPTION
The
.Nm
driver provides support for a
.Em SCSI
optical disk (AKA. Magneto-Optical or Phase change optical Disk) drive.
It enables the media change operation and the disk to be divided
up into a set of pseudo devices called
.Em partitions .
A partition has both a 
.Em raw
interface
and a
.Em block mode
interface.
In general the interfaces are similar to those described by 
.Xr wd 4
and
.Xr sd 4 .
.Pp
As the SCSI adapter is probed during boot, the 
.Em SCSI
bus is scanned for devices. Any devices found which answered as
.Sq Em Optical
and
.Sq Em removable
type device will be attached to the 
.Nm
driver.
In
.Fx 2.1.5
or later, the first device found will be attached as
.Em od0
and the next, 
.Em od1 ,
and so on.
It is possible to specify which od unit a device should
come on line as; refer to
.Xr scsi 4
for details on kernel configuration.
Beginning in
.Fx 2.2
the
.Nm
driver can handle any device which answers as being type
.Sq Em Direct
and
.Sq Em removable
as well as
.Sq Em Optical
and
.Sq Em removable
type devices.
.Sh PARTITIONING
The 
.Nm
driver allows the disk to have two levels of partitioning.
One layer, called the
.Dq slice layer ,
is used to separate the
.Tn FreeBSD
areas of the disk from areas used by other operating systems.
The second layer is the native
.Bx 4.4
partitioning scheme,
.Xr disklabel 5 ,
which is used to subdivide the
.Tn FreeBSD
slices into areas for individual filesystems.
For more information, see
.Xr fdisk 8
and
.Xr disklabel 8 ,
respectively.
.Pp
If an uninitialized disk is opened, the slice table will be
initialized with a fictitious
.Tn FreeBSD
slice spanning the entire disk.  Similarly, if an uninitialized
(or
.No non- Ns Tn FreeBSD )
slice is opened, its disklabel will be initialized with parameters
returned by the drive and a single
.Sq Li c
partition encompassing the entire slice.
.Sh KERNEL CONFIGURATION
Only one
.Nm
device is necessary in the config file; data structures are dynamically
allocated as disks are found on the
.Tn SCSI
bus.
.Sh IOCTLS
The following 
.Xr ioctl 2
calls apply to optical disks as well as to other disks.
They are defined in the header file
.Aq Pa sys/disklabel.h .
.Pp
.Bl -tag -width CDIOCPREVENT
.It Dv DIOCSBAD
Usually used to set up a bad-block mapping system on the disk. SCSI
drives incorporate their own bad-block mapping so this is not
implemented, however it MAY be implemented in the future as a 'kludged'
interface to the SCSI bad-block mapping.
.It Dv DIOCGDINFO
Read the in-core copy of the disklabel for the
drive from the kernel. This may be a fictitious disklabel if the drive 
has never been initialised, in which case it will contain information read
from the SCSI inquiry commands, and should be the same as
the information printed at boot.
.It Dv DIOCSDINFO
Give the driver a new disklabel to use. The driver will NOT try write
the new disklabel to the disk.
.It Dv DIOCWLABEL
Enable or Disable the driver's software write protect of the disklabel
on the disk.
.It Dv DIOCWDINFO
Give the driver a new disklabel to use. The driver WILL try write the
new disklabel to the disk.
.El
.Pp
And the following
.Xr ioctl 2
calls which apply to optical disks are defined in the header file
.Aq Pa sys/cdio.h .
.Bl -tag -width CDIOCPREVENT
.It Dv CDIOCEJECT
Eject the optical disk media.
.It Dv CDIOCALLOW
Tell the drive to allow manual ejection of the optical disk media.
.It Dv CDIOCPREVENT
Tell the drive to prevent manual ejection of the optical disk media.
.El
.Pp
In addition, the 
.Xr scsi 4
general ioctls may be used with the 
.Nm
driver, but only against the fourth (whole disk) partition.
.Sh NOTES
Currently the
.Nm
driver accepts 512, 1024 and 2048 byte/sector media.
Raw and block mode device access to non-512 byte/sector media
would be allowed only on each sector size boundary start position and 
I/O size.
.Sh FILES
.Bl -tag -width /dev/rodXXXXX -compact
.It Pa /dev/rod Ns Ar u
raw mode
.Tn SCSI
optical disk unit
.Ar u ,
accessed as an unpartitioned device
.Sm off
.It Pa /dev/od Ar u Pa s Ar n
.Sm on
block mode
.Tn SCSI
optical disk unit
.Ar u ,
slice
.Ar n ,
accessed as an unpartitioned device
.Sm off
.It Pa /dev/rod Ar u Pa s Ar n
.Sm on
raw mode
.Tn SCSI
optical disk unit
.Ar u ,
slice
.ar n ,
accessed as an unpartitioned device
.It Pa /dev/od Ns Ar u Ns Ar p
block mode
.Tn SCSI
optical disk unit
.Ar u ,
first
.Tn FreeBSD
slice, partition
.Ar p
.It Pa /dev/rod Ns Ar u Ns Ar p
raw mode
.Tn SCSI
optical disk unit
.Ar u ,
first
.Tn FreeBSD
slice, partition
.Ar p
.Sm off
.It Xo
.Pa /dev/od Ar u Pa s Ar n Ar p
.Xc
.Sm on
block mode
.Tn SCSI
optical disk unit
.Ar u ,
.No Ar n Ns th
slice, partition
.Ar p
.Sm off
.It Xo
.Pa /dev/rod Ar u Pa s Ar n Ar p
.Xc
raw mode
.Tn SCSI
optical disk unit
.Ar u ,
.No Ar n Ns th
slice, partition
.Ar p
.Sm off
.It Xo
.Pa /dev/rod Ar u Pa .ctl
.Xc
the control device unit
.Ar u ,
as being used by
.Xr scsi 8
.El
.Sh DIAGNOSTICS
None.
.Sh SEE ALSO
.Xr fdisk 1 ,
.Xr scsi 4 ,
.Xr sd 4 ,
.Xr cd 4 ,
.Xr disklabel 5 ,
.Xr disklabel 8
.Sh AUTHOR
Shunsuke Akiyama <akiyama@jp.FreeBSD.org>
.Sh HISTORY
The
.Nm
driver first appeared in
.Fx 2.1.5 .
OpenPOWER on IntegriCloud