restore(1M) restore(1M)NAME restore, rrestore - retrieve files from within a dump.bsd archive into an existing file system SYNOPSIS restore i [b] [f] [F] [h] [m] [s] [v] [y] [bfFs-arg]... restore r [b] [f] [F] [h] [m] [s] [v] [y] [bfFs-arg]... restore R [b] [f] [F] [h] [m] [s] [v] [y] [bfFs-arg]... restore t [b] [f] [F] [h] [m] [s] [v] [y] [bfFs-arg]... [archived-file]... restore x [b] [f] [F] [h] [m] [s] [v] [y] [bfFs-arg]... [archived-file]... rrestore i [b] [f] [F] [h] [m] [o] [s] [-Ttype] [v] [y] [bfFs-arg]... rrestore r [b] [f] [F] [h] [m] [o] [s] [-Ttype] [v] [y] [bfFs-arg]... rrestore R [b] [f] [F] [h] [m] [o] [s] [-Ttype] [v] [y] [bfFs-arg]... rrestore t [b] [f] [F] [h] [m] [o] [s] [-Ttype] [v] [y] [bfFs-arg]... [archived-file]... rrestore x [b] [f] [F] [h] [m] [o] [s] [-Ttype] [v] [y] [bfFs-arg]... [archived-file]... ARGUMENTS archived-file Specifies the name of a file or directory to be retrieved from inside the archive. -b Sets the blocking-factor to that of the associated bfFs-arg argument rather than the default blocking- factor of 1. When the -b option is not specified, restore tries to use a blocking factor of 1; if that does not work, restore tries to determine the blocking-factor dynamically. Use the -b option only with raw versions of device files. You can use the letters b, k, m, or f at the end of the associated bfFs-arg argument to indicate a number of blocks, kilobytes, megabytes, or feet, respectively. Also see ``Examples.'' bfFs-arg January 1992 1
restore(1M) restore(1M)Specifies an argument to be associated with the option -b, -f, -F, or -s. The order in which these particular options are given determines how each bfFs-arg argument is interpreted. For example, when the options are -fvb, the first argument after the options is interpreted as the device file to use, and the argument following it is interpreted as the blocking-factor. -f Causes restore to read from the associated bfFs-arg argument to select the medium and drive rather than reading from the default device file /dev/tape. If you use /etc/rrestore, the associated bfFs-arg 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 this example: /etc/rrestore -rbf 8k server:/dev/rmt/tc3 If the environmental shell variable TAPE is set and you do not specify the f option, 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 input. -F Sets the values for command options -b and -f to those appropriate for dual-density, 3.5-inch disks, including a default size of 800K. If you specify a value for the size of the medium by using an associated argument, that value will be interpreted as the number of disk blocks rather than the number of feet of tape. The 3.5-inch disk is ejected from the floppy disk drive upon completion. -h Causes restore to extract the actual directory rather than the files that it references. Using this option prevents hierarchical restoration of complete subtrees from the archive. -i Allows interactive restoration of files from an archive. After reading the directory information from the archive, restore provides a shell-like interface that allows you to move around the directory tree and select files to be retrieved. The commands available in this shell-like interface are described in ``Built- in Commands for Interactive Mode'' in the ``Description'' section. -m Causes restore to retrieve files by inode number rather than by filename. This option is useful when you want to extract just a few files. You can also use this option to avoid having to regenerate the complete 2 January 1992
restore(1M) restore(1M)pathname to the file. -o Specifies that the archived file system is an image of an old-style System V file system (that is now considered obsolete). Such a specification is required only with the rrestore command. -r Retrieves files from the archive into the current directory. You should not use this option without serious consideration; you should use the -r option only to restore a full dump.bsd backup into an empty file system, or to restore an incremental dump.bsd backup after a full level-zero restore. -R Causes restore to request a particular volume of a multivolume set on which to restart a full restore. (See the description of the -r option earlier in this section.) This option allows restore to be interrupted and then restarted. -s Interprets the associated bfFs-arg argument as a number selecting an archive on a multiarchive backup medium. File numbering starts at 1. -t Lists the names of the specified files if they occur on the archive. If no file argument is given, then the entire file system is listed, starting with its root, unless the -h option is specified. This option helps displace the old dumpdir command. -Ttype Specifies a file system type as 4.2 or 5.2 indicating Berkeley Software Distribution (BSD file system) or System V file system, respectively. Such a specification is required only with the rrestore command. -v Causes restore, which works silently by default, to display the name and file type of each file as it is retrieved. -x Extracts the named files from the archive. If the named file matches a directory whose contents were written into the archive, and the -h option is not specified, the directory is recursively extracted. The owner, modification time, and mode are restored, if possible. If no file argument is given, then the entire file system is extracted, starting with its root, unless the -h option is specified. -y Causes restore not to ask whether it should stop the restore operation if a read or write error occurs. January 1992 3
restore(1M) restore(1M)Using this option causes restore to try to skip over the bad block(s) every time it encounters them and continue as best it can. DESCRIPTION restore and rrestore retrieve files from an archive created with the dump.bsd and rdump commands, respectively. rrestore allows the use of a remotely connected backup device. Each of the supplied file arguments (denoted as archived-file in the ``Synopsis'' section) specifies a file or directory to be retrieved. Other arguments can precede file and directory arguments. These arguments are denoted as bfFs-arg in the ``Synopsis'' section. If you use more than one command option that has an associated bfFs-arg argument, then the arguments must be supplied in the same order as the associated command options. For example, if the -b (blocking-factor) option is specified as the first command option, then the first bfFs-arg argument is interpreted as the blocking-factor value. If you include a directory name in the command line, the directory name refers to the files and (recursively) subdirectories of that directory, unless the -h option is specified. The -i option initiates a command-line interaction that lets you can specify any of the commands listed in ``Built-in Commands for Interactive Mode,'' later in the ``Description'' section. These commands are often familiar-sounding file-manipulation commands, such as ls. By using these commands, you can inspect the contents of the archive as though it had been restored into a mounted file system. (These commands run more slowly, however, because of the serial nature of the archive.) You can use restore a second time to overlay the contents 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 information regarding the level of backups that have been recovered for each file system. Remove the restoresymtab file when you no longer need the tracking information. You might delete the file after you have finished recovering from a full backup and all of its associated incremental backups. 4 January 1992
restore(1M) restore(1M)The restore command is often used after other file-system commands are run. For example, you might run the dump.bsd and mkfs commands first to help resize a file system or recreate the same file system with more or fewer inodes. (Inodes increase or decrease the number of files the file system can support.) You will probably have to perform disk partitioning operations before resizing a file system. (See A/UX Local System Administration.) Built-in Commands for Interactive Mode Here is a list of commands that can be entered in interactive mode. For those commands that accept an argument, the default argument is the current directory. add [directory] Specifies a directory to be added to the list of files marked for retrieval. If no directory is specified, the current directory is used. If directory includes a directory, then it and all its nested files and directories are added to the extraction list, unless you specified the -h option on the command line. cd [directory] Specifies the current working directory. delete [file-or-directory] Specifies a file or directory to be removed from the list of files marked for retrieval. If file-or-directory is a directory that includes a directory, then it and all its nested files and directories are deleted from the extraction list, unless you specified the -h option on the command line. The most expedient way to retrieve most of the files from a directory is to add the directory to the extraction list and then delete the files that are not needed. extract Extracts from the archive all the files that are on the extraction list. The restore command asks which volume you want to mount. The fastest way to extract a few files is to start with the last volume and work toward the first volume. help Lists a summary of the available commands. ls [file-or-directory] Lists the current or specified directory. The files displayed by ls can include directories, in which case a slash (/) is appended. Any file displayed by ls that has been marked for retrieval is prefixed with an asterisk (*). If the -v command option is set, the January 1992 5
restore(1M) restore(1M)inode number of each file is also listed. pwd Prints the full pathname of the current working directory. quit Exits restore immediately, even if the extraction list is not empty. setmodes Reads the owner, modes, and modification times of all the files and directories that were added to the extraction list and establishes those settings for any corresponding files in the file system where the current directory is set. No data is copied from within files from the archive into file system files. This command is useful for cleaning up after a restore operation is prematurely stopped. verbose Toggles the -v option on and off. When on, the -v command option causes the ls command to list the inode numbers of all entries. It also causes restore to display progress information as each file is retrieved. STATUS MESSAGES AND VALUES The restore command displays a usage message when you supply bad command option characters. If a read error occurs during a restore operation, restore displays an error message. If you have specified the y option, or if you respond to the error message by entering y, restore attempts to continue the restore operation. If the dump extends over more than one volume, restore asks you to switch either tape or floppy disk volumes. If the x or the e command option is set, restore also asks which volume you want to mount. The fastest way to retrieve a few files is to start with the last volume and work toward the first volume. The restore command performs numerous consistency checks. Most checks are self-explanatory or can ``never happen.'' Here are some common error messages that restore can display: expected next file inumber, got inumber A file that was not listed in the directory showed up. This situation can occur when restore is reading from an archive that was dumped while the file system was still in use. filename: not found on tape The specified filename was listed in the directory of 6 January 1992
restore(1M) restore(1M)the archive but was not found in the archive. This situation can occur when read errors occur while restore is scanning for the file, or when restore is reading from an archive that was taken while the file system was still in use. Incremental tape too high This error can result when restore attempts to read a backup volume that does not begin its coverage where the previous volume left off. Incremental tape too low When files are recovered incrementally, the backup archives must be retrieved in the correct order. This error can result when restore attempts to read from an archive that should have been read prior to the previous incremental archive. resync restore, skipped num blocks After a read error occurs, restore may have to resynchronize itself. This message lists the number of blocks that were skipped over. Tape read error while restoring inumber A read error occurred while the inode inumber was being skipped. Tape read error while trying to resynchronize A read error occurred. If a filename is specified, then its contents are suspect. If an inode is being skipped or the backup device is trying to resynchronize, then no extracted files have been corrupted, though selected files may not be recoverable. EXAMPLES Here is an example of a typical sequence used to restore a full dump: /etc/mkfs /dev/rdsk/cnd0sy number-of-blocks /etc/mount /dev/dsk/cnd0sy /mnt cd /mnt restore r You should use 8K as the blocking-factor for the Apple Tape Backup 40SC. For example, to retrieve the contents of a tape archive to the current directory, substitute the SCSI ID number of the Apple tape drive for x and enter the following command: restore -rbf 8k /dev/rmt/tcx January 1992 7
restore(1M) restore(1M)To use dump.bsd and restore in a pipeline to duplicate a file system, enter the following command: dump.bsd 0f - /usr | (cd /mnt; restore xf -) In this example, /usr is a mount point for another file system. LIMITATIONS The restore command can encounter problems when performing incremental restores from dump media produced while file systems were in use. A full (level-zero) dump must be done after a full restore. The restore program has no control over inode allocation because it runs in user mode; you must perform a full restore to get a new set of directories reflecting the new inode numbering, even though the contents of the files are unchanged. FILES ./restoresymtable File listing information passed between incremental restores /dev/tape Default device file /etc/restore Executable file /tmp/rstdir* File listing archived directories /tmp/rstmode* File listing file attributes for archived directories SEE ALSO dump.bsd(1M), mkfs(1M), mount(1M), newfs(1M) fstyp(3), fs(4) in A/UX Programmer's Reference 8 January 1992