08/13/96, 4FAX# 5733 Restoring Files/Directories From A mksysb Tape SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. ABOUT THIS DOCUMENT This document describes how to restore files or directories from a mksysb tape and is applicable to AIX 3.2.0 - 4.2.0. ABOUT MKSYSB TAPE FORMAT The mksysb command places 4 images on the tape, as follows: Restoring Files/Directories From A mksysb Tape 1 08/13/96, 4FAX# 5733 ---Beginning of Tape--- | | | bosboot image - | | contains kernel | | and basic device | | drivers. | | | |---- EOF marker -----| | | | mkinsttape image - | | contains small set | | of commands needed | | during install | | process. | | | |---- EOF marker -----| | | | dummy image - | | one 512-byte block | | that contains | | nothing. | | | |---- EOF marker -----| | | | data image - | | the actual archive | | of the files in | | your mounted JFS | | rootvg filesystems | | at time of backup. | | | |---- EOT marker -----| | | | _ _ _ _ _ _ \_/ \_/ \_/ \_/ \_/ \_/ \ _ _ _ _ _ _ \_/ \_/ \_/ \_/ \_/ \_/ \ | | ------End of Tape------ The first 3 images always have block size of 512. The 4th image is written with block size set to whatever was set in the "BLOCK size" parameter for the tape drive character- istics when the backup was made. To restore files, position the tape to the beginning of the 4th image, and run the proper archival utility. See "Restoring The Files or Directories", below. ABOUT SPECIFYING PATHNAMES The mksysb command always makes the data image a relative pathname backup, in that all the pathnames on the tape start with a "." character. For example, if you need to restore the file "/home/user1/workfile from the mksysb, you would need to specify a pathname of "./home/user1/workfile". Since the pathnames on tape are relative, you may restore the files to any directory you wish, but remember that the archival utility will follow the path from whatever your Restoring Files/Directories From A mksysb Tape 2 08/13/96, 4FAX# 5733 current directory is. For example, to restore the sample pathname above to exactly where it came from, you must: # cd / before starting the restore. For example, if you wanted to restore to a different directory, you could for example: # cd /tmp before starting the restore. Then you would have the restored file in /tmp/home/user1/workfile. RESTORING THE FILES OR DIRECTORIES Follow these steps: 1. Position the tape: o [for AIX 3.2.5.1 or older] # tctl -f /dev/rmt0 rewind # tctl -f /dev/rmt0.1 fsf 3 o [for AIX 4.1.0 or newer] # tctl -f /dev/rmt0 rewind where rmt0 = the tape device you are using. 2. Restore the files: o [for AIX 3.2.5.1 or older] # cd targetdir # pax -rvf /dev/rmt0 -pop pathname1 pathname2 ... o [for AIX 4.1.0 or newer] - From command line run: # cd targetdir # restore -s4 -xdqvf /dev/rmt0.1 pathname1 pathname2 ... - USe smit fastpath: # cd targetdir # smit restmksysb - Follow smit menus: # cd targetdir # smit Follow menus: Restoring Files/Directories From A mksysb Tape 3 08/13/96, 4FAX# 5733 System Storage Management System Backup Manager Restore Files in a System Image where: o targetdir = either "/" if you want to restore to the same place the files came from, or another directory if you do not want to overwrite any files with the files from the tape. o rmt0 = the tape device you are using. o pathnameN = a valid pathname for the file or direc- tory you wish to restore; remember that on the tape all pathnames start with a "."; you may specify wildcards, but in that case remember to enclose the pathname inside double-quotes ("). Restoring Files/Directories From A mksysb Tape 4 08/13/96, 4FAX# 5733 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (restor.file.mksyb.bak, 4FAX# 5733) Restoring Files/Directories From A mksysb Tape 5