%-----------------------------------------------------------------------
%;  Copyright (C) 2004
%;  Associated Universities, Inc. Washington DC, USA.
%;
%;  This program is free software; you can redistribute it and/or
%;  modify it under the terms of the GNU General Public License as
%;  published by the Free Software Foundation; either version 2 of
%;  the License, or (at your option) any later version.
%;
%;  This program is distributed in the hope that it will be useful,
%;  but WITHOUT ANY WARRANTY; without even the implied warranty of
%;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%;  GNU General Public License for more details.
%;
%;  You should have received a copy of the GNU General Public
%;  License along with this program; if not, write to the Free
%;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
%;  MA 02139, USA.
%;
%;  Correspondence concerning AIPS should be addressed as follows:
%;         Internet email: aipsmail@nrao.edu.
%;         Postal address: AIPS Project Office
%;                         National Radio Astronomy Observatory
%;                         520 Edgemont Road
%;                         Charlottesville, VA 22903-2475 USA
%-----------------------------------------------------------------------
%first draft, 20-Jan-2004
%
\documentclass[twoside]{article}
\usepackage{graphics}
\input LaCook.mac
\setlength\tabcolsep{0pt}%  was 6
\newcommand{\Mbtd}{\ps\par
    \begin{tabular*}{\textwidth}[t]{p{2.801in}p{3.7in}}}
\newcommand{\dispM}[2]{\Mbtd{\tt >\ }{\us #1}&#2\xetd}
\renewcommand{\doFIG}{T}
\title{Using DVDs with \AIPS \\
  \AIPS\ Memo No.~109}
\author{Greg Taylor \&\ Eric W. Greisen}
\date{January 20, 2004}
\renewcommand{\titlea}{\AIPS\ Memo No.~109: 20-Jan-2004}
\renewcommand{\Rheading}{\titlea\hfill}
\renewcommand{\Lheading}{\hfill \titlea}
\markboth{\Lheading}{\Rheading}
\maketitle

\begin{abstract}
DVDs can be read and written by \AIPS\ using a udf file system on a
DVD+RW device.  Once written, they can be used inside {\tt 31DEC04}
\AIPS\ when mounted on read-only DVD devices.  This capablity also
allows users to limit access for other users to their data areas.

\end{abstract}

\noindent{\Large{\bf How to use DVDs with \AIPS}}

\AIPS\ can take advantage of the inexpensive and convenient DVD+RW
format by creating an \AIPS\ disk on a DVD+RW mounted with the udf
filesystem.  Such a disk has 4.7 GB of removable storage space and is
fully re-writable.  Multiple disks (\eg\ one for each project of
interest) can be alternately mounted as desired, and/or transported to
other machines.  The access time is roughly 5 times slower than a
standard internal IDE disk when writing, but otherwise the
functionality is the same as any other \AIPS\ disk.  For performance
reasons, the parameter {\tt BADDISK} should be set to avoid creating
scratch disks on the DVD+RW disk.  Disks created on a DVD+RW drive can
also be read on most read-only DVD drives.  Again the disk functions
like a normal \AIPS\ disk.  Tasks such as {\tt UVCOP}, {\tt MOVE} and
{\tt SUBIM} can be used to transfer data to another disk, but tasks
that require writing to the DVD will fail.  Tasks and verbs to inspect
data such as {\tt PRTUV}, {\tt LISTR}, {\tt TVALL}, and {\tt IMEAN}
should work.  (Note that {\tt IMEAN}'s option to add a keyword to the
header will not work on a read-only file system, but the task
functions normally even if this error is encountered.)

To enable this capability the following steps are required:
\begin{enumerate}
\item If not already installed, download the UDF packet writing tools.
      These can be obtained from {\tt
      http://sourceforge.net/projects/linux-udf}
\item The kernel options {\tt CONFIG\_UDF\_FS}, and {\tt
      CONFIG\_UDF\_RW} must both be switched on.  If they are not
      already built in to the kernel, then the existing kernel will
      need to be reconfigured and rebuilt.
\item A UDF filesystem needs to be created on a DVD.  This can be
      accomplished with the {\tt mkudffs} command in the UDF tools, or
      under Windows by formatting a DLA disk.
\item The DVD+RW drive needs to be mounted by the system specifying
      the UDF filesystem, \eg\\
      \hbox{\hspace{5em}{\tt mount -t udf /dev/scd1 /mnt/fwcd}}\\
      \hbox{or}\\
      \hbox{\hspace{5em}{\tt mount -t udf /dev/cdrom /mnt/fwcd}}
\item Symbolic links need to be created pointing to the DVD+RW
      filesystem mounted at {\tt /mnt/fwcd}, and \AIPS\ needs to be
      told to look for the disk in the same way as when any new drive
      is added to the system and then restarted once it has been set
      up.  (Set up suitable link files and edit {\tt
      \$AIPS\_ROOT/DA00/} files {\tt DADEVS.LIST} and {\tt NETSP}.)
\end{enumerate}

\vfill\eject
\noindent{\Large{\bf \AIPS\ modifications for read-only file systems}}

So far the capability described above has only been tested under Linux
with the {\tt 31DEC04} version of \AIPS\@.  Earlier versions of \AIPS\
may be able to use a DVD+RW drive, but will not be able to use a disk
that has been mounted read-only (such as a DVD-ROM drive).

{\tt 31DEC04} \AIPS\ was modified on 19 January, 2004 (midnight job of
20-Jan-2004 and later) to understand that read-only file systems may
exist as \AIPS\ data disks.  The routine pair ZDRCHK and ZDRCH2 are
called by {\tt AIPS} and all tasks after they have established the
users number.  They check for the existence of \AIPS\ catalog ({\tt
CA}) files for the given user number on each disk and determine if the
files are read only.  The file creation routines will not attempt to
create files on a read-only disk and the automatic updating in the
{\tt CA} file of the last-access time and file status are skipped.

This capability has in fact two uses.  The first is the use of a
pre-written DVD as an \AIPS\ disk  on a DVD-ROM drive.  The other,
however, uses normal disk drives with file read-write privileges set
for one user but not another.  For example, login {\tt professor}
could make his files available to login {\tt student} as read-only by
simply setting {\tt chmod og-w CA*} in the \AIPS\ data areas.

\end{document}






