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.
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)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.