cdfs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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 is capable of writing 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 "\fLquickblan"
  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 \fIkpbs\fR
  130. Set the reading and writing speed to use.
  131. Drives may round down the speed to one they support.
  132. To set reading and writing speeds separately,
  133. prefix the speeds with
  134. .B read
  135. or
  136. .BR write ,
  137. as in
  138. .B speed
  139. .B write
  140. .B 8192
  141. or
  142. .B speed
  143. .B read
  144. .B 16384
  145. .B write
  146. .BR 8192.
  147. Note that most drives reset the reading and writing speed
  148. each time a new disc is inserted.
  149. .PD
  150. .PP
  151. Reading the
  152. .B ctl
  153. file yields information about the drive.
  154. If the drive contains an audio CD, the first line
  155. will be an
  156. .B aux/cddb
  157. command that can be run to query
  158. an internet CD database
  159. to get a table of contents.
  160. Subsequent lines contain the current and maximum
  161. reading and writing speeds.
  162. Additional lines may further describe the current disc.
  163. .PD
  164. .PP
  165. .I Aux/cddb
  166. takes 4 optional arguments.
  167. The
  168. .B -s
  169. option causes
  170. .I aux/cddb
  171. to use a different
  172. .I server
  173. for the query
  174. (default is
  175. .LR freedb.freedb.org ).
  176. The
  177. .B -D
  178. option causes the raw database response from the server to be dumped
  179. to standard output.
  180. The
  181. .B -t
  182. option causes the time of each track to be appended to the normal output.
  183. .B -T
  184. is like
  185. .B -t
  186. but prints a line with the total time at the end.
  187. .PD
  188. .SH EXAMPLE
  189. Backup to a BD-R disc:
  190. .IP
  191. .EX
  192. 9fs boot
  193. cdfs
  194. tar cf /mnt/cd/wd/x /n/boot
  195. .EE
  196. .br
  197. .ne 3
  198. .PP
  199. Copy the audio tracks from a CD:
  200. .IP
  201. .EX
  202. cdfs -d /dev/sd05
  203. mkdir /tmp/songs
  204. cp /mnt/cd/a* /tmp/songs
  205. .EE
  206. .PP
  207. Copy the tracks onto a blank CD inserted in the drive,
  208. and then fixate the disk as an audio CD.
  209. .IP
  210. .EX
  211. cp /tmp/songs/* /mnt/cd/wa
  212. rm /mnt/cd/wa
  213. .EE
  214. .SH SOURCE
  215. .B /sys/src/cmd/cdfs
  216. .SH SEE ALSO
  217. .TF "\fLhttp://www.t10.org\fP"
  218. .TP
  219. .B http://www.t10.org
  220. optical disc interface standards
  221. .PP
  222. .PD
  223. .IR sd (3),
  224. .I 9660srv
  225. (in
  226. .IR dossrv (4)),
  227. .IR mk9660 (8)
  228. .SH BUGS
  229. Fixating a BD-R disc records only the first track in the disc's TOC.
  230. Any other tracks are still there and accessible via
  231. .IR sd (3).
  232. There's no need to fixate data discs, except to prevent adding new tracks.
  233. .PP
  234. There are too many combinations of optical media, approximately
  235. the cross-product of these tuples:
  236. (CD DVD- DVD+ BD),
  237. (single-layer dual-layer),
  238. (-ROM -R -RW).
  239. .PP
  240. Only MMC-compliant disc readers and writers
  241. are supported, but it would be easy to add
  242. support for early CD writers if desired.