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
 
It looks as if /image2 is on the second logical tape, in which case rewind the tape, issue an

mt -f /dev/rmt0.1 fsf 1

(0.1 referring to the no-rewind device) and then try your restore. Good luck.
 
Thanks KenCunningham

I did what you said and i issued this command

Code:
restore -xdvqf /dev/rmt0 /image2/images/vault/777/192741.dwg

but i got this message:

restore: 0511-155 Cannot use the d flag to restore backups by i-node.

Should i just remove the d flag and reissue the command?
 
Yes, -d can only be used for backups done by file name. I assume the tape will have rewound again, so you will have to redo the mt -d /dev/rmt0.1 fsf 1 as above. You might find that you need to specify

/image2/images/vault/777/192741.dwg

as:

./image2/images/vault/777/192741.dwg

instead.
 
i guess you might mean mt -f not mt -d right?

any way, i'm doing it right now with -f and i will see what will happen

Thanks
 
i got the following error :(

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 1
[edms]{root}/>restore -xvqf /dev/rmt0 ./image2/images/vault/777/192741.dwg
Verifying archive and initializing maps.
restore: 0511-346 The media is not in dump format.
 
yes there is a log but it only shows if the backup was successfull or not!!!

it doesn't show the files that were backed up if that what's in your mind!
 
oh i've changed rmt0 to rmt0.1 and see what happened:

Code:
[edms]{root}/>restore -xvqf /dev/rmt0.1 /image2/images/vault/777/192741.dwg
Verifying archive and initializing maps.
The dump date is Mon Apr 24 01:18:18 Bahrain 2006.
Dumped from: Sun Apr 23 01:18:40 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
./image2/images/vault/777/192741.dwg is not on the archive.
Extracting requested files.
You have not read any media yet.
Unless you know which volume your file or files are on, you should start
with the last volume and work towards the first volume.
Specify the next volume number: ^Crestore: 0511-350 The restore is interrupted.
        Do you want to continue? [ yes or no ] n

does that mean the file doesn't exist on this tape? or should i put something when it asked me for the volume number??
 
you could do a tcopy of the tape to make sure there's something on there.

ex. tcopy /dev/rmt0

won't tell you content, but will verify that something's actually on the media, how much, etc...
 
That's what i've got :(

Code:
[edms]{root}/>tcopy /dev/rmt0
read: There is an input or output error.
tcopy: File: 1; End of File after: 0 Records, 0 Bytes.
read: There is an input or output error.
tcopy: The end of the tape is reached.
tcopy: The total tape length is 0 bytes.

and its still hanged waiting for something i beleive
 
i did it again with mt -f first and here is the output:

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 1
[edms]{root}/>tcopy /dev/rmt0
tcopy: Tape File: 1; Record: 1; Size 1212416.
tcopy: File: 1; End of File after: 1 Records, 1212416 Bytes.
tcopy: Tape File: 2; Records: 1 to 24; Size: 2097152.
tcopy: Tape File: 2; Record: 25; Size 1474560.
tcopy: File: 2; End of File after: 25 Records, 51806208 Bytes.
tcopy: The end of the tape is reached.
tcopy: The total tape length is 53018624 bytes.
 
i tried now to read the content on rmt0.1 but that's what i've got

Code:
[edms]{root}/>mt -f /dev/rmt0.1 fsf 1
[edms]{root}/>restore -Tvqf /dev/rmt0.1 > restore1.log
[edms]{root}/>more restore1.log
Verifying archive and initializing maps.
The dump date is Mon Apr 24 01:18:18 Bahrain 2006.
Dumped from: Sun Apr 23 01:18:40 Bahrain 2006.
Extracting directories from media.
Initializing the symbol table.
dir          2  .

i'm really getting irretated

HELP Please :(
 
hmm, your output from tcopy shows two files, but you should have 3, including the backup command at the start of the script.

anyway, you can also restore interactively:

rewind the tape : mt -f /dev/rmt0 rewind

get in restore : restore -if /dev/rmt0.1

quit, if your file is not there. the tape will advance to the next file. repeat the restore command until you find the file, or run out of tape images.

if everything goes well, you'll get a command prompt and will be able to list files, and cd into directories. you can also mark the files you want for restore. from the man pages for restore:

cd Directory
Changes the current directory to the specified directory.

add [File]
Specifies that the File parameter is added to the list of files to extract. If File is a directory, that directory and all the files contained in it are added to the extraction list (unless the -h flag is used). If File is not specified, the current directory is added to the extraction list.

delete [File]
Specifies that the File parameter is to be removed from the list of files to be extracted. If File is a directory, that directory and all the files contained in it are removed from the extraction list (unless the -h flag is used).

ls [Directory]
Displays the directories and files contained within the Directory parameter. Directory names are displayed with a / (slash) after the name. Files and directories, within the specified directory, that are on the extraction list are displayed with an * (asterisk) before the name. If verbose mode is on, the i-node number of the files and directories is also displayed. If the Directory parameter is not specified, the current directory is used.

extract
Restores all the directories and files on the extraction list.

pwd
Displays the full path name of the current directory.

verbose
Causes the ls subcommand to display the i-node number of files and directories. Additional information about each file is also displayed as it is extracted from the archive.

setmodes
Sets the owner, mode, and time for all directories added to the extraction list.

quit
Causes restore to exit immediately. Any files on the extraction list are not restored.

help
Displays a summary of the subcommands.
 
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 Mon Apr 24 01:19:53 Bahrain 2006.
Dumped from: Sun Apr 23 01:20:17 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:


These are the files 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'll have to leave this now but i will come tomorrow and i hope to see some replied posts :) Thanks guys for the help
 
Thanks Breslau

That's what i get :(

Code:
[edms]{root}/>mt -f /dev/rmt0 rewind
[edms]{root}/>restore -if /dev/rmt0.1
Please mount volume 1 on /dev/rmt0.1.
        Press the Enter key to continue.

restore: 0511-154 Cannot use the i flag to restore backups by name.
 
you seem to be running the restores correctly. so, if you go through the entire tape and you can't find your file, then for some reason it did not get backed up.

backing up to an attached tape drive is not always reliable. you could try tapes from other days if it is possible that the files would have been writen to tape then.

we switched to an enterprise backup solution 4 or 5 years ago and have been much happier with the results.
 
oh yeah i will be doing this tomorrow

i will try the rest of the tapes including the weekly backup tape and see what happens!!

Thanks Breslau for your help and please try to view this post tomorrow to see what i will have for you :p

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top