cdfs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. To fixate a disc (close a recordable disc by writing
  85. its permanent table of contents), simply
  86. remove the
  87. .B wa
  88. or
  89. .B wd
  90. directory.
  91. The directory removed selects whether
  92. the disc is fixated as an audio or data disc;
  93. since each track carries its own type information,
  94. very few readers care which fixation type was used.
  95. Rewritable discs do not require fixation.
  96. .PP
  97. The top level directory
  98. also contains a
  99. .B ctl
  100. file, into which control messages
  101. may be echoed.
  102. The current control messages are:
  103. .TF \fLquickblank
  104. .TP
  105. .B format
  106. Format the rewritable disc (\c
  107. .B -RW
  108. or
  109. .BR -RE )
  110. in the drive
  111. before initial use.
  112. .TP
  113. .B blank
  114. Blank the entire rewritable disc in the drive.
  115. .TP
  116. .B quickblank
  117. Blank only the table of contents on the rewritable
  118. disc in the drive.
  119. .\" .TP
  120. .\" .B closetracks
  121. .\" Close any open tracks on the current disc but do not finalize (fixate) the disc.
  122. .TP
  123. .B eject
  124. Eject the disc in the drive.
  125. .TP
  126. .B ingest
  127. Ingest a disc into the drive.
  128. .TP
  129. .B speed \fIkbps\fR
  130. Set the reading and writing speed to use,
  131. in units of 1,000-bytes-per-second.
  132. A value of
  133. .L best
  134. requests the optimal speed for the current drive and disc.
  135. CD
  136. .L 1x
  137. speed is 154;
  138. DVD
  139. .L 1x
  140. speed is 1350;
  141. BD
  142. .L 1x
  143. speed is 4608.
  144. Drives may round down the speed to one they support.
  145. To set reading and writing speeds separately,
  146. prefix the speeds with
  147. .B read
  148. or
  149. .BR write ,
  150. as in
  151. .B speed
  152. .B write
  153. .B 8192
  154. or
  155. .B speed
  156. .B read
  157. .B 16384
  158. .B write
  159. .BR 8192.
  160. Note that most drives reset the reading and writing speed
  161. each time a new disc is inserted.
  162. .PD
  163. .PP
  164. Reading the
  165. .B ctl
  166. file yields information about the drive.
  167. If the drive contains an audio CD, the first line
  168. will be an
  169. .B aux/cddb
  170. command that can be run to query
  171. an internet CD database
  172. to get a table of contents.
  173. Subsequent lines contain the current and maximum
  174. reading and writing speeds.
  175. Additional lines may further describe the current disc.
  176. .PD
  177. .PP
  178. .I Aux/cddb
  179. takes 4 optional arguments.
  180. The
  181. .B -s
  182. option makes
  183. .I aux/cddb
  184. use
  185. .I server
  186. for the query instead of
  187. .LR freedb.freedb.org .
  188. The
  189. .B -D
  190. option causes the raw database response from the server to be dumped
  191. to standard output.
  192. The
  193. .B -t
  194. option causes the time of each track to be appended to the normal output.
  195. .B -T
  196. is like
  197. .B -t
  198. but prints a final line with the total time.
  199. .PD
  200. .SH EXAMPLE
  201. Backup to a BD-R disc:
  202. .br
  203. .ne 3
  204. .IP
  205. .EX
  206. 9fs boot
  207. cdfs
  208. tar cf /mnt/cd/wd/x /n/boot
  209. .EE
  210. .br
  211. .ne 3
  212. .PP
  213. Copy the audio tracks from a CD:
  214. .IP
  215. .EX
  216. cdfs -d /dev/sd05
  217. mkdir /tmp/songs
  218. cp /mnt/cd/a* /tmp/songs
  219. .EE
  220. .PP
  221. Copy the tracks onto a blank CD inserted in the drive,
  222. and then fixate the disk as an audio CD.
  223. .IP
  224. .EX
  225. cp /tmp/songs/* /mnt/cd/wa
  226. rm /mnt/cd/wa
  227. .EE
  228. .SH SOURCE
  229. .B /sys/src/cmd/cdfs
  230. .SH SEE ALSO
  231. .TF "\fLhttp://www.t10.org\fP"
  232. .TP
  233. .B http://www.t10.org
  234. optical disc interface standards
  235. .PP
  236. .PD
  237. .IR sd (3),
  238. .I 9660srv
  239. (in
  240. .IR dossrv (4)),
  241. .IR mk9660 (8)
  242. .SH BUGS
  243. Fixating a BD-R disc records only the first track in the disc's TOC.
  244. Any other tracks are still there and their data accessible via
  245. .IR sd (3).
  246. There's no need to fixate data discs, except to prevent adding new tracks.
  247. .PP
  248. Closing a just-written DVD-R track can take minutes
  249. while the drive burns the unused part of the track reservation
  250. (for the whole disc).
  251. Thus only a single DVD-R track can be written on a DVD-R disc;
  252. use other media if you need more than one track per disc.
  253. .PP
  254. There are too many combinations of optical media, each with unique quirks,
  255. approximately
  256. the cross-product of these tuples:
  257. (CD DVD- DVD+ BD),
  258. (single-layer dual-layer),
  259. (-ROM -R -RW).
  260. .PP
  261. Only MMC-compliant disc readers and writers
  262. are supported, but it would be easy to add
  263. support for early CD writers if desired.