System Administration Guide: Devices and File Systems

ProcedureHow to Retrieve Files From a Tape (tar)

Steps
  1. Change to the directory where you want to put the files.

  2. Insert the tape into the tape drive.

  3. Retrieve the files from the tape.


    $ tar xvf /dev/rmt/n [filenames]
    x

    Indicates that the files should be extracted from the specified archive file. All files on the tape in the specified drive are copied to the current directory.

    v

    Displays the name of each file as it is retrieved.

    f /dev/rmt/n

    Indicates the tape device that contains the archive.

    filenames

    Specifies a file to retrieve. Separate multiple files with spaces.

    For more information, see the tar(1) man page.

  4. Verify that the files are copied.


    $ ls -l 
    

Example 27–5 Retrieving the Files on a Tape (tar)

The following example shows how to retrieve all the files from the tape in drive 0.


$ cd /var/tmp
$ tar xvf /dev/rmt/0
x reports/, 0 bytes, 0 tape blocks
x reports/reportA, 0 bytes, 0 tape blocks
x reports/reportB, 0 bytes, 0 tape blocks
x reports/reportC, 0 bytes, 0 tape blocks
x reports/reportD, 0 bytes, 0 tape blocks
$ ls -l

Troubleshooting

Note –

The names of the files extracted from the tape must exactly match the names of the files that are stored on the archive. If you have any doubts about the names or paths of the files, first list the files on the tape. For instructions on listing the files on the tape, see How to List the Files on a Tape (tar).