cdfs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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 \fLformat
  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 causes
  183. .I aux/cddb
  184. to use a different
  185. .I server
  186. for the query
  187. (default is
  188. .LR freedb.freedb.org ).
  189. The
  190. .B -D
  191. option causes the raw database response from the server to be dumped
  192. to standard output.
  193. The
  194. .B -t
  195. option causes the time of each track to be appended to the normal output.
  196. .B -T
  197. is like
  198. .B -t
  199. but prints a line with the total time at the end.
  200. .PD
  201. .SH EXAMPLE
  202. Backup to a BD-R disc:
  203. .IP
  204. .EX
  205. 9fs boot
  206. cdfs
  207. tar cf /mnt/cd/wd/x /n/boot
  208. .EE
  209. .br
  210. .ne 3
  211. .PP
  212. Copy the audio tracks from a CD:
  213. .IP
  214. .EX
  215. cdfs -d /dev/sd05
  216. mkdir /tmp/songs
  217. cp /mnt/cd/a* /tmp/songs
  218. .EE
  219. .PP
  220. Copy the tracks onto a blank CD inserted in the drive,
  221. and then fixate the disk as an audio CD.
  222. .IP
  223. .EX
  224. cp /tmp/songs/* /mnt/cd/wa
  225. rm /mnt/cd/wa
  226. .EE
  227. .SH SOURCE
  228. .B /sys/src/cmd/cdfs
  229. .SH SEE ALSO
  230. .TF "\fLhttp://www.t10.org\fP"
  231. .TP
  232. .B http://www.t10.org
  233. optical disc interface standards
  234. .PP
  235. .PD
  236. .IR sd (3),
  237. .I 9660srv
  238. (in
  239. .IR dossrv (4)),
  240. .IR mk9660 (8)
  241. .SH BUGS
  242. Fixating a BD-R disc records only the first track in the disc's TOC.
  243. Any other tracks are still there and their data accessible via
  244. .IR sd (3).
  245. There's no need to fixate data discs, except to prevent adding new tracks.
  246. .PP
  247. Closing a just-written DVD-R track can take minutes
  248. while the drive burns the unused part of the track reservation
  249. (for the whole disc).
  250. Thus only a single DVD-R track can be written on a DVD-R disc;
  251. use other media if you need more than one track per disc.
  252. .PP
  253. There are too many combinations of optical media, approximately
  254. the cross-product of these tuples:
  255. (CD DVD- DVD+ BD),
  256. (single-layer dual-layer),
  257. (-ROM -R -RW).
  258. .PP
  259. Only MMC-compliant disc readers and writers
  260. are supported, but it would be easy to add
  261. support for early CD writers if desired.