Sun Microsystems Logo
Products & Services
 
Support & Training
 
 

Previous Previous     Contents     Index     Next Next
Chapter 51

Copying UFS Files and File Systems (Tasks)

This chapter describes how to copy UFS files and file systems to disk, tape, and diskettes by using various backup commands.

This is a list of the step-by-step instructions in this chapter.

Commands for Copying File Systems

When you need to back up and restore complete file systems, use the ufsdump and ufsrestore commands described in Chapter 50, UFS Backup and Restore Commands (Reference). When you want to copy or move individual files, portions of file systems, or complete file systems, you can use the procedures described in this chapter instead of the ufsdump and ufsrestore commands.

The following table describes when to use the various backup commands.

Table 51-1 When to Use Various Backup Commands

Task

Command

For More Information

Back up file systems to tape

ufsdump

How to Backup a File System to Tape 

Create a file system snapshot

fssnap

Chapter 48, Using UFS Snapshots (Tasks) 

Restore file systems from tape

ufsrestore

How to Restore a Complete File System 

Transport files to other systems

pax, tar, or cpio

Copying Files and File Systems to Tape 

Copy files or file systems between disks

dd

How to Copy a Disk (dd) 

Copy files to diskette

tar

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

The following table describes various backup and restore commands.

Table 51-2 Summary of Various Backup Commands

Command Name

Aware of File System Boundaries?

Supports Multiple Volume Backups?

Physical or Logical Copy?

volcopy

Yes

Yes

Physical

tar

No

No

Logical

cpio

No

Yes

Logical

pax

Yes

Yes

Logical

dd

Yes

No

Physical

ufsdump/ufsrestore

Yes

Yes

Logical

The following sections describe the advantages and disadvantages of each command. Also provided are step-by-step instructions and examples of how to use the commands.

Copying File Systems Between Disks

Two commands are used to copy file systems between disks:

  • volcopy

  • dd

For more information about volcopy, see the volcopy(1M) man page.

The next section describes how to use the dd command to copy file systems between disks.

Making a Literal File System Copy

The dd command makes a literal (block-level) copy of a complete UFS file system to another file system or to a tape. By default, the dd command copies standard input to standard output.


Note - Do not use the dd command with variable-length tape drives without first specifying an appropriate block size.


You can specify a device name in place of standard input or standard output, or both. In this example, the contents of the diskette are copied to a file in the /tmp directory:

$ dd < /floppy/floppy0 > /tmp/output.file
2400+0 records in
2400+0 records out

The dd command reports on the number of blocks it reads and writes. The number after the + is a count of the partial blocks that were copied. The default block size is 512 bytes.

The dd command syntax is different from most other commands. Options are specified as keyword=value pairs, where keyword is the option you want to set and value is the argument for that option. For example, you can replace standard input and standard output with this syntax:

$ dd if=input-file of=output-file

To use the keyword=value pairs instead of the redirect symbols in the previous example, you would type the following:

$ dd if=/floppy/floppy0 of=/tmp/output.file

Previous Previous     Contents     Index     Next Next
 

Updated: 2004-01-29, 13:14