Writing CDs from UNIX  

Data (or other files) can be written to CD-R or CD-RW disks, using a CD writer on the PC or one on the UNIX computer moomomi. The latter is located in Remote Ops II, behind the short partition at the back left of the room (as seen from the door). Note that Keck does not supply blank CD-R disks to observers; they are expected to provide their own.

A simple interface to the CD writer is supplied: the command "data2cd". To use this command you must have all of your files in one directory. The program will write everything in that directory and in subdirectories within that directory (and in subdirectories below that, etc.). If you do not want to include data at some level within that directory you must delete or move those files or subdirectories.

data2cd directory title -n #

This is the format for the command. directory is the path to the data you wish to write. This can be a path relative to your current working directory. For example, if you wish to write the data in /sdata702/esi15/17aug01 to CD, and you are currently in /sdata702, you can use "data2cd esi15/17aug01".

title is some text that will be the name of the CD created. In general when you mount the CD on another UNIX system this will be the top level directory name. If no title is supplied, one will be created for you, consisting of your username, date and time. Note that if more than one disk is required, "_1", "_2", etc. will be appended to title.

-n # can be used to write multiple copies of each CD. For instance, if you want to write 2 copies of your data, use "-n 2".

Note that you can also issue just the "data2cd" command. It will then prompt you for appropriate input.

data2cd will then do the following:

  • partition your data into CD-sized chunks.

    Files called .partition.list.* will be created in your data directory. ("*" represents numbers 1, 2, etc. up to the number of partitions required.) File sizes are obtained from the "ls -l" command.

    Once the data have been partitioned in the lists, the program tells you how many CDs you will need for the data set, and how much space will be taken on each CD.

  • copy each disk's files to a staging area.

    Currently this is a subdirectory ".staging" on a headquarters scratch disk.

  • create a disk image.

    This is a file on the hard disk that is an image of what will be written to CD.

  • write the image file to "#" CDs (or only one CD if multiple copies have not been requested.

    The program will stop to confirm that a blank CD is installed in the drive before burning each CD.

  • erase the data in the staging area and start with the next partition.

    When the last partition is written, the .staging subdirectory and all the data in it will be removed, as will the .partition.list.* files.
  • As an example, let's assume that the directory /sdata702/esi15/17aug01 contains 2.3 GB of data. The command

    data2cd /s/sdata702/esi15/17aug01 ESI_Aug01 -n 2

    will write all of the data in that directory onto eight CDs (two identical sets of four), named ESI_Aug01_1, ESI_Aug01_2, ESI_Aug01_3, and ESI_Aug01_4.


    Go To:
    Instruments Home Page       Keck Home Page       Observer's Reference Shelf


    ESI Master
    23 October 2000