![]() |
![]() |
| ||
Chapter 50UFS Backup and Restore Commands (Reference)This chapter contains reference information on the ufsdump and ufsrestore commands. This is a list of information in this chapter. For overview information about performing backups, see Chapter 46, Backing Up and Restoring File Systems (Overview). For information about backup tasks, see Chapter 47, Backing Up Files and File Systems (Tasks). How the ufsdump Command WorksThe ufsdump command makes two passes when it backs up a file system. On the first pass, this command scans the raw device file for the file system and builds a table of directories and files in memory. Then, this command writes the table to the backup media. In the second pass, the ufsdump command goes through the inodes in numerical order, reading the file contents and writing the data to the backup media. Determining Device CharacteristicsThe ufsdump command needs to know only an appropriate tape block size and how to detect the end of media. Detecting the End of MediaThe ufsdump command writes a sequence of fixed-size records. When the ufsdump command receives notification that a record was only partially written, it assumes that it has reached the physical end of the media. This method works for most devices. If a device is not able to notify the ufsdump command that only a partial record has been written, a media error occurs as the ufsdump command tries to write another record. Note - DAT devices and 8-mm tape devices detect end-of-media. Cartridge tape devices and 1/2-inch tape devices do not detect end-of-media. The ufsdump command automatically detects the end-of-media for most devices. Therefore, you do not usually need to use the -c, -d, -s, and -t options to perform multivolume backups. The only times you need to use the end-of-media options are under the following conditions:
To ensure compatibility with the restore command, the size option can still force the ufsdump command to go to the next tape or diskette before reaching the end of the current tape or diskette. Copying Data With the ufsdump CommandThe ufsdump command copies data only from the raw disk slice. If the file system is still active, any data in memory buffers is probably not copied. The backup done by the ufsdump command does not copy free blocks, nor does it make an image of the disk slice. If symbolic links point to files on other slices, the link itself is copied. Purpose of the /etc/dumpdates FileThe ufsdump command, when used with the -u option, maintains and updates the /etc/dumpdates file. Each line in the /etc/dumpdates file shows the following information:
For example:
When you do an incremental backup, the ufsdump command checks the /etc/dumpdates file to find the date of the most recent backup of the next lower dump level. Then, this command copies to the media all files that were modified since the date of that lower-level backup. After the backup is complete, a new information line, which describes the backup you just completed, replaces the information line for the previous backup at that level. Use the /etc/dumpdates file to verify that backups are being done. This verification is particularly important if you are having equipment problems. If a backup cannot be completed because of equipment failure, the backup is not recorded in the /etc/dumpdates file. If you need to restore an entire disk, check the /etc/dumpdates file for a list of the most recent dates and levels of backups so that you can determine which tapes you need to restore the entire file system. Note - The /etc/dumpdates file is a text file that can be edited. However, edit it only at your own risk. If you make changes to the file that do not match your archive tapes, you might be unable to find the tapes (or files) you need. Backup Device (dump-file) ArgumentThe dump-file argument (to the -f option) specifies the destination of the backup. The destination can be one of the following:
Use this argument when the destination is not the default local tape drive /dev/rmt/0. If you use the -f option, then you must specify a value for thedump-file argument. Note - The dump-file argument can also point to a file on a local disk or on a remote disk. If done by mistake, this usage can fill up a file system. Local Tape or Diskette DriveTypically, the dump-file argument specifies a raw device file for a tape device or diskette. When the ufsdump command writes to an output device, it creates a single backup file that might span multiple tapes or diskettes. You specify a tape device or a diskette on your system by using a device abbreviation. The first device is always 0. For example, if you have a SCSI tape controller and one QIC-24 tape drive that uses medium-density formatting, use this device name: /dev/rmt/0m When you specify a tape device name, you can also type the letter "n" at the end of the name to indicate that the tape drive should not rewind after the backup is completed. For example: /dev/rmt/0mn Use the "no-rewind" option if you want to put more than one file onto the tape. If you run out of space during a backup, the tape does not rewind before the ufsdump command asks for a new tape. For a complete description of device naming conventions, see Backup Device Names. | ||
| ||