Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
.TH CDFS 4
2
.SH NAME
3
cdfs, cddb \- optical disc (CD, DVD, BD) track reader and writer file system
4
.SH SYNOPSIS
5
.B cdfs
6
[
7
.B -d
8
.I sddev
9
] [
10
.B -m
11
.I mtpt
12
]
13
.br
14
.B "grep aux/cddb /mnt/cd/ctl | rc
15
.br
16
.B aux/cddb
17
[
18
.B -DTt
19
] [
20
.B -s
21
.I server
22
]
23
.B query
24
.I diskid
25
.I ntracks
26
.I track0id
27
.I ...
28
.SH DESCRIPTION
29
.I Cdfs
30
serves a one and a half level directory
31
mounted at
32
.I mtpt
33
(default
34
.BR /mnt/cd )
35
that provides access to the tracks
36
on discs placed in the disc reader or writer
37
named by
38
.I sddev
39
(default
40
.BR /dev/sdD0 ,
41
see
42
.IR sd (3)).
43
Any MMC-compliant compact disc (CD), DVD,
44
or Blu-ray disc (BD) drive should work.
45
On DVDs and BDs, access to data tracks only is implemented.
46
.PP
47
The top level directory contains one file
48
per disc track.
49
The files are named
50
.IR cNNN ,
51
where
52
.I c
53
is a type character
54
.RB ( a
55
for audio tracks
56
and
57
.B d
58
for data tracks)
59
and
60
.I NNN
61
is the track number.
62
.PP
63
If the device can write discs
64
and contains a writable disc, the top-level
65
directory also contains an empty directory
66
.B wd
67
and, for CDs only,
68
an empty directory
69
.BR wa .
70
Files created in these directories
71
appear in the top-level directory
72
as new data or audio tracks, respectively, regardless of name.
73
.PP
74
At any time, any number of tracks
75
may be open for reading or a single track
76
may be open for writing.
77
Writing a disc track is a quasi-real-time operation:
78
the disc writer should be kept saturated with
79
new data to avoid buffer underruns,
80
but modern drives will be told to cope with underruns transparently.
81
To ensure saturation, copying from a file system
82
stored on local disk or memory is recommended.
83
.PP
84
BD-R discs are `formatted' upon first use,
85
for sequential writing with spare sectors
86
for hardware defect management,
87
so BD drives should not report errors when writing BD-R discs;
88
any such errors may be a sign that the laser of an old drive is fading.
89
.PP
90
To fixate a disc (close a recordable disc by writing
91
its permanent table of contents), simply
92
remove the
93
.B wa
94
or
95
.B wd
96
directory.
97
The directory removed selects whether
98
the disc is fixated as an audio or data disc;
99
since each track carries its own type information,
100
very few readers care which fixation type was used.
101
Rewritable discs do not require fixation.
102
.PP
103
The top level directory
104
also contains a
105
.B ctl
106
file, into which control messages
107
may be echoed.
108
The current control messages are:
109
.TF \fLquickblank
110
.TP
111
.B format
112
Format the rewritable disc (\c
113
.B -RW
114
or
115
.BR -RE )
116
in the drive
117
before initial use.
118
.TP
119
.B blank
120
Blank the entire rewritable disc in the drive.
121
.TP
122
.B quickblank
123
Blank only the table of contents on the rewritable
124
disc in the drive.
125
.\" .TP
126
.\" .B closetracks
127
.\" Close any open tracks on the current disc but do not finalize (fixate) the disc.
128
.TP
129
.B eject
130
Eject the disc in the drive.
131
.TP
132
.B ingest
133
Ingest a disc into the drive.
134
.TP
135
.B speed \fIkbps\fR
136
Set the reading and writing speed to use,
137
in units of 1,000-bytes-per-second.
138
A value of
139
.L best
140
requests the optimal speed for the current drive and disc.
141
CD
142
.L 1x
143
speed is 154;
144
DVD
145
.L 1x
146
speed is 1350;
147
BD
148
.L 1x
149
speed is 4608.
150
Drives may round down the speed to one they support.
151
To set reading and writing speeds separately,
152
prefix the speeds with
153
.B read
154
or
155
.BR write ,
156
as in
157
.B speed
158
.B write
159
.B 8192
160
or
161
.B speed
162
.B read
163
.B 16384
164
.B write
165
.BR 8192.
166
Note that most drives reset the reading and writing speed
167
each time a new disc is inserted.
168
.PD
169
.PP
170
Reading the
171
.B ctl
172
file yields information about the drive.
173
If the drive contains an audio CD, the first line
174
will be an
175
.B aux/cddb
176
command that can be run to query
177
an internet CD database
178
to get a table of contents.
179
Subsequent lines contain the current and maximum
180
reading and writing speeds.
181
Additional lines may further describe the current disc.
182
.PP
183
.I Aux/cddb
184
takes 4 optional arguments.
185
The
186
.B -s
187
option makes
188
.I aux/cddb
189
use
190
.I server
191
for the query instead of
192
.LR freedb.freedb.org .
193
The
194
.B -D
195
option causes the raw database response from the server to be dumped
196
to standard output.
197
The
198
.B -t
199
option causes the time of each track to be appended to the normal output.
200
.B -T
201
is like
202
.B -t
203
but prints a final line with the total time.
204
.br
205
.ne 6
206
.SH EXAMPLES
207
Backup to a BD-R disc:
208
.br
209
.ne 3
210
.IP
211
.EX
212
9fs boot
213
cdfs
214
tar cf /mnt/cd/wd/x /n/boot
215
.EE
216
.br
217
.ne 3
218
.PP
219
Copy the audio tracks from a CD:
220
.IP
221
.EX
222
cdfs -d /dev/sd05
223
mkdir /tmp/songs
224
cp /mnt/cd/a* /tmp/songs
225
.EE
226
.PP
227
Copy the tracks onto a blank CD inserted in the drive,
228
and then fixate the disk as an audio CD.
229
.IP
230
.EX
231
cp /tmp/songs/* /mnt/cd/wa
232
rm /mnt/cd/wa
233
.EE
234
.SH SOURCE
235
.B /sys/src/cmd/cdfs
236
.SH SEE ALSO
237
.IR pump (1),
238
.IR sd (3),
239
.I 9660srv
240
(in
241
.IR dossrv (4)),
242
.IR mk9660 (8)
243
.PD 0
244
.TF "\fLhttp://www.t10.org\fP"
245
.TP
246
.B http://www.t10.org
247
optical disc interface standards,
248
notably
249
.I "Multi-Media Commands"
250
(MMC)
251
.PD
252
.SH BUGS
253
Fixating a BD-R disc records only the first track in the disc's TOC.
254
Any other tracks are still there and their data accessible via
255
.IR sd (3).
256
There's no need to fixate data discs, except to prevent adding new tracks.
257
.PP
258
Closing a just-written DVD-R track can take minutes
259
while the drive burns the unused part of the track reservation
260
(for the whole disc).
261
Thus only a single DVD-R track can be written on a DVD-R disc;
262
use other media if you need more than one track per disc.
263
.PP
264
There are too many combinations of optical media, each with unique quirks,
265
approximately
266
the cross-product of these tuples:
267
(CD DVD- DVD+ BD),
268
(-ROM -R -RW),
269
(single-layer dual-layer),
270
plus oddities like DVD-RAM.
271
Triple- and quad-layer BD drives and discs are starting to appear.
272
.PP
273
Only MMC-compliant disc readers and writers
274
are supported, but it would be easy to add
275
support for early CD writers if desired.
276
.PP
277
.I Cdfs
278
can take some seconds to figure out that it has
279
a BD in the drive and how many layers are on the disc.