iXOS Jukeman

5. The Writer


[Table of Contents] [Glossary]

The iXOS-JUKEMAN writer sends data to be burned to a CD, WORM, or MOrecorder.

To burn CDs, WORMS, or MOs you need the iXOS SCSI driver, the cdglow writer, and the iso9660 formatter, which produces an ISO 9660 image for a file system. If you burn in a jukebox, read the description of the cdadm movecd command in Chapter 3.

Please note that the current version 2.1 of iXOS-JUKEMAN does not support writing single files to WORM or MO media - this feature will be included in the next release, however. Currently , our software permits you to write an ISO9660 compliant filesystem to these media types. When we talk of CDs in the following example the other two media types are implicitly included, except where noted otherwise.

Note that the NT version of iXOS-JUKEMAN includes a GUI, writer.exe, that you start by clicking the Jukeman CD Writer icon in the iXOS-jukeman program group.

With version 2.1 of iXOS-JUKEMAN, you can either use the direct burning approach offered by cdglow, or write files transparently, as described in the "Writable File System" section in Chapter 3. Both approaches yield fully ISO9660 compliant file systems (except if you use some special options of the iso9660 program, as mentioned below), which means that you can read this CD on every OS that supports CD media without any additional third party software or iXOS-JUKEMAN.

5.1 cdglow

Burning CDs is a time-critical task. The physical burning process requires a data rate of 150 KB per second for single speed recorders and 300 KB or 600 KB for double or quad speed recorders. If the buffers provided by iXOS-JUKEMAN and the internal recorder buffer become empty while you are burning a CD, you will get a buffer underrun SCSI error, which means that the burning process finished unexpectedly. This makes your recorded CD useless. Although the iXOS-JUKEMAN writer is specially designed to maximize your hardware capabilities, it does not compensate for deficiencies in processing speed or memory.

The scenarios that will most likely lead to a buffer underrun include:

Do not run other real time processes nor overload the hard disks and SCSI buses with other activities while you are burning a CD.

If you are not sure about your hardware capabilities, use cdglow's -p option, which simulates all aspects of writing without actually burning a CD. If you get a buffer underrun error in this mode, either lower the speed of the recorder using the -f options, allocate a larger buffer using the -b option, or try to convert or save the source to one large file on a hard disk and try again using this file as source.

The burning command,

cdglow [-p][-v][-w][-c][-f1|-f2][-b size][-s
source][-t target][-l length] [-a size]

instructs the burner to burn data on a CD recordable as a single track. Use these options, as required:
-p Use preview mode; accept data, but do not burn.
-v Verify the complete disk after it is finished to prove there is no difference between the source and the CD.
-w Write on WORM- and MO-discs.
-c Determine the size of the source only.
-f1 Use single speed; the default is maximum speed.
-f2 Use double speed.
-b size Sets memory buffer size in bytes (either decimal or hexadecimal); the default is 8 MB.
-s source Indicates the source contains the ISO 9660 file system; the default is stdin.
-S Indicates that the source is not a CD drive, or, more precisely, a non -SCSI device.
-t target Target is the CD-recorder; the default is stdout.
-T Indicates the target is not a CD recorder.
-l length Indicates how many bytes to write; the default is the complete ISO image.
-a size Determines the granularity of logging in bytes, default is 1 MB. This value is rounded up to full MB. For instance '-a 0x500000' causes log messages that 5, 10, 15,... MB of data have been read into the buffer already. A null value disables the logging completely.

cdglow returns an exit code 0 for success and nonnull otherwise. It writes a protocol to stderr that ends with an error message if anything failed.

To maintain the required constant data rate of at least 150 KB per second, cdglow should be called by an administrator or power user for NT or by root on UNIX. Alternatively you can change the owner of cdglow to root and set the permissions to suid on UNIX.

cdglow accepts input data from various source types. The simplest case is a file or partition with a pre- mastered ISO 9660 image. cdglow also accepts another CD drive as the source. This enables you to copy a CD-ROM directly if the source drive is faster than the target drive.

The most advanced possibility is to simultaneously generate an ISO 9660 file system and to pipe it to cdglow. The program is highly optimized and uses the operating system's real time features to maintain a constant data rate even if the data is generated simultaneously. You should, however, observe the recommendations for the hardware setup above to ensure that the writing does not fail with a buffer underrun.

5.2 ISO9660

iso9660 is a program that creates file systems formatted according to ISO 9660, possibly with the Rock Ridge extensions that provide UNIX semantics in ISO 9660 file systems. You can either write the ISO 9660 file system created by iso9660 into a file or a dedicated partition and burn it later, or pipe it into cdglow directly, avoiding the need for an extra partition or large file (this is only recommended if you have the appropriate hardware as stated earlier).

Avoid changing a tree while iso9660 is creating an image of it. And be especially careful not to write the image into the tree for which iso9660 is creating the ISO 9660 image.

Though iso9660 is a completely new development for both UNIX and NT, the existence of the well- designed and widely tested formatter mkisofs and the fact that the source was available, simplified design and implementation of iso9660. Eric Youngdale developed and published mkisofs for UNIX.

iso9660 has a large variety of parameters and options. Some of them are not part of the ISO9660 standard. This means that CDs written by means of such options will not necessarily be readable on every operating system without the help of iXOS-JUKEMAN. You should check this before you burn a series of CDs with such options.

ISO9660 compliant parameters and options:

rr Adds Rock Ridge extensions in areas that are not used by ISO 9660. Creates an image that contains a plain ISO 9660 file system plus additional POSIX features, which are readable by file system interpreters that understand RR. RR extensions allow you to store arbitrary file names, so each file will have both a plain ISO 9660 name and a full RR name stored on the CD.
isolevel2 Allows file names to contain up to 32 bytes, as defined by ISO 9660 interchange level 2. Level 1 allows only 8 bytes plus 3 for regular files.
fitcd Check if the size of the resulting image will exceed the capacity of a 650 MB (74 min) CD. In this case the program aborts immediately.This option avoids the creation of ISO images on disk that won't fit on a CD anyway. Note that you don't need this option if you are piping the output directly to cdglow, since the latter determines the size of the image out of its header and aborts itself before burning if the image won't fit on the target.
maxsize<number of bytes> An extension of fitcd. With this option, you can specify an upper bound for the size of the ISO image, for instance for 553 MB (63 min) CDs or WORM or MO media. If you use both fitcd and maxsize, the latter overrides the former.
followlinks Follows symbolic links.
norelocation Does not use RR deep directory relocation. Instead, the ISO 9660 restriction to 8 directory layers is ignored. Note that iso9660 ignores it anyway.
ignorefail Replaces unreadable files or directories by null bytes or empty directories.
checkfail Checks for and excludes unreadable files and directories.
source=<directory> Describes the path of the root directory.
stdout=<file> and stderr= Describe files in which the image and log messages are to be written.
name=<volumename> Defines the name of the volume burned into the primary volume descriptor. To avoid problems, this name should not contain any blanks or white spaces.
publisher="text",
preparer="text",
applid="text"
Allows you to specify publisher, data preparer, and application ID.
ignore=<charlist> Allows you to define a set of characters to be ignored. Iso9660 excludes files that have names which, after stripping all characters to be ignored, are equal to names of other files in the same directory. For example, if you use an option ignore=~, a file named ~source.c will be ignored if another file named source.c exists in the same directory. Otherwise, the option has no effect on the file name.
exclude=<path> Defines the path of a subtree to be excluded from the image.
replace=
@<path1>
@<path2>
Allows you to add or replace a subtree. For example, if you want to create a CD that contains only than the /y and /z directories from your computer, you can create an empty directory /x and call
iso9660 source=/x
replace=@/x/y@/y
replace=@/x/z@/z
to obtain a CD with two directories y and z containing your data. To test this option, create small test images on your hard disk and use the iXOS-JUKEMAN file system to show the contents.
options=<filename> Reads options out of a file, one from each line. As the default, iso9660 searches for files .iso9660 and iso9660.ini for options, but you can add more files.
Not necessarily ISO9660 compliant parameters and options:

Please note again that using these options is not recommended, since they might yield CDs that are not readable without iXOS-JUKEMAN!

longnames Allows arbitrary long file names.
nicenames Allows arbitrary characters in file names. You should better use the allow=option, described below, for this purpose.
noversion Omits the version number.
dir.ext Allows extensions for directory names.
omit. Omits a trailing dot for ISO 9660 names.
.by_ Replaces a leading dot by a _.
allow=<charlist> The ISO 9660 standard permits only upper case letters, digits, the dot and the underscore in file names. By default, iso9660 converts all lower case letters to upper case and all other non permitted characters to underscores. The allow option permits you to extend the set of usable characters. For instance allow=-~ tells iso9660 to allow the hyphen or '~' in file names. Allow=all or allow=ALL suppress all character conversions. This is not equivalent to the nicenames option, since the latter totally ignores all ISO 9660 conventions, for instance the appended version number. You should hence better use allow=all instead of nicenames.

5.3 NT Examples

Suppose your recorder is connected to your first SCSI bus and has SCSI ID 6. It will be addressed as \\.\p0b0t6. You can test it using the inquiry command.

inquiry \\.\p0b0t6

will tell you the vendor and product ID. Once you identify your recorder, you can burn a disk.

iso9660 source=\ixos | cdglow -t \\.\p0b0t6

will create an ISO representation of the \ixos hierarchy and burn it to a CD. If you fear that iso9660 will miss the data rate, use preview mode to prevent the drive from writing:

iso9660 source=\ixos|cdglow -p -t \\.\p0b0t6

If iso9660 missed the data rate, use an extra partition or file:

iso9660 source=\ixos>\temp\image
cdglow -s \temp\image -S -t \\.\p0b0t6

where \temp\image is the file to be created. You can use the -f1 or - f2 option to force cdglow to lower the drive's speed to a less demanding data rate.

iso9660 has many options that describe the image style. For example,

iso9660 rr name=USR1 source=\usr1>\temp\image

will create an ISO 9660 image with Rock Ridge extensions of the /usr1 tree.

Using a second CD drive, for example \\.\p0b0t3, you can copy ISO 9660 CDs.

cdglow -v -s \\.\p0b0t3 -t \\.\p0b0t6

copies a CD to a recordable CD and verifies it. The source should be faster than the target; otherwise even very small delays may accumulate and cause a buffer underrun. You can use the -f1 or -f2 option to slow down the target.

5.4 UNIX Examples

Suppose your recorder is connected to your first SCSI bus and has SCSI ID 6. It will be addressed as /dev/iXOS_SCSI0/6. You can test it using the inquiry command.

inquiry /dev/iXOS_SCSI0/6

will tell you the vendor and product ID. Once you identify your recorder, you can burn a disk.

iso9660 source=/ixos | cdglow -t /dev/iXOS_SCSI0/6

will create an ISO representation of the /iXOS hierarchy and burn it to a CD. If you fear that iso9660 will miss the data rate, use preview mode to prevent the drive from writing.

iso9660 source=/ixos|cdglow -p -t /dev/iXOS_SCSI0/6

If iso9660 missed the data rate, generate an ISO9660 image first:

iso9660 source=/ixos>/temp/image.iso

After the iso9660 image is completed, use the image as a source for cdglow:

cdglow -s /temp/image.iso -S -t iso9660
source=/ixos|cdglow -t /dev/iXOS_SCSI0/6

where /temp/image is the file to be created. You can use the -f1 or - f2 option to force cdglow to lower the drive's speed to a less demanding data rate.

iso9660 has many options that describe the image style. For example,

iso9660 rr name=USR1 source=/usr1>/temp/image

will create an ISO9660 image with Rock Ridge extensions of the /usr1 tree.

Using a second CD drive, for example /dev/iXOS_SCSI0/3, you can copy ISO9660 CDs.

cdglow -v -s /dev/iXOS_SCSI0/3 -t
/dev/iXOS_SCSI0/6

copies a CD to a recordable CD and verifies it. The source should be faster than the target, otherwise even very small delays may accumulate and cause a buffer underrun. You can use the -f1 or -f2 option to slow down the target.

5.5 Log Messages

cdglow produces log messages, beginning with the time in hundredths of seconds. The messages tell you which hardware cdglow found, how many blocks it intends to write, that it has finished writing the data, and that the whole CD is finished. If you use the -v option, it also reports how many and which blocks of the source differ from the CD. They should not differ at all, but if a byte was transmitted incorrectly over the SCSI bus, you will detect the error here. Note that the exit value is 0 only if everything was correct.

If there is a failure you receive an error message. Often you receive two error messages because cdglow splits into two threads that ensure the constant data rate, and failure of one thread causes the other to fail also.

5.6 Producing CDs in Jukeboxes

cdglow knows nothing about jukeboxes, but the iXOS-JUKEMAN file system server knows nearly all types of jukeboxes, and you can use it to create CDs.

Note that starting with version 2.1 of iXOS-JUKEMAN, you don't need to set up two different device description files or to change the only device description file in order to reserve a recorder for writing, as you had to in previous versions! Likewise, the CD- recordables you intend to write can be included in the set of slots administered by iXOS-JUKEMAN.

First you disable the recorder drive of your jukebox for use by the filesystem by the command

cdadm detach jb.dev -d 4

This assumes that the jukebox device description file is jb.dev and that the recorder is the fourth drive of the jukebox. You can later reattach it by issuing

cdadm attach jb.dev -d 4

Next insert the recordable CDs into the jukebox, which can be done using the cdadm import command (see "import (insert), export (remove), and testcd" in Chapter 3 for instructions on doing this for your jukebox). Note that setting the blanks server parameter to a value of 2 for this purpose will speed up this process dramatically (don't forget to reset it to 0 afterwards, though), see the description of this parameter in chapter 3 for details.

If you plan to insert a large number of recordable CDs, importing them one by one may be time consuming. You can open the jukebox directly to perform the import manually. Many jukeboxes, like the NSM Mercury or Pioneer DRM 1004x make this easy with there magazines. You must, however, detach the jukebox before you can open it. After the import, immediately after the reattach, you have to issue a

cdadm rescan jb_write.dev

to update the jukebox's memory concerning which slots are filled and which are empty. This command is only mandatory for jukeboxes with non-volatile memory, like the Pioneer 5004x or the Grundig M200, which might otherwise damage themselves. For jukeboxes without such a memory, the command will immediately return, hence just use it if in doubt.

After successful import of the recordable CDs, you have two options depending on whether you want to write only one or two CDs or plan to burn a whole series.

5.6.1 Burning a Single CD

Insert one of the (empty) recordable CDs into the recorder drive using a command like

cdadm movecd jb_write.dev 4 9

which moves the CD from slot 9 of the jukebox described in jb_write.dev to the recorder drive, which is assumed to be drive 4.

Now you can burn the CD as in any CD recorder, even while users access readable CDs in the jukebox.

A possible NT command would be:

cdglow -v -s C:\temp\image.iso -S -t \\.\p1b0t5

A possible UNIX command would be:

cdglow -v -s /temp/image.iso -S -t /dev/iXOS_SCSI1/5

to write and verify a CD in the writer at SCSI ID 5 of the second SCSI bus with an iso image.

When the CD is ready, the command

cdadm movecd jb_write.dev 4

removes the CD from drive 4. Now you have burned a CD in slot 9. You can take it out using cdadm export jb_write.dev 9, or you can add it to the jukebox file system by calling

cdadm testcd jb_write.dev 9

Afterwards you can make the recorder available for the file system again by issuing

cdadm attach jb.dev -d 4

5.6.2 Burning More than One CD from One Source

For convenience, the batch script burncds.bat (NT) or shell script burncds.sh (UNIX) is provided if you want to burn more than one CD in a jukebox from one source (either a CD or an iso file system). The script assumes that the jukebox is already attached to the server, that the recorder drive is disabled (as described above), and that the respective slots are filled with recordable CDs.

Note that you have to configure the script for your setup before you use it, as described below.

The syntax for NT is:

burncds device destination source slotnumbers

The syntax for UNIX is:

burncds.sh device destination source slotnumbers

where device is the name of the device file for the jukebox, destination is the SCSI ID of the recorder drive, source is either the SCSI ID of another SCSI drive or the name of a file containing an iso file system, and slotnumbers is a list of slot numbers where the CDs to be burned are kept.

Assume for instance that your device file is jukebox.dev, your source is an iso file system contained in C:\temp\source.iso (NT) or /tmp/source.iso (UNIX), your recorder has SCSI ID \\.\p0b0t6,0 (NT) or /dev/iXOS_SCSI0/6 (UNIX), and you want to burn the CDs in slots 1 to 5.

The NT command should be:

burncds jukebox.dev "\\.\p0b0t6,0" C:\temp\source.iso 1 2 3 4 5

Note:The quotation marks around the drive name are mandatory; otherwise, the 0 is counted as another argument ("," separates arguments of batch scripts).

The UNIX command should be:

burncds.sh jukebox.dev /dev/iXOS_SCSI0/6 /temp/source.iso 1 2 3 4 5

If your source device is another SCSI CD drive, for example, \\.\p1b0t3,3 (NT) or /dev/iXOS_SCSI1/4 (UNIX), and the CDs are scattered in slots 17, 25, and 39, then for NT you would use:

burncds jukebox.dev "\\.\p0b0t6,0" "\\.\p1b0t3,3" 17 25 39

For UNIX you would use:

burncds.sh jukebox.dev /dev/iXOS_SCSI1/4 17 25 39

If the command line was correct, the only output to your window should consist of lines like:

Burning CD in Slot 3 of jukebox.dev with source C:\temp\source.iso

for NT, or

Burning CD in Slot 3 of jukebox.dev with source /dev/iXOS_SCSI1/4

for UNIX.

The (standard and error) output for each burning process is redirected to a slotnumber.out file for each slot number argument. (To achieve this in NT, you need another batch script, makecd.bat, which is called by burncds.bat for each slotnumber.) Check these files for possible errors, including problems with the transport of CDs, buffer underruns, and verifying errors. Normally it is a good sign when all file sizes are the same or differ only in one or two bytes.

5.6.3 Configuring the burncds and makecd Scripts in NT

You need to configure the batch scripts burncds.bat and makecd.bat for your setup before using them. The lines that might require changes are enclosed in rem CONFIGURE BEGIN and rem CONFIGURE END comments.

In burncds.bat, look at the following line:

set jukeroot=D:\jukeman

Replace D:\jukeman by your jukeman root directory, most likely C:\jukeman.

makecd.bat contains the following configurable lines:

%jukeroot%\cdadm movecd %devfile% 1 %1

If the recorder drive is not the first drive of the jukebox (not the first one listed in the device file), replace 1 by the correct drive number.

%jukeroot%\cdglow -v -b 0x400000 %glowoption% -s
%jukesource% -t %jukedest%

This is the line where the real burning starts. You can add cdglow options, for instance - f1 or -f2 to lower the speed, or -b to allocate a smaller buffer for the burning process if you are short of main memory (-b 0x400000 allocates a buffer of 4 MB, the standard value without the -b option is 8 MB).

%jukeroot%\cdadm movecd %devfile% 1

Same as the cdadm movecd command above.

5.6.4 Configuring the burncds.sh Script in UNIX

You must configure the burncds.sh shell script for your setup before using it. The lines that might require changes are marked with a trailing CONFIGURE comment. This applies to the following lines:

PATH=$HOME/projects/jukeman/bin:$PATH # CONFIGURE

Replace the path $HOME/projects/jukeman/bin with the path where your jukeman binaries reside.

cdadm movecd $devfile 1 $I # CONFIGURE

If the recorder drive is not the first drive of the jukebox (not the first one listed in the device file), replace 1 with the correct drive number.

cdglow -v -s $jukesource $glowoption -t $jukedest # CONFIGURE

This is the line where the real burning starts. You can add cdglow options, for instance - f1 or -f2 to lower the speed, or -b to allocate a larger buffer for the burning process.

Before you begin burning, it may be useful to test your whole configuration using the -p option to avoid wasting recordable CDs.

cdadm movecd $devfile 1 # CONFIGURE

Same as the cdadm movecd command above.

5.6.5 Burning a CD Using the Windows NT GUI

To burn a CD using the GUI:

  1. If the Jukeman Administrator isn't running, double-click the Jukeman Administrator icon.
  2. Highlight the correct Jukeman device, and click Contents.
  3. Highlight a slot labeled 'empty' and click Insert or Change CD(depending on whether your device has a mail slot or not).
  4. Place the new CD in the jukebox and wait until the new CD is identified as 'blank.'
  5. Click the Jukeman CD Writer icon to start the Writer GUI.
  6. Enter the source drive where the data you want to burn is located. You can choose to read the data from a CD, a file containing an image of the data, or a subtree.
  7. Enter the target where you want to write the data. You can write the image to an .iso file or to recorder. If you want to check the size of the data before burning, select "just count bytes."
  8. Set options as required. To verify the data after it is burned, select "burn data and then verify it."
  9. Click OK to burn the CD. This will take some time. If the burning finished without problems, the writer GUI exits without any further notice; otherwise a dialogue with an error log will pop up.
  10. Add the new CD to the file system by selecting the CD in the contents dialogue of the Administration GUI and clicking Test

Testing the CD

Before you remove the CD from the jukebox, make sure the header can be read. Using the File Manager (NT 3.x) or Explorer (NT4.0), examine the directory structure to make sure the data was copied correctly. This should of course be the case if you didn't get any error message from the writer GUI.

[Table of Contents] [Glossary]

Send mail to webmaster@munich.ixos.de with questions or comments about this web site.
Copyright © 1997 iXOS Software GmbH
Last modified: