- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: fbackup - how to change a tape by using chgvol...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-26-2008 09:40 AM
тАО09-26-2008 09:40 AM
Re: fbackup - how to change a tape by using chgvol?
good progress! I think this may be to do with the "fun" I also had between how different devices behave. An autoloader (such as yours I believe) can easily get confused if you try and use commands that are for "random" access loaders (i.e. proper libraries). In fact, `mc` would not work at all on devices that only understand "sequential" movement - and I think this is what you are seeing. Although it would be great to be able to use `mc` as it is far more flexible, it's making it more difficult!
That is why/how I ended up with the script I was using - I think I actually found it, or the basis for it at least, in a very old forum posting. It gets round the issue with "autoloaders" versus "libraries" by being very basic.
With a "sequential" drive, a `mt offline` will simply unload the current tape and load the next one. So the chgvol script simply needs to do a `mt offline` and then wait until the next time is ready...
Hope that helps.
Graham.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2008 11:38 PM
тАО09-29-2008 11:38 PM
Re: fbackup - how to change a tape by using chgvol?
thanks for your reply.
i so not fully understand you script. can you please give me a brief description.
i cannot see the command which will create an archive on tape.
this is your script content:
#!/usr/local/bin/bash
set -xv
sleep 60
count=1
mt offl
sleep 10
rewindme=1
while [ ${rewindme} -ne 0 ] ;
do
sleep 60
mt rew
rewindme=$?
let count=count+1
if [ ${count} = 11 ];
then
echo Something has gone horribly wrong...
exit 1
fi
done
sleep 30
exit 0
thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2008 05:08 AM
тАО09-30-2008 05:08 AM
Solutionyou are correct that there are no lines in this script for doing the backup - this is ONLY the chgvol scipt, NOT the script that does the backup.
So in essence, you would do the backup the same way as you are currently - i.e. through SAM - but instead of your chgvol script (which is now being executed, but failing), run this replacement chgvol script instead.
This script simply changes the tape using "mt offline" which works well for sequential auto-loaders, instead of using "mc" which can confuse things...
Hope that makes sense - if not, let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2008 05:17 AM
тАО09-30-2008 05:17 AM
Re: fbackup - how to change a tape by using chgvol?
i understand now. i will implement and revert back to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2008 12:19 AM
тАО10-27-2008 12:19 AM
Re: fbackup - how to change a tape by using chgvol?
i implemented you script but its only taking the tape offline and not unloading the tape currently in the drive and not loading a new tape in the slots. Below is the output when i execute the script:
_____________________________________________
root@Rogue:/var/adm/fbackupfiles # ./chgvol
sleep 60
+ sleep 60
count=1
+ count=1
mt offl
+ mt offl
sleep 10
+ sleep 10
rewindme=1
+ rewindme=1
while [ ${rewindme} -ne 0 ] ;
do
sleep 60
mt rew
rewindme=$?
let count=count+1
if [ ${count} = 11 ];
then
echo Something has gone horribly wrong...
exit 1
fi
done
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 2 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 3 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 4 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 5 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 6 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 7 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 8 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 9 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 10 = 11 ]
+ [ 1 -ne 0 ]
+ sleep 60
+ mt rew
/dev/rmt/0mnb: No such device or address
+ rewindme=1
+ let count=count+1
+ [ 11 = 11 ]
+ echo Something has gone horribly wrong...
Something has gone horribly wrong...
+ exit 1
root@Rogue:/var/adm/fbackupfiles #
_____________________________________________
what should i do next in order for this to work as intented?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2008 12:22 AM
тАО10-27-2008 12:22 AM
Re: fbackup - how to change a tape by using chgvol?
root@Rogue:/var/adm/fbackupfiles # ioscan -fnC tape
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
tape 0 0/0/2/0.3.0 stape CLAIMED DEVICE HP C1537A
/dev/rmt/0m /dev/rmt/0mnb /dev/rmt/c2t3d0BESTn /dev/rmt/c2t3d0DDSb
/dev/rmt/0mb /dev/rmt/c2t3d0BEST /dev/rmt/c2t3d0BESTnb /dev/rmt/c2t3d0DDSn
/dev/rmt/0mn /dev/rmt/c2t3d0BESTb /dev/rmt/c2t3d0DDS /dev/rmt/c2t3d0DDSnb
root@Rogue:/var/adm/fbackupfiles #
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2008 12:28 AM
тАО10-27-2008 12:28 AM
Re: fbackup - how to change a tape by using chgvol?
/dev/rmt/0mnb: No such device or address
You need to change your script to add "-f your-tape-device" to every one of your mt commands.
/dev/rmt/0mnb is listed but it isn't working??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2008 04:36 AM
тАО10-27-2008 04:36 AM
Re: fbackup - how to change a tape by using chgvol?
#!/usr/bin/sh
# fbackup has started rewinding the tape
# chgvol (this script) has been called
# Must define the tape being used
# exit with error after waiting 2 minutes
MYTAPE=/dev/rmt/0m
STATUS=$(mt -f $MYTAPE status)
echo "$STATUS"
COUNT=0
while [ $(echo $STATUS | grep -c BOT) -eq 0 ]
do
COUNT=$((COUNT+1))
[ $COUNT -gt 20 ] && exit 1 ## too long
sleep 5
STATUS=$(mt -f $MYTAPE status)
done
# Now change the tape
...mc commands...
Run this script with the -x option as in:
sh -x chgvol
This will trace the chgvol script. Be sure you always start your scripts with #!/usr/bin/sh
Once this script is working by itself, now you can try it with fbackup. Be sure your -c configfile has DDS parameters for efficiency and speed. This is will work quite well with all DDS tape drives:
blocksperrecord 4096
records 64
checkpointfreq 4096
readerprocesses 6
maxretries 5
retrylimit 5000000
maxvoluses 200
filesperfsm 2000
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-27-2008 05:37 AM
тАО10-27-2008 05:37 AM
Re: fbackup - how to change a tape by using chgvol?
Firstly, I think you did the right thing running the chgvol script independently of the backup - to check it is working first...
It looks to me like the "mt offline" is working, but as you say, the library/autoloader is not then automatically loading the next tape.
Do you know if you can configure the autoloader so it is in "sequential" mode? There are (normally) 3 modes an autoloader/library can be in - "sequential", "auto" and "random". I suspect you NEED "sequential". Hopefully you might be able to configure this on the front of the autoloader...
In anycase, even separate to the chgvol script, if you load a tape in the drive and then simply do a "mt offline" at the command line, you should see the drive unload and then automatically load the next tape. Once this happens, you can be sure the chgvol script will work also... :)
Silly question - has the loader been rebooted since you were trying the "mc" command some time ago? I found that if the autoloader was set to "auto" mode, once an "mc" command was used, the autoloader needing rebooting to then get "mt offline" to work! If you haven't rebooted the autoloader, it might be worth doing. That's why its better to force the device into "sequential" mode...
Let us know how you get on...good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2008 01:46 AM
тАО10-28-2008 01:46 AM
Re: fbackup - how to change a tape by using chgvol?
the mode is initially detemined by whathappens after you insert a magazine:
- if the host sends a command (move medium) to move a cartridge from the magazine to the drive, the autoloader goes into random mode.
- if you select a cartridge by pressing the Select buttom and then load it by pressing the Load Cartridge button, the autoloader goes into stacker mode.
i changed the script i am currently using (added mc commands to unload current tape and load new tape) which is executed successfully and changing the tape as it should but the confirmation is not being confirmed. after the script is executed it still prompts me to press Y/N to continue. how can i get pass confirmation?
can i add something to the script below to confirm with Y and continue?
my script:
-------------------------------------------
#!/usr/bin/sh
set -xv
sleep 60
count=1
mt -f /dev/rmt/0mn offl
sleep 10
rewindme=1
while [ ${rewindme} -ne 0 ] ;
do
sleep 60
mc -p /dev/rac/c2t3d1 -s D1 -d S1
sleep 60
mc -p /dev/rac/c2t3d1 -s S2 -d D1
rewindme=$?
let count=count+1
if [ ${count} = 11 ];
then
echo Something has gone horribly wrong...
exit 1
fi
done
sleep 30
exit 0
-------------------------------------------