NAME
cdfs, cddb – optical disc (CD, DVD, BD) track reader and writer
file system |
SYNOPSIS
cdfs [ –d sddev ] [ –m mtpt ] grep aux/cddb /mnt/cd/ctl | rc aux/cddb [ –DTt ] [ –s server ] query diskid ntracks track0id ... |
DESCRIPTION
Cdfs serves a one and a half level directory mounted at mtpt (default
/mnt/cd) that provides access to the tracks on discs placed in
the disc reader or writer named by sddev (default /dev/sdD0, see
sd(3)). Any MMC–compliant compact disc (CD), DVD, or Blu–ray disc
(BD) drive should work. On DVDs and BDs,
access to data tracks only is implemented. The top level directory contains one file per disc track. The files are named cNNN, where c is a type character (a for audio tracks and d for data tracks) and NNN is the track number. If the device can write discs and contains a writable disc, the top–level directory also contains an empty directory wd and, for CDs only, an empty directory wa. Files created in these directories appear in the top–level directory as new data or audio tracks, respectively, regardless of name. At any time, any number of tracks may be open for reading or a single track may be open for writing. Writing a disc track is a quasi–real–time operation: the disc writer should be kept saturated with new data to avoid buffer underruns, but modern drives will be told to cope with underruns transparently. To ensure saturation, copying from a file system stored on local disk or memory is recommended. BD–R discs are `formatted' upon first use, for sequential writing with spare sectors for hardware defect management, so BD drives should not report errors when writing BD–R discs; any such errors may be a sign that the laser of an old drive is fading. To fixate a disc (close a recordable disc by writing its permanent table of contents), simply remove the wa or wd directory. The directory removed selects whether the disc is fixated as an audio or data disc; since each track carries its own type information, very few readers care which fixation type was used. Rewritable discs do not require fixation.
The top level directory also contains a ctl file, into which control
messages may be echoed. The current control messages are:
Aux/cddb takes 4 optional arguments. The –s option makes aux/cddb
use server for the query instead of freedb.freedb.org. The –D option
causes the raw database response from the server to be dumped
to standard output. The –t option causes the time of each track
to be appended to the normal output.
–T is like –t but prints a final line with the total time. |
EXAMPLES
Backup to a BD–R disc:
|
SOURCE
/sys/src/cmd/cdfs |
SEE ALSO
pump(1), sd(3), 9660srv (in dossrv(4)), mk9660(8) http://www.t10.org optical disc interface standards, notably Multi–Media Commands (MMC) |
BUGS
Fixating a BD–R disc records only the first track in the disc's
TOC. Any other tracks are still there and their data accessible
via sd(3). There's no need to fixate data discs, except to prevent
adding new tracks. Closing a just–written DVD–R track can take minutes while the drive burns the unused part of the track reservation (for the whole disc). Thus only a single DVD–R track can be written on a DVD–R disc; use other media if you need more than one track per disc. There are too many combinations of optical media, each with unique quirks, approximately the cross–product of these tuples: (CD DVD– DVD+ BD), (–ROM –R –RW), (single–layer dual–layer), plus oddities like DVD–RAM. Triple– and quad–layer BD drives and discs are starting to appear. Only MMC–compliant disc readers and writers are supported, but it would be easy to add support for early CD writers if desired.
Cdfs can take some seconds to figure out that it has a BD in the
drive and how many layers are on the disc. |