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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to restore a file backed up by i-node :( 3

Status
Not open for further replies.

khalidaaa

Technical User
Jan 19, 2006
2,323
BH
This is the backup script used to backup the files:

Code:
find /usr/cimage/shared \
     /usr/cimage/mtserv511 \
     /san_ora_bkup \
     -print > /tmp/daily_backup.list

cat /tmp/daily_backup.list | backup -iqf/dev/rmt0.1
#
if [ $? -eq 0 ]
then
  DATA_BACKUP=ok
else
  DATA_BACKUP=bad
fi
#
#-----------------------------------------------------------------------
#
# Determine which day of week it is and set the appropriate -Level for
# incremental backup.
#
DOW=`date | awk '{ printf $1 }'`
case $DOW in
  Fri) LEVEL=1;;
  Sat) LEVEL=2;;
  Sun) LEVEL=3;;
  Mon) LEVEL=4;;
  Tue) LEVEL=5;;
  Wed) LEVEL=6;;
  Thu) LEVEL=7;;
esac
#
#------------------------------------------------------------------
#
# unmount /image1 and /image2 and take an appropriate backup by i-node
#
unmount /image1
unmount /image2

backup -$LEVEL -uf /dev/rmt0.1 /image1

if [ $? -eq 0 ]
then
  IMAGE1_BACKUP=ok
else
  IMAGE1_BACKUP=bad
fi
#
backup -$LEVEL -uf /dev/rmt0 /image2

if [ $? -eq 0 ]
then
  IMAGE2_BACKUP=ok
else
  IMAGE2_BACKUP=bad
fi
#
mount /image1
mount /image2

i used this commmand to view the backed up files:
Code:
restore -Tdvqf /dev/rmt0 > restore.log

but i couldn't find /image1 and image2 files in this tape :(

i'm trying to restore a file that was supposed to be in /image2 and the tape that i've got is the one backed up on Sunday 23 of April ( Sun) LEVEL=3;; )

I was doing this the whole day today so any clue is appreciated

regards
Khalid
 
You have 3 backups on one tape

1st backup is a backup by name (list of files created by find command, then backup -i)

2nd backup is an inode backup of /image1

3rd backup is an inode backup of /image2

in order to restore a file from /image2, you need to skip 2 files

tctl -f /dev/rmt0.1 rewind
tctl -f /dev/rmt0.1 fsf 2
restore -xvqf /dev/rmt0.1 /image2/images/vault/777/192741.dwg

-or-

tctl -f /dev/rmt0.1 rewind
tctl -f /dev/rmt0.1 fsf 2
restore -xvqf /dev/rmt0.1 ./images/vault/777/192741.dwg

(not sure about the pathnames in an inode backup)


HTH,

p5wizard
 
Sorry I had to leave this yesterday, but p5wizard's advice looks good to me. I'm afraid I'd missed the backup at the start of the script, so an fsf 2 is required. Let us know how you get on.
 
oh Thank you very much guys

I couldn't sleep last night coz of this :(

I'm at home now i will let you know about this when i get to work later

Thanks again
 
guess what guys!

I took the weekly (full) backup tapes (There are 5 tapes, one for system backup (mksysb), and the other four, two for image1 and two for image2)

i took tape number 4 (which is the first tape for image2) and i tried the following:

Code:
[edms]{root}/>tctl rewind
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore2.log
restore: 0511-260 The archive is not in backup format.
[edms]{root}/>more restore2.log
[edms]{root}/>restore -tvqf /dev/rmt0 > restore2.log
restore: 0511-260 The archive is not in backup format.
[edms]{root}/>tctl rewind
[edms]{root}/>restore -Tvqf /dev/rmt0 > restore2.log
restore: 0511-260 The archive is not in backup format.
[edms]{root}/>restore -Tdvqf /dev/rmt0 > restore2.log
restore: 0511-260 The archive is not in backup format.

any clue??? :(
 
by the way, this is the backup script for the weekly image2 backup:

Code:
backup -0 -uf/dev/rmt0 /image2
#
if [ $? -eq 0 ]
then
  echo "\n\n VOL3 backup completed successfully. "
  echo "ok" > /tmp/weekly_VOL3_backup_status
else
  echo "\n\n VOL3 backup failed. Make sure the Drive is OK, then rerun VOL3 back
up "
  echo "bad" > /tmp/weekly_VOL3_backup_status
  read
  return
fi
#
# Mount /image2
#
mount /image2
 
because the backup consists of 3 operations, this find may contain the word "bad" or "ok" just to follow up with the status of the previous backup operation (the 3 operations are backing up with mksysb, the second and the third is for image1 and image2)

if you meant what it contains for now i don't know because this backup was taken on the 28th of April so whatever in this file was modified today i beleive!!! so its irrelevant.
 
Perhaps you should consider adding a date suffix to the status file, so that you can check whether a backup completed or not sometime down the line, as you require now. Alternatively, keep a record of each backup in the file by appending (>>) rather than recreating anew each time.
 
Are you restoring on the same machine as the backup was made? What I'm getting at is: there may be a difference in tape device block size setup, preventing you from correctly reading the tapes. Just a hunch.

If so, then do

lsattr -E -l rmt0

on both machines and compare.


HTH,

p5wizard
 
oh yeah its a good idea KenCunningham :)

p5wizard , oh yes its the same machine that was used for this backed up tape

i tried the third tape out of the 5 weekly backups and i got some data by using the same command (that didn't work on the 4th and 5th tapes)
 
I tried reading from the incremental backups that were taking the following days and i couldn't find any thing as follows:

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 2
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore2.log
Synchronizing restore again; skipped 1232 blocks.
Synchronizing restore again; skipped 1232 blocks.
[edms]{root}/>more restore2.log
Verifying archive and initializing maps.
The dump date is Tue Apr 25 01:21:13 Bahrain 2006.
Dumped from: Mon Apr 24 01:19:53 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
dir     270337  ./images
dir     272384  ./images/vault

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 2
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore2.log
Synchronizing restore again; skipped 1232 blocks.
Synchronizing restore again; skipped 1232 blocks.
[edms]{root}/>more restore2.log
Verifying archive and initializing maps.
The dump date is Wed Apr 26 01:21:19 Bahrain 2006.
Dumped from: Tue Apr 25 01:21:13 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
dir     270337  ./images
dir     272384  ./images/vault
dir     595969  ./images/markups
dir     600064  ./images/markups/3
leaf    600083  ./images/markups/3/746.dwg

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 2
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore2.log
Synchronizing restore again; skipped 1232 blocks.
Synchronizing restore again; skipped 1232 blocks.
[edms]{root}/>more restore2.log
Verifying archive and initializing maps.
The dump date is Thu Apr 27 01:21:17 Bahrain 2006.
Dumped from: Wed Apr 26 01:21:19 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
dir      79873  ./jb0_17a
dir      81920  ./jb0_17a/vault
dir      88065  ./jb0_17a/vault/263
dir     270337  ./images
dir     272384  ./images/vault

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 2
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore2.log
Synchronizing restore again; skipped 1232 blocks.
Synchronizing restore again; skipped 1232 blocks.
[edms]{root}/>more restore2.log
Verifying archive and initializing maps.
The dump date is Fri Apr 28 01:24:28 Bahrain 2006.
Dumped from: Fri Apr 21 08:36:08 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
dir      79873  ./jb0_17a
dir      81920  ./jb0_17a/vault
dir      88065  ./jb0_17a/vault/263
dir     270337  ./images
dir     272384  ./images/vault
dir     169987  ./images/vault/775
dir     595969  ./images/markups
dir     600064  ./images/markups/3
leaf    600083  ./images/markups/3/746.dwg
 
he he he

i think you guys are giving up on me like i'm giving up myself :)

Thanks to every body who participated in helping me :)
 
When you say you couldn't find anything on the incrementals, do you mean you couldn't find the file you were looking for? All that would probably mean is that the file wasn't changed on that day and wouldn't therefore be included in the backup list.

Thanks for the star, but I'm sure we really would like to get this sorted! It's the weekend now, so don't expect too much more action until next week.
 
ha ha :)

Thanks Ken, but my weekend is on Thuresday and Friday and it got ruined staying here trying to fix this :(

as you can see, there are alot of files that were created on that date!!!

Code:
[edms]{root}/image2/images/vault/777>ls -al | grep "Apr 22"
-rw-rw-rw-   1 dmadmin  dmgrp        290680 Apr 22 09:54 192735.bak
-rw-rw-rw-   1 dmadmin  dmgrp        291341 Apr 22 09:54 192735.dwg
-rw-rw-rw-   1 dmadmin  dmgrp        688133 Apr 22 11:05 192736.bak
-rw-rw-rw-   1 dmadmin  dmgrp        688130 Apr 22 11:05 192736.dwg
-rw-rw-rw-   1 dmadmin  dmgrp        758523 Apr 22 11:06 192737.bak
-rw-rw-rw-   1 dmadmin  dmgrp        759267 Apr 22 11:06 192737.dwg
-rw-rw-rw-   1 dmadmin  dmgrp        598671 Apr 22 11:43 192743.bak
-rw-rw-rw-   1 dmadmin  dmgrp        445746 Apr 22 12:09 192745.bak
-rw-rw-rw-   1 dmadmin  dmgrp        200452 Apr 22 14:56 192746.bak
-rw-rw-rw-   1 dmadmin  dmgrp        301258 Apr 22 14:56 192746.dwg
-rw-rw-rw-   1 dmadmin  dmgrp         29673 Apr 22 15:06 192747.bak
-rw-rw-rw-   1 dmadmin  dmgrp         33152 Apr 22 15:06 192747.dwg
-rw-rw-rw-   1 dmadmin  dmgrp            71 Apr 22 15:06 192747.ref
-rw-rw-rw-   1 dmadmin  dmgrp             7 Apr 22 15:06 192747.siz
-rw-rw-rw-   1 dmadmin  dmgrp        201166 Apr 22 15:06 192747.tif
-rw-rw-rw-   1 dmadmin  dmgrp        131900 Apr 22 15:20 192748.bak
-rw-rw-rw-   1 dmadmin  dmgrp        132079 Apr 22 15:20 192748.dwg

I couldn't find any :(
 
Uhm, april 22 was a saturday...

I think you may have the dates mixed up. This is from one of your earlier attempts:

Another attempt :(


Code:
[edms]{root}/>tctl rewind
[edms]{root}/>mt -f /dev/rmt0.1 fsf 2
[edms]{root}/>restore -tvqf /dev/rmt0.1 > restore1.log
Synchronizing restore again; skipped 1232 blocks.
Synchronizing restore again; skipped 1232 blocks.
[edms]{root}/>more restore1.log
Verifying archive and initializing maps.
The dump date is [COLOR=red]Mon Apr 24 01:19:53[/color] Bahrain 2006.
Dumped from: [COLOR=red]Sun Apr 23 01:20:17[/color] Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
dir     270337  ./images
dir     272384  ./images/vault
dir     169987  ./images/vault/775

but i still don't see 777!!!

but i'm sure that there are files created on the 22 April which should have been backed up:

Perhaps someone mounted the wrong tape on the wrong date/day...

HTH,

p5wizard
 
yes you are right pwizard!!!

but our backup job on the 22nd was failed so i guess whatever on the 23th will be the incremental of both of them.

now strangly enough i couldn't read from the weekly full backup tapes!!!

it happened to be:
1 tape for mksysb
1 tape for image1
3 tapes for image3

(I was mistaken in considering that image1 has two tapes!!! it has only one and image2 has 3)

so i managed to read from tape 3 but not tape 4 or 5 for some reason!!! my senior sys admin told me that i can't read from the 4th or the 5th coz its only the 3th (which is the first tape of image2 backup) that contains the directory map!!!

so he said in order for me to do the restore i have to mount tape# 3 and then issue the restore command!!!

but when i did this i didn't find the file i was looking for!!!

then i tried to read every thing from that tape but it stoped somewhere and it didn't have the 777 directory i was looking for!!!'

sample of the output is as follows:

Code:
[edms]{root}/image2>restore -Tvqf /dev/rmt0
Verifying archive and initializing maps.
The dump date is Fri Apr 28 08:45:50 Bahrain 2006.
Dumped from: Thu Jan  1 03:00:00 Bahrain 1970.
Extracting directories from media.
Initializing the symbol table.
dir          2  .
.
.
.
leaf    508267  ./images/vault/631/156282.sup
leaf    508268  ./images/vault/631/156283.tif
leaf    508269  ./images/vault/631/156283.sup
leaf    508270  ./images/vault/631/156284.dwg
leaf    508271  ./images/vault/631/156284.bak
leaf    508272  ./images/vault/631/156285.tif
leaf    508273  ./images/vault/631/156286.tif
leaf    508274  ./images/vault/631/156286.bak
leaf    508275  ./images/vault/631/156286.dwg
leaf    508276  ./images/vault/631/156286.siz
leaf    508277  ./images/vault/631/156286.ref
leaf    508278  ./images/vault/631/156286.bk1
leaf    508279  ./images/vault/631/156287.tif
leaf    508280  ./images/vault/631/156287.sup
leaf    508281  ./images/vault/631/156288.dwg
leaf    508282  ./images/vault/631/156288.bak
leaf    5

 
3 tapes for image3

Do you mean 3 tapes for image2?

I'm a little confused here! How are the tapes changed for the backups? Do you have an auto-changer or is it done manually (and if so, by whom?).

Possibly in order to read tapes 4 and 5 you will have to remove the -q from your command so that you get the prompt from restore when you need to change tapes.
 
yeah you are right!! i meant image2 :)

There are operators that do the changing from one tape to the other for that :)

-q!!! I will check this later :)

Thanks for maintaining your help with this topic :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top