Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring select fiels from mksysb

Status
Not open for further replies.

ytakbob

Programmer
Jul 20, 2000
105
US
Running AIX 4.3.2 tape cerated with mksysb -i /dev/rmt1

How do I access selected files off of this tape to restore.

Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
ytakbob,

I haven't tried this and I am reading notes taken in a class a while ago. Try this:

cd into the directory where you want the file. Type these commands:

tctl -f /dev/rmt0 rewind (assuming /dev/rmt0 is your tape device. This rewinds the tape.)
tctl -f /dev/rmt0.1 -fsf 3 (skip the first three files on the tape. These are three files that are put there by mksysb and are used when you are using msksyb to restore the entire system.)
restore -f /dev/rmt0 /usr/bin/rm (using /usr/bin/rm as the file you want to restore. You need the path and the file name. Don't know if this works for directories.)

/usr/bin/rm would be restored to the directory from where you executed the restore command.

Like I say, I've never used this so, good luck.
 
Bi, that sounds correct according to my notes too. Same here, didn't try it yet... IBM Certified Specialist - MQSeries
 
Restoring individual files from a mksysb tape

1.To restore individual files or directories from a mksysb tape, find out the blocksize of the fourth image. To
obtain this information, run the following commands:

cd /tmp
tctl -f /dev/rmt# rewind (# to be replaced by a number)
chdev -l rmt# -a block_size=512
restore -s2 -xqdvf /dev/rmt#.1 ./tapeblksz
cat ./tapeblksz

The output that is given is the blocksize to which the tape drive was set when the mksysb was made.

2.Next, set the blocksize of the tape drive accordingly by running the following command:

chdev -l rmt# -a block_size=[number in the
./tapeblksz file]

3.Restore the files or directories by running the following commands:

cd / (if the file is to be restored to its original place)
tctl -f /dev/rmt# rewind
restore -s4 -xqdvf /dev/rmt#.1 ./dir/filename (for one file)

OR

restore -s4 -xqdvf /dev/rmt#.1 ./dir (for all files in dir)
 
Thanks guys. restore -s4 -xqdvf /dev/rmt1.1 ./usr/rm

Bob Schmid
bob_schmid@hmis.org
330-746-1010 ext. 1347
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top