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