restore(1M) restore(1M)NAME restore - copy files from a dump.bsd archive into an existing file system SYNOPSIS /etc/restore [-o] [-Tfile-system-type] key [argument]... /etc/rrestore [-o] [-Tfile-system-type] key [argument]... DESCRIPTION restore and rrestore recover files from a backup created with the dump.bsd(1M) and rdump commands, respectively. rre- store allows the use of a remotely connected backup device. The -T option indicates the file sytem type, which can be either 4.2 or 5.2. The -o option indicates that restore or rrestore should assume that the backup medium contains an SVFS backup. If neither of these options is present, the type is assumed to be 5.2. The actions of both commands are controlled by the key argu- ment, which is a string of characters containing, at most, one function letter and possibly one or more function modif- iers. The function letter consists of one or more charac- ters from the set irRstx. An especially useful function letter is i, which requests an interactive restore session. The modifier consists of one or more characters from the set bfhmsvy. Each argument is a file or directory name specifying a file that is to be restored. Sometimes an argument includes a value to be associated with a certain key. For example, b allows the specification of a blocking-factor as one argu- ment. An argument for a key appears before any file or directory name, and specifically identifies a file to be recovered. If there is more than one key argument, then the arguments must be supplied in the same order as the associ- ated key. Unless the h key is specified (as described later in this section), the appearance of a directory name refers to the files and (recursively) subdirectories of that directory. restore can be used together with other file-system com- mands. For example, see mkfs(1M) and dump.bsd(1M) to help resize a file system or recreate the same file system with more or fewer inodes to increase or decrease the number of files it can support. Disk partitioning operations are probably necessary before resizing a file system For an Apple(Reg.) Hard Disk SC, use Apple HD SC Setup, as described in A/UX Local System Administration. April, 1990 1
restore(1M) restore(1M)The function portion of the key is specified by one of the following letters: r Read and load the backup media into the current direc- tory. This should not be done lightly; the r key should only be used to restore a full dump backup onto an empty file system, or to restore an incremental dump backup after a full level zero restore. Thus /etc/mkfs /dev/rdsk/cnd0sy number-of-blocks /etc/mount /dev/dsk/cnd0sy /mnt cd /mnt restore r is a typical sequence to restore a full dump. Another invocation of restore may be used to overlay the con- tents of an incremental dump over the full dump. When used with the -r option, restore updates the file restoresymtab in the root directory to accumulate in- formation regarding the level of backups that have been recovered for each file system. It should be removed when you no longer need the tracking information, such as when you have finished recovering from a full backup and all of its associated incremental backups. R Cause restore to request a particular volume of a mul- tivolume set on which to restart a full restore (see the r key previously described). This allows restore to be interrupted and then restarted. x Extract the named files from the backup. If the named file matches a directory whose contents were written onto the backup, and the h key is not specified, the directory is recursively extracted. The owner, modifi- cation time, and mode are restored, if possible. If no file argument is given, then the root directory is ex- tracted, which results in the entire contents of the backup being extracted, unless the h key is specified. t List the names of the specified files if they occur on the backup. If no file argument is given, then the root directory is listed recursively, which results in the entire content of the backup being listed, unless the h key is specified. Note that the t key replaces the function of the old dumpdir program. i Allow interactive restoration of files from a dump backup. After reading the directory information from the backup, restore provides a shell-like interface that allows the user to move around the directory tree and select files to be extracted. The available com- 2 April, 1990
restore(1M) restore(1M)mands are given next; for those commands that require an argument, the default is the current directory. ls [arg] List the current or specified directory. Entries that are directories are appended with /. Entries that have been marked for extraction are prefixed with *. If the verbose key is set, the inode number of each entry is also listed. cd [arg] Change the current working directory to the speci- fied argument. pwd Print the full pathname of the current working directory. add [arg] Add the current directory, or arg files if speci- fied, to the list of files to be extracted. If arg includes a directory, then it and all its des- cendents are added to the extraction list, unless the h key is specified on the command line. Files that are on the extraction list are prefixed with * when they are listed by ls. delete [arg] The current directory, or arg files if specified, is deleted from the list of files to be extracted. If arg includes a directory, then it and all its descendents are deleted from the extraction list (unless the h key is specified on the command line). The most expedient way to extract most of the files from a directory is to add the directory to the extraction list and then delete those files that are not needed. extract Extract from the dump backup all the files that are on the extraction list. restore asks which volume the user wishes to mount. The fastest way to extract a few files is to start with the last volume and work toward the first volume. setmodes Set the owner, modes, and times of all the direc- tories that were added to the extraction list. Nothing is extracted from the backup. This is useful for cleaning up after a restore is prema- turely aborted. verbose April, 1990 3
restore(1M) restore(1M)The sense of the v key is toggled. When set, the verbose key causes the ls command to list the inode numbers of all entries. It also causes re- store to print out information about each file as it is extracted. help List a summary of the available commands. quit restore immediately exits, even if the extraction list is not empty. The following characters may be used in addition to the letter that selects the function desired. b Use the associated argument as the blocking-factor for the records of the backup device, rather than the de- fault blocking-factor of 1. This option should only be used with raw versions of device files. The letters b, k, m, or f may be used at the end of the associated argument to indicate a number of blocks, ki- lobytes, megabytes, or feet, respectively. Use 8 KB as the blocking-factor for the Apple Tape Backup 40SC. To restore the contents of a backup to the current directory from the tape, substitute the SCSI ID number of the tape drive for x and enter restore -rbf 8k /dev/rmt/tcx If the -b option is not specified, restore tries to determine the block size of the backup media dynamical- ly. f Read from the associated argument rather than the de- fault device file /dev/tape. If /etc/rrestore is used, the associated argument should include a reference to the name of the remote system where the backup device is located. A colon separates the remote-system name from the device file, as in /etc/rrestore -rbf 8k server:/dev/rmt/tc3 If the environmental shell variable TAPE is set and the f option is not used, the value of TAPE is used as the device file from which data is read. If the argument associated with f is -, restore reads from standard in- put. Thus, dump.bsd and restore can be used in a pipe- line to duplicate a file system with the command dump.bsd 0f - /usr | (cd /mnt; restore xf -) 4 April, 1990
restore(1M) restore(1M)In this example, /usr is a mount point for another file system. F Eject the 3.5-inch disk from the floppy drive when fin- ished. v Cause restore, which normally does its work silently, to type the name of each file it treats, preceded by its file type. y Cause restore not to ask whether it should abort the restore if it gets a read or write error. Then restore always tries to skip over the bad block(s) and continue as best it can. m Cause restore to extract by inode numbers rather than by filename. This is useful if only a few files are being extracted, and if regenerating the complete path- name to the file is to be avoided. h Cause restore to extract the actual directory rather than the files that it references. This prevents hierarchical restoration of complete subtrees from the backup. s Cause the associated restore argument, which is a number, to select the file on a multifile dump backup. File numbering starts at 1. DIAGNOSTICS Complaints about bad key characters. Complaints if restore gets a read error. If y has been specified, or the user responds y, restore attempts to con- tinue the restore. If the dump extends over more than one volume, restore asks the user to shuttle either tape or floppy volumes around. If the x or i key is specified, restore also asks which volume the user wishes to mount. The fastest way to extract a few files is to start with the last volume and work toward the first volume. There are numerous consistency checks that can be listed by restore. Most checks are self-explanatory or can ``never happen.'' Common errors are given below. filename: not found on tape The specified filename was listed in the directory of the backup, but was not found on the backup. This is caused by media read errors while looking for the file, and by recovering data from a backup created on an ac- April, 1990 5
restore(1M) restore(1M)tive file system. expected next file inumber, got inumber A file that was not listed in the directory showed up. This can occur when recovering from a backup created on an active file system. Incremental tape too low When recovering files incrementally, the backups must be copied back to primary storage in the correct order. This error can result when attempting to read from a backup that should have been read prior to the previous incremental backup. Incremental tape too high This error can result when attempting to read a backup volume that does not begin its coverage where the pre- vious volume left off. Tape read error while restoring filename Read error occurred while skipping over an inode inumber. Tape read error while trying to resynchronize A read error has occurred. If a filename is specified, then its contents are suspect. If an inode is being skipped or the backup device is trying to resynchron- ize, then no extracted files have been corrupted, though selected files may not be recoverable. resync restore, skipped num blocks After a read error, restore may have to resynchronize itself. This message lists the number of blocks that were skipped over. FILES /etc/restore /dev/tape The default device file /tmp/rstdir* File containing directories on the backup /tmp/rstmode* Owner, mode, and time stamps for direc- tories ./restoresymtable Information passed between incremental restores SEE ALSO dump.bsd(1M), mkfs(1M), mount(1M), newfs(1M), fstyp(2), fs(4). BUGS restore can get confused when doing incremental restores from dump media produced while file systems were subject to 6 April, 1990
restore(1M) restore(1M)modification. A full (level 0) dump must be done after a full restore. Because restore runs in user mode, it has no control over inode allocation; thus a full restore must be done to get a new set of directories reflecting the new inode numbering, even though the contents of the files are unchanged. April, 1990 7