TAPE CUTTING & EXTRACTING 101:

A guide to tape stewardship by Joel Famini (minor additions by Jay)

 

 

1.                   INTRODUCTION

 

The Allied Geophysical Laboratory is well-equipped to handle most types of portable data formats (CD’s, DVD’s, etc.)  For large data volumes like most seismic data, the most common method of transport and exchanging data is with data tapes.  The facilities on hand are physically located in Rm. 232 of the Science & Research Bldg. 1  The tape drives are physically connected to top-gun.agl.uh.edu, a server currently serving various AGL processes. 

 

The 3 most common types are DLT, 8mm exabytes, and DDS tape formats.  The size of the tape on hand should give you an idea of which drive to use.  DO NOT forcibly insert the tape into the drives as it may damage the tape as well as the drives themselves.  If you are having problems inserting the tape, look for someone who knows how to properly load it.

 

The individual tape drives have their own physical address.  To think of it in a WINDOWS environment, it’s like your hard drive is called the “C drive,” the floppy drive is the “A drive,” and so on.  The tape drive for the DLT-IV is /dev/rmt/4, the tape drive for the 8mm Exabyte is /dev/rmt/1 and /2, and the DDS4 tape drive is at /dev/rmt/3.  You could think of it as that thee drives as a “remote device.”

 

DLT-IV tapes (Figure 1) are the ~4X4 inch big tapes and could contain maximum of approximately 40 GB of data, although it is a good idea not to maximize the capacity and keep the file size to around the 35 GB level.

 

Figure 1 – Example of DLT-IV Tape

 

            The next most common tape format is the exabyte tape (Figure 2).  This is more popularly known as an 8mm tape that is used in video camcorders.  They can have a maximum capacity of about 5GB, although again it is better if data size is kept to about 4 GB. 

 

Figure 2 – Example of 8mm exabyte.

 

            The next tape format is called a DDS4 format (Figure 3).  They are smaller than the exabyte tapes although they can contain more data, approximately 20 GB. 

 

Figure 3 – Example of 4mm DDS4 tape

 

Two words to familiarize with when dealing with tapes are EXTRACTING and CUTTING.  EXTRACTING from a tape is the process of copying or taking data from a tape and loading it into a location of your choice in the network.  CUTTING a tape is the process of copying data from a network location and loading it into the tape.

 

Where is the Tape Drives Located?

 

The tape drives are physically located in room 230 of sr1 next to the plotter/printer. It is directly connected to the workstation top-gun. When you approach the workstation you will see a host of tape drives stacked on top of each other. On the front of these tape drives, there are stickers indicating the device number in the form “/dev/rmt/#” for example “/dev/rmt/0”, make sure you note this number when you insert the tape in the drive since you would need to use it in the instructions below.

 

2.                   LOGGING ON

 

After loading the tape into the appropriate drive you are now ready to login into the system.  There are two methods to proceed upon, which after the logging in process eventually intersect.  Method 1 is logging in directly into a Sun Workstation in Rm. 232.  Since you are assuming Tape Overlord responsibilities, this cheat sheet assumes that you are now familiar with logging in and out of a Sun Workstation and hence would not be covered here.  Instead, Method 2 will be covered dealing with remotely logging into the Geoscience Network and doing the deed from afar. 

 

            To login into the Geoscience Network from a remote location, i.e. your house, your parent’s basement, etc, you will need the SSH Secure Shell Client.  This is the companion software you downloaded and installed along with SSH Secure Shell File Transfer Client.  The file transfer client has been discussed in the previous cheat sheet called “Using SSH Secure File Transfer”, and hence will not be dealt with here. 

 

            SSH Secure Shell Client is a remote access UNIX simulator for your WINDOWS PC.  Once connected to your server of choice, you can do all standard UNIX commands and processes except those that require X-Window functionality or those programs that require a process window to pop up during processing, i.e. Geoframe, Xtpen, Grey, FOCUS, etc. 

 

            To login, activate SSH Secure Shell Client.  There are two ways to connect: a) by clicking the small computer icon on the left side of the program, b) by clicking on “Quick Connect.”  Look at red arrows for guidance.  On both methods, a dialog box will appear (Figure 4) where you type in the host name of the server you are logging into, i.e. geossun1.geosc.uh.edu or sheriff.agl.uh.edu, and your login name. Press “Connect.”

 

 

Figure 4 – Logging into geossun1 via SSH Secure Shell Client

 

The first time you use this program, a dialog box will pop up asking you that the server doesn’t recognize the host key.  Just press “OK”.  If it asks you if you want to save the host key to the server, just press “YES”.  This will not harm your log-in.  After this, a dialog box asking for your password pops up (Figure 5).  Click “OK”. Once you have logged into the system either via SSH Secure Shell Client or directly into a Sun Workstation, the process is exactly the same to cut a tape.

 

Figure 5 – The password dialog box.

 

An important thing to remember is that you must have access to the top-gun server, with address of top-gun.agl.uh.edu. 

 

Once logged-on into top-gun, cd to the directory where the file is located, usually found at /atlas/segy_data.  For the purposes of this guide, let us cut the marmousi-II data onto a tape.  For this case, we will be using a DLT-IV tape.  The marmousi-II file is located at /atlas/numerical_models/marmousi-II.  If you are just going to copy individual files, go inside the directory that contains the file.  If you are going to copy the entire folder and its contents, go up one level where the folder is, in this case /atlas/numerical_models.

 

A very useful command to take note of is the “mt” command related to tape drives. With this command you can discover the status of the tape, rewind a tape, eject a tape etc. So,

 

-          To get the status of the tape, to check if the tape is actually loaded in the tape drive use the following syntax

 

mt –f  /dev/rmt/# status

 

The different outputs could be,

o        /dev/rmt/# Device busy (this is the case if the tape is being used by some user or process)

o        /dev/rmt/#: no tape loaded or drive offline (this is the case if there is no tape in the drive)

o        Exabyte EXB-8500 8mm Helical Scan tape drive: (this is the case if you just loaded the tape and there is no process or user using the drive)

   sense key(0x0)= No Additional Sense   residual= 0   retries= 0

   file no= 0   block no= 0

 

the third output is ideally what you would want to see to ensure the tape is loaded in the drive, the output will differ depending upon the drive  you are using, for DLT drive it could be “TANDBERG DLT-7000 …”

 

-          To get more command that are possible, check out the man page of “mt” using the command “man mt”

 

 

3.                   CUTTING A TAPE

 

When trying to cut a tape, it is important to know the file size.  We already covered the optimum volume size to use for each type of tape.   Type in the command “lsltr” to list all the contents of a folder, plus file size and even the author of the file and permissions.  For this process, our only concern is with file sizes, which is the fifth column from the left.  Once we have figured out our file sizes, we are now ready to cut the tape.  Since a common practice is to cut multiple files at one time, we would be using the “tar” command, although there are other commands to use when cutting tapes.  This will be discussed later.

 

To copy the marmousi-II file to tape, be one folder above the folder to be copied.  At the command prompt, type in the command “tar –cvf /dev/rmt/4 [file_folder]”.  We used the number 4 since this is the device number of the DLT-IV drive.  Remember to note the drive number of the tape you are using.  If you are cutting individual files, instead of typing in the name of the file folder, type in the individual file names.  Times for cutting a tape varies, although a good rule of thumb is to start the job before you go home, by the time you get back the next morning, it is ready.  To check if the files were copied correctly, type in the command “tar –tvf /dev/rmt/4”

 

4.                   UPLOADING FILES FROM TAPE

 

Uploading or extracting a tape is copying from a tape to the network.  Before you upload a tape, make sure that the tape is “write-protected.”  This is to protect your data just in case anything goes awry when you are copying the files.  For any media format, just flip the red switch to write-protect the tape. 

 

Go to the folder where you want to extract the file.  To extract tar-formatted files, type in the command tar –xvf /dev/rmt/4.  IMPORTANT: the tar command will only work for tapes that were created using the “tar” command.  For non-“tar” tapes, continue reading on……..

 

HANDY TIP: A good Mnemonic device is:

tarcvf: c is for cutting

tarxvf: x is for extracting

tartvf: t is for testing

 

1.                   WHAT IF THE TAPE WAS NOT MADE WITH THE “TAR” COMMMAND?

 

There are other commands besides “tar” to use to copy from tape.  The easiest one to use is the dd command.  To copy from tape to network using dd, type in dd if=/dev/rmt/4 of=/file_location_where_you_want_to_dump_the_file/filename.segy.  IF means the input file, which in this case is the tape drive (again, in this case is the DLT-IV drive, 4), of is the output file.  This command usually asks for a block size, meaning how many blocks within the tape it uses.  To cover all your bases, type in at the end of the line bs=10240.  This would cover all the bases on which type of tape you are using.

 

To copy a file from network to tape using the dd command, just reverse the commands.  Go to the file folder where the file is located.  For input file, type in the filename, and for the output file, type in the location of the tape drive. 

 

The dd command is analogous to dragging and dropping in the WINDOWS environment.  You are just copying the file directly from a tape, and not doing any fancy compression algorithms.

 

2.                   THE “T COPY” COMMAND

 

To use “T Copy” in copying a file from tape, go to the directory where you want to place the file.  Type in “tcopy /dev/rmt/4 file_name.segy.” Before you use this command, make sure you have a file called “file_name.segy” in your current directory. You can ensure this by typing the command “touch file_name.segy”. The first part of the command is the location of the tape drive and the second part is the output filename.  To use it to copy a file to a tape, again just reverse the command line, with the name of the file to be copied first followed by the location of the physical drive. 

 

3.                   “TUTL” METHOD OF CUTTING AND UPLOADING FILES

 

TUTL or Tape Utility is the DISCO/FOCUS tape loading utility.  This is a command that has more functionality than just tape copying, and hence will be covered in a more comprehensive cheat sheet

dedicated to TUTL.