Operating System - HP-UX
1752815 Members
5927 Online
108789 Solutions
New Discussion юеВ

Re: fbackup - how to change a tape by using chgvol?

 
SOLVED
Go to solution
Kehad Snydewel
Frequent Advisor

fbackup - how to change a tape by using chgvol?

hi Guru's

i have a DDS autoloader which can take 8 tapes.
i want to run a full backup the 1ste of every month.i scheduled a fbackup through SAM. the total data to be backuped up is about 45GB and the tape size is 24GB (DDS3). once the first tape is full, it should load the second tape and executing the commands specified in /var/adm/fbackup/chgvol to unload the tape to slot1 and load a new tape from slot2 but its not executing the command specified in the chgvol file. the chgvol file is executable (chmod 777 cghvol).

this is what i intend to do:

1. 19h00 - run script to load a tape
mc -p /dev/rac/c2t3d1 -s S1 -d D1
"this command loads a tape in slot1 to drive1"

2. 19h05 - start scheduled fbackup created through SAM

3. at mount request execute /var/adm/fbackup/chgvol
content of cghvol:
echo "unloading tape in drive1 to slot1"
mc -p /dev/rac/c2t3d1 -s D1 -d S1
echo "loading tape in slot2 to drive1"
mc -p /dev/rac/c2t3d1 -s S2 -d D1

4. after backup run script to unload the tape from drive1.
script content:
mc -p /dev/rac/c2t3d1 -s D1 -d S2

i ran a test backup but the backup failed becuase it timed out at the change volume request which means that it did not call the chgvol file?

Question: how can i automate my backup without buying a new/bigger tape drive and allow fbackup to execute the commands in the chgvol file?

pionts to be awarded!
22 REPLIES 22
Steven E. Protter
Exalted Contributor

Re: fbackup - how to change a tape by using chgvol?

Shalom,

old but potentially relevant

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=79541

http://www.fixya.com/support/t164670-recommendation_autoloader

http://docs.hp.com/en/B2355-90950/ch06s04.html

Last link is the best bet, IMO.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
TTr
Honored Contributor

Re: fbackup - how to change a tape by using chgvol?

The default location for the chgvol script is /var/adm/fbackupfiles/chgvol. You have "fbackup" instead of "fbackupfiles" so unless you changed the path in the config file, you have a typo.
James R. Ferguson
Acclaimed Contributor

Re: fbackup - how to change a tape by using chgvol?

Hi:

The Technical Knowledge Base has some useful change-volume 'fbackup' scripts. You can search the TKB for things like "fbackup and chgvol". One example is document ID emr_na-c00904748-4 .

You should be aware the eventually 'fbackup' will be obsolete. At some release beyond 11.31 it will not be possible to create 'fbackup' archives. In my opinion, this is a real shame.

Regards!

...JRF...
Kehad Snydewel
Frequent Advisor

Re: fbackup - how to change a tape by using chgvol?

i made a typo on the forum. it should be var/adm/fbackupfiles/chgvol and not var/adm/fbackup/chgvol.
TTr
Honored Contributor

Re: fbackup - how to change a tape by using chgvol?

Check the access time (ll -u) of the chgvol file to see if it was (or was not) accessed by fbackup. If it was accessed, there may be timing issues with rewinding-unloading and loading. You may need to add some delays at the top and bottom of the chgvol script.
grahamswilson
Trusted Contributor

Re: fbackup - how to change a tape by using chgvol?

Hi Kehad,

you didn't mention (from what I can see) what fbackup -c option you are using... I thought the default value for the "chgvol" script is null/empty unless you specify it.

For example, I use this

fbackup -c /opt/system/fbackup_config.txt

and the file /opt/system/fbackup_config.txt contains just two lines :-

chgvol /opt/system/backup/bin/change_tape.bash
error /opt/system/backup/bin/backup_errored.bash

Then the relevant commands to change the tape can go into change_tape.bash...

You can see the "-c" help in the man page for fbackup.

Also...I had some "fun" with some autoloaders - after using the "mc" command to move tapes, it would confuse the autoloader into thinking it was capable of "random" mode (like a proper library), and then when I came to do other commands (e.g. mt offline) I would find the tape wouldn't unload (as it would do if the autoloader was in "sequential" mode).

I've attached the change volume script I ended up using to avoid "mc"...it works :)

Hope that helps...

Cheers,
Graham.
Kehad Snydewel
Frequent Advisor

Re: fbackup - how to change a tape by using chgvol?

hi graham,

i am using SAM to schedule my backups.

i will have a look at the fbackup command with the appropiate switches and arguments.

i will try your example
grahamswilson
Trusted Contributor

Re: fbackup - how to change a tape by using chgvol?

Hi Kehad,

good...

I had a quick look at running the fbackup job from SAM - it seems that SAM does you "-c" automatically and it assumes a config file called

/etc/sam/br/fbackup_config

and if this file does not exist, a default one is created. So you should find you have this file...

I suppose all you now need to do is add the right line to this file, e.g. something line :-

chgvol /opt/system/change_tape.bash

(or whatever your change tape script is.)

Good luck.

Cheers,
Graham.
Kehad Snydewel
Frequent Advisor

Re: fbackup - how to change a tape by using chgvol?

i edited the /etc/sam/br/fbackup_config file and added cghvol and error as follows:

chgvol /var/adm/fbackupfiles/chgvol
error /var/adm/fbackupfiles/error

the chgvol is being executed but the backup still files becuase it cannot unload the tape. i recieve the following error:
__________________________________________
br_backup: Invoking fbackup. See /var/sam/log/br_log for details.
fbackup(1004): session begins on Thu Sep 25 19:05:01 2008
fbackup(3203): volume 1 has been used 1 time(s)
fbackup(3024): writing volume 1 to the output file /dev/rmt/0mn
fbackup(3003): normal EOT
unloading Tape in drive 1 to slot 1
ERROR: 0x0 No Sense : 0x0 No additional sense information
loading Tape in slot 2 to Drive 1
ERROR: 0x5 Illegal Request : 0x3b0d Medium Destination element full
Tape Load Successfully
fbackup(3038): output file /dev/rmt/0mn is not a valid device file for backup
fbackup(3019): would you like to enter a new output file?
fbackup(3004): writer aborting
fbackup(1002): Backup did not complete : Reader or Writer process exit
____________________________________________

var/adm/fbackupfiles/cghvol content:

/#cat /var/adm/fbackupfiles/chgvol
echo "unloading Tape in drive 1 to slot 1"
mc -p /dev/rac/c2t3d1 -s D1 -d S1
echo "loading Tape in slot 2 to Drive 1"
mc -p /dev/rac/c2t3d1 -s S2 -d D1
echo "Tape Load Successfully"
/#


my question is, why cant the tape be unloaded?
i know its becuase of this error and what does this error mean? should i add the sleep command of 60 seconds to allow fbackup to rewind the tape before executing the mc command to unload the tape:

unloading Tape in drive 1 to slot 1
ERROR: 0x0 No Sense : 0x0 No additional sense information

loading tape 2 will fail becuase tape1 is still in the tape drive?

which command is better: mc or mt?
can i also move tapes with the mt command?