![]() |
![]() |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
Chapter 51Copying 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 SystemsWhen 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
The following table describes various backup and restore commands. Table 51-2 Summary of Various Backup Commands
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 DisksTwo commands are used to copy file systems between disks:
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 CopyThe 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:
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:
To use the keyword=value pairs instead of the redirect symbols in the previous example, you would type the following:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||