Koozali.org: home of the SME Server

Restoring individual file from tape backup ( urgent )

Offline funkusmunkus

  • *
  • 220
  • +0/-0
Restoring individual file from tape backup ( urgent )
« on: June 06, 2005, 05:04:13 AM »
Hi all,

I'm having a problem trying to restore a file, I found this link http://forums.contribs.org/index.php?topic=24430.msg97877#msg97877
and well i tried Dmay's contrib, and included the fix mentioned on that link, but I think the problem is that the file it's trying to restore his a  
Quote
-
  symbol in the file name, anyway here's what I see in the logs

Quote
Jun  6 12:09:08 master e-smith[14128]: Processing event: RestoreNow
Jun  6 12:09:08 master e-smith[14128]: Running event handler: /etc/e-smith/events/RestoreNow/S10RestoreNow
Jun  6 12:09:33 master e-smith[14128]: Unknown option: files
Jun  6 12:09:36 master e-smith[14128]: S10RestoreNow=action|Event|RestoreNow|Action|S10RestoreNow|Start|1118023748 537760|End|1118023776 186800|Elapsed|27.64904
Jun  6 12:21:39 master e-smith[14413]: Processing event: RestoreNow
Jun  6 12:21:39 master e-smith[14413]: Running event handler: /etc/e-smith/events/RestoreNow/S10RestoreNow
Jun  6 12:21:53 master e-smith[14413]:
Jun  6 12:21:53 master e-smith[14413]: flexbackup version 1.1.7 (http://flexbackup.sourceforge.net)
Jun  6 12:21:53 master e-smith[14413]: /etc/flexbackup.conf syntax OK
Jun  6 12:21:53 master e-smith[14413]:
Jun  6 12:21:53 master e-smith[14413]: |------------------------------------------------------------
Jun  6 12:21:53 master e-smith[14413]: | Checking 'buffer' on this machine... Ok
Jun  6 12:21:53 master e-smith[14413]: | Checking /bin/sh on this machine... bash2
Jun  6 12:21:53 master e-smith[14413]: |------------------------------------------------------------
Jun  6 12:21:53 master e-smith[14413]: | Logging output to "flexbackup.extract.200506061221.log"
Jun  6 12:21:53 master e-smith[14413]: | Reading from CURRENT TAPE POSITION
Jun  6 12:21:53 master e-smith[14413]: |------------------------------------------------------------
Jun  6 12:21:53 master kernel: st0: Error with sense data: Current st09:00: sense key Illegal Request
Jun  6 12:21:53 master kernel: Additional sense indicates Invalid field in cdb
Jun  6 12:21:53 master e-smith[14413]: /dev/nst0: Input/output error
Jun  6 12:21:53 master e-smith[14413]: |------------------------------------------------------------
Jun  6 12:21:53 master e-smith[14413]: | Extracting files listed in /tmp/RestoreNow
Jun  6 12:21:53 master e-smith[14413]: | buffer -m 3m -s 10k -u 100 -t -p 75 -B -i "/dev/nst0" | gzip -dq | tar
Jun  6 12:21:53 master e-smith[14413]: |   --extract --files-from /tmp/extract.14421 --totals --same-permissions
Jun  6 12:21:53 master e-smith[14413]: |   --sparse  -b 20 -B --file -
Jun  6 12:21:53 master e-smith[14413]: |------------------------------------------------------------


I really need to restore that file, All help would be appreciated

cheers in advance
.........

Offline funkusmunkus

  • *
  • 220
  • +0/-0
Restoring individual file from tape backup ( urgent )
« Reply #1 on: June 07, 2005, 02:07:00 AM »
BUMP


I tried the how to by Dmay
Quote
How to perform a selective -extract

To perform a command line restore, create a file which contains a list of all files/directories to be restored. As an example, lets assume you have an ibay name 'data' and subdirectories named '/acct/1999' and /acct/2000 that you want to restore. You could create a file named '/root/flexbackup/extract-list' which contains the following lines:

   /home/e-smith/files/ibays/data/files/acct/1999
   /home/e-smith/files/ibays/data/files/acct/2000

To perform the restore you would issue the command:

   cd /
   /bin/mt -f /dev/nst0 rewind
   /bin/mt -f /dev/nst0 fsf 1
   /usr/bin/flexbackup -extract -files /root/flexbackup/extract-list
   /bin/mt -f /dev/nst0 rewind

NOTE: The first line cd / will restore your files to their original locations.  To restore to the current directory, remove the 'cd /' entry.

Alternately you could create a script including these commands and launch the script from the command line. As an example if you created the script named '/root/flexbackup/flexbackup-extract-list' you would launch the script by entering:

   . /root/flexbackup/flexbackup-extract-list


and this is the log file out put
Quote
| Logging output to "flexbackup.extract.200506070910.log"
| Reading from CURRENT TAPE POSITION
|------------------------------------------------------------
/dev/nst0: Input/output error
|------------------------------------------------------------
| Extracting files listed in /root/flexbackup/extract-list
| buffer -m 3m -s 10k -u 100 -t -p 75 -B -i "/dev/nst0" | gzip -dq | tar
|   --extract --files-from /tmp/extract.12944 --totals --same-permissions
|   --sparse  -b 20 -B --file -
|------------------------------------------------------------
|------------------------------------------------------------
/dev/nst0: Input/output error
|------------------------------------------------------------


and doesn't go any further, I really need some help on this one
.........

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Restoring individual file from tape backup ( urgent )
« Reply #2 on: June 07, 2005, 06:43:21 AM »
I wrote that post you mention.  I still use this today.  What type of tape drive do you have?  I have a DLT and I get the same error.  Here is how I fix it on my home server
pico -w /etc/e-smith/events/actions/tape-restore-flexbackup

Look for line 138:
system("/bin/mt -f $device tell > /dev/null 2>&1");
change to
system("/bin/mt -f $device status > /dev/null 2>&1");

Then try the restore as I have stated.  This works for me.

JB
......

Offline bushinc

  • ***
  • 62
  • +0/-0
    • http://www.bushinc.com
Restoring individual file from tape backup ( urgent )
« Reply #3 on: June 07, 2005, 07:08:55 AM »
I know this is after the fact, but I changed the backup method from tar to dump as was the format in previous versions of SME.
I use DLT drives that have error correction and I've never had a restore problem.  YMMV...
I do an interactive Flexbackup restore when I need to find a file on tape.

http://forums.contribs.org/index.php?topic=20205.msg79488#msg79488
...

Offline funkusmunkus

  • *
  • 220
  • +0/-0
Restoring individual file from tape backup ( urgent )
« Reply #4 on: June 07, 2005, 08:07:21 AM »
Hi mrjhb3 & bushinc,

Thanx for getting back to me, this morning I thought I'd try Dmay's contrib with your fix mrjhb3, and well I was giving up hope again, because last night I thought maybe I need to give it more time, well around 2:10 I did a ps -aux and found that the Restorenow wasn't running in the background any more, and when I checked the directory the file was restored, I didn't think it would take 4 hours to do so, since backing up all 13 gig's takes around 4 and a half hours.
By the way we have a DD3 tape backup system for that office.
It's just that it doesn't give any info as it's restoring and it was only using around 2% of the CPU resources, when backing up uses a lot more, I thought it wasn't working, and since you mentioned  
Quote
One note: When you do a restore, for some reason, the tape stays active after restoring the file

I thought that's what was showing up when listing processes.

So it's all good at the moment, thanx again for getting back to me, I started thinking that no one will, and was giving up hope :-)

cheers
.........