JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Devices and File Systems
search filter icon
search icon

Document Information

Preface

1.  Managing Removable Media (Overview)

2.  Managing Removable Media (Tasks)

3.  Accessing Removable Media (Tasks)

4.  Writing CDs and DVDs (Tasks)

5.  Managing Devices (Overview/Tasks)

6.  Dynamically Configuring Devices (Tasks)

7.  Using USB Devices (Overview)

8.  Using USB Devices (Tasks)

9.  Using InfiniBand Devices (Overview/Tasks)

10.  Managing Disks (Overview)

11.  Administering Disks (Tasks)

12.  SPARC: Adding a Disk (Tasks)

13.  x86: Adding a Disk (Tasks)

14.  Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)

15.  The format Utility (Reference)

16.  Managing File Systems (Overview)

17.  Creating ZFS, UFS, TMPFS, and LOFS File Systems (Tasks)

18.  Mounting and Unmounting File Systems (Tasks)

19.  Using The CacheFS File System (Tasks)

20.  Configuring Additional Swap Space (Tasks)

21.  Checking UFS File System Consistency (Tasks)

22.  UFS File System (Reference)

23.  Backing Up and Restoring UFS File Systems (Overview)

24.  Backing Up UFS Files and File Systems (Tasks)

25.  Using UFS Snapshots (Tasks)

26.  Restoring UFS Files and File Systems (Tasks)

27.  UFS Backup and Restore Commands (Reference)

28.  Copying UFS Files and File Systems (Tasks)

Commands for Copying File Systems

Copying File Systems Between Disks

Making a Literal File System Copy

How to Copy a Disk (dd)

Copying Directories Between File Systems (cpio Command)

How to Copy Directories Between File Systems (cpio)

Copying Files and File Systems to Tape

Copying Files to Tape (tar Command)

How to Copy Files to a Tape (tar)

How to List the Files on a Tape (tar)

How to Retrieve Files From a Tape (tar)

Copying Files to a Tape With the pax Command

How to Copy Files to a Tape (pax)

Copying Files to Tape With the cpio Command

How to Copy All Files in a Directory to a Tape (cpio)

How to List the Files on a Tape (cpio)

How to Retrieve All Files From a Tape (cpio)

How to Retrieve Specific Files From a Tape (cpio)

Copying Files to a Remote Tape Device

How to Copy Files to a Remote Tape Device (tar and dd)

How to Extract Files From a Remote Tape Device

Copying Files and File Systems to Diskette

What You Should Know When Copying Files to Diskettes

How to Copy Files to a Single Formatted Diskette (tar)

How to List the Files on a Diskette (tar)

How to Retrieve Files From a Diskette (tar)

Archiving Files to Multiple Diskettes

29.  Managing Tape Drives (Tasks)

Index

Copying Files to a Remote Tape Device

How to Copy Files to a Remote Tape Device (tar and dd)

  1. The following prerequisites must be met to use a remote tape drive:
    1. The local host name and optionally, the user name of the user doing the copy, must appear in the remote system's /etc/hosts.equiv file. Or, the user doing the copy must have his or her home directory accessible on the remote machine, and have the local machine name in $HOME/.rhosts.

      For more information, see the hosts.equiv(4) man page.

    2. An entry for the remote system must be in the local system's /etc/inet/hosts file or in the name service hosts file.
  2. To test whether you have the appropriate permission to execute a remote command, try the following:
    $ rsh remotehost echo test

    If test is echoed back to you, you have permission to execute remote commands. If Permission denied is echoed back to you, check your setup as described in Step 1.

  3. Change to the directory where you want to put the files.
  4. Insert the tape into the tape drive.
  5. Copy the files to a remote tape drive.
    $ tar cvf - filenames | rsh remote-host dd of=/dev/rmt/n obs=block-size
    tar cf

    Creates a tape archive, lists the files as they are archived, and specifies the tape device.

    v

    Provides additional information about the tar file entries.

    - (Hyphen)

    Represents a placeholder for the tape device.

    filenames

    Identifies the files to be copied. Separate multiple files with spaces.

    rsh | remote-host

    Pipes the tar command's output to a remote shell.

    dd of= /dev/rmt/n

    Represents the output device.

    obs=block-size

    Represents the blocking factor.

  6. Remove the tape from the drive. Write the names of the files on the tape label.

Example 28-12 Copying Files to a Remote Tape Drive (tar and dd)

# tar cvf - * | rsh mercury dd of=/dev/rmt/0 obs=126b
a answers/ 0 tape blocks
a answers/test129 1 tape blocks
a sc.directives/ 0 tape blocks
a sc.directives/sc.190089 1 tape blocks
a tests/ 0 tape blocks
a tests/test131 1 tape blocks
6+9 records in
0+1 records out

How to Extract Files From a Remote Tape Device

  1. Insert the tape into the tape drive.
  2. Change to a temporary directory.
    $ cd /var/tmp
  3. Extract the files from a remote tape device.
    $ rsh remote-host dd if=/dev/rmt/n | tar xvBpf -
    rsh remote-host

    Indicates a remote shell that is started to extract the files from the tape device by using the dd command.

    dd if=/dev/rmt/n

    Indicates the input device.

    | tar xvBpf -

    Pipes the output of the dd command to the tar command, which is used to restore the files.

  4. Verify that the files have been extracted.
    $ ls -l

Example 28-13 Extracting Files From a Remote Tape Drive

$ cd /var/tmp
$ rsh mercury dd if=/dev/rmt/0 | tar xvBpf -
x answers/, 0 bytes, 0 tape blocks
x answers/test129, 48 bytes, 1 tape blocks
20+0 records in
20+0 records out
x sc.directives/, 0 bytes, 0 tape blocks
x sc.directives/sc.190089, 77 bytes, 1 tape blocks
x tests/, 0 bytes, 0 tape blocks
x tests/test131, 84 bytes, 1 tape blocks
$ ls -l