University Computing Systems


In an effort to archive large research directories to removable media (i.e.,
CD or DVD) an archiving script was developed.  This script has the ability to
archive any AFS or local directory to the media of choice.  

When the size of a directory is larger than the physical media which is to be
used, the directory can be spanned, i.e., spread across muliple disks.
In the case of DVDs, if a directory is larger than 2GB and less than 4GB (the
capacity of a single DVD) it will still be spanned into two span files but
those two files can be written to the same DVD media (see below).

When a directory is spanned, the entire directory is first tarred using GNU
tar.  The tar file is then split into chunks of 700MB for CD media and 2 GB for
DVD media using the p7zip utility.  It should be noted that the spansize for DVD 
is set to 2GB due to a bug that exists in the ISO filesystem which prevents 
having a single file which is larger than 2GB in an ISO archive.  The workaround 
for this is to create 2GB archive files then write them out to DVD making use of 
the full 4GB of space available on a DVD. 

The script can be used either interactively or can be used with
the following command line syntax:

	dirarch -d [archive dir] [ -s scratch dir] [-m media] [-i] [-e] [-v]

	The "archive dir" is the directory which is to be archived.  This directory can
	be in AFS or can be a directory which resides on local disk.

	The "scratch dir" should be set to some sort of scratch area which will be used
	to hold the tar and span files as well as the resulting ISO images.  It is
	recommended that this directory be on a local scratch disk to improve speed.
	The scratch directory should be twice as large as the directory being archived.
	Defaults to /scratch if not specified.

	The "media" is either CD or DVD, defaults to DVD.

	Using the -i switch will only create the resulting ISO images and not burn them
	to the resulting media.

	The -e switch can be used to send an email notifcation alert that the media
	needs to be inserted.  This option can be helpful when archiving directories
	that are several GBs in size.

	To turn on verbose messages, use the -v switch.



Extraction:


	Since the files are first tarred then spanned, the entire tar file will have
	to be extracted before any one file can be retrieved from the tar file.

	While GNU tar is used to initially create the tar file, one may use p7zip to
	extract the contents of the tar file.   

			Example:

				file.tar.7z.001
				file.tar.7z.002
				file.tar.7z.003

				The above files are spanned 7zip archive files.  To extract the tar
				file, file.tar one can run the following command:

				7z x file.tar.7z.001

				The contents of the tar file can be extracted using 7zip

				7z x file.tar

				or by using the conventional method, GNU tar

				tar xpvf file.tar



References:

	http://www.gnu.org/software/tar
	http://p7zio.sourceforge.net
	http://www.7-zip.org/
	http://cdrecord.berlios.de/old/private/cdrecord.html
	http://fy.chalmers.se/~appro/linux/DVD+RW/
	http://fy.chalmers.se/~appro/linux/DVD+RW/-RW/

This document last modified Wed Mar 1 12:53:32 EST 2006