CHAPTER 7: TAPE AND CD MEDIA Utilities
back to the Computing Guide Contents


There are a number of Unix utilities for moving files from tape to disk, disk to tape, disk to disk, and disk to CD media. This section will outline some of the basic uses of these utilities.

This chapter will cover the following information:

Following is information on the general-access tape drives available.
 
System Architecture Generic Device Name Device Type
bodhi SGI /dev/rmt/tps5d5 DLT 2000
hop SGI /dev/rmt/tps3d5 DLT 4000
mmm SGI /dev/rmt/tps2d5 DLT 4000
pinon SGI /dev/rmt/tps0d2 4mm DAT
cedar DECAlpha /dev/rmt0h 4mm DAT
thorn Sun /dev/rmt/1 4mm DAT
thorn Sun /dev/rmt/2 8mm Exabyte 8500
hazel Sun /dev/rmt/0 8mm Exabyte 8500

The above device names are generic names.  Depending on your application the actual device name will vary, for instance, to utilize the no rewind option on pinon the device name would be /dev/rmt/tps0d2nr.  For specific information on each architecture, refer to the following man pages about the SCSI drive interfaces.

Note that it is sometimes necessary to connect the tape devices to other systems. If you cannot locate a drive, submit an assist request.

7.1 The mt Command



The mt utility is a magnetic tape manipulating program that allows you to perform various positioning functions on a magnetic tape. Some of the options can be performed multiple times if the count parameter is specified. If count is not specified, the command executes once.
        Syntax: mt -f device command count
For example, to rewind a tape, enter:
        mt -f /dev/nrmt0h rewind
To skip forward five files on the tape, enter:
        mt -f /dev/nrmt0h fsf 5
Other useful commands to use with mt are
        bsf count  Move backward count files. 
        bsr count  Move backward count records.        
        fsr count  Move forward count records.
        eof count  Write count end-of-file marks at 
                   current position on tape.

        status     Get status of tape device.

On-line Information



Return to top of page

7.2 The tar Command


The tape archive utility, tar, saves and restores multiple files to and from a single tape or archive file (tar file). There are various options for creating a tar file and extracting files from it.

        Syntax: tar options device directory
For a listing of a tape archive's contents, enter
         tar -tv /dev/rmt0h
The actual device name will vary by machine.  To list the contents of a tar archive file, enter
         tar -tvf file.tar
To read a tar file from a tape device, set your default to the directory above the one that you want to restore the files to. For instance, user jones would restore files to a directory below the directory data with the following steps.
1.      List the tape's contents to find the top-level 
        directory name as shown above.

2.      Enter the following.

        cd /user1/jones/data 

        mkdir directory

        tar -xv /dev/rmt0h
The x option extracts files. The v (verbose) option lists the files to your screen as it restores them.

To write a tar file to tape, use the c (create) option. For instance, user jones can make a tar file of her entire directory with the following command:

        cd /user1/jones

        tar -cv /dev/rmt0h .
To create a tar file on disk rather than tape, first locate a disk with enough space to create the resulting .tar file. User jones would then enter:
        cd /user1/jones/
 
        tar -cvf /disk/jones/files.tar files

which would tar up the sub-directory structure files. To read a tar file from disk, set your default to the directory above the one where you want to restore the files, and enter:

        tar -xvf files.tar 

which would restore the files sub-directory structure.

Note: When moving tar files across the network via ftp, be sure to use binary mode.


On-line Information



Return to top of page

7.3 The dd Command


The dd command copies an input file to an output file. These can be either tape-to-disk or disk-to-disk copies. This command is particularly useful for I/O, as it allows you to read and write arbitrary record sizes.

        Syntax: dd options
For example, to read an input file from a tape device to a file on disk and convert the records from variable length to fixed length in the process, enter
        dd if=/dev/nrmt0h of=data conv=block
Other useful options of the dd command are
        ibs             Input block size (512 default).
        obs             Output block size (512 default).
        skip=n          Skip n records before starting
                        to copy. 

        files=n         Skip n files before starting to copy.

        conv=unblock    Convert fixed-length records to variable 
                        length records.

On-Line Information



Return to top of page

7.4 CD Writer


A Linux-based CDROM writer is now available. The Linux system is called mimosa and is physically located in Cubicle 2060. The following instructions can be used on mimosa or any other Linux system with a a CD-RW drive. We trust you have received the usual lecture from the local System Administrator. It usually boils down to these two things: Once this process is complete, remove your files from the /mimosa directory, as space is limited. Following are some guidelines when creating a CD.
Copyright © UCAR 1998 - Disclaimer - mmminfo@ncar.ucar.edu
Last Modified: 1 December 2002