Operating System - HP-UX
1753529 Members
5036 Online
108795 Solutions
New Discussion юеВ

One liner to find a device file for DDS

 
SOLVED
Go to solution
Q4you
Regular Advisor

One liner to find a device file for DDS

Folks,

looking for a one/two liner or awk script to find DDS tape drive's device file to use in one of the script for Ignite Backups..


Thanks
15 REPLIES 15
MANOJ SRIVASTAVA
Honored Contributor

Re: One liner to find a device file for DDS

ioscan -fnC tape | grep rmt |awk '{print $1}'


Manoj Srivastava
Q4you
Regular Advisor

Re: One liner to find a device file for DDS

Thanks Manoj, but there is more to it...

I have 10 rmts on the systems DLT4000s, DLT7000s etc. I just need a device file for *DDS HP1537 or HP1533* Tape drive.

Basically, I want to do this ->

DDS="command to get DDS dev file"

make_recovery -Av -d {DDS}
harry d brown jr
Honored Contributor

Re: One liner to find a device file for DDS


What are you going to do if you have TWO dds tape drives?

This is not something you ONELINE/TWOLINE. Do not leave your SYSTEM BACKUP to "CHANCE", make it absolute!

Of course make_recovery is also obsolete.

OR, what are you going to do if your "single" DDS tape drive is broken? Change your script in production to backup to a DLT?

live free or die
harry
Live Free or Die
MANOJ SRIVASTAVA
Honored Contributor

Re: One liner to find a device file for DDS

that is why i did put a awk this will print the frist column you can use a combination of grep and aek to get the right device fiel , incase you are not able to suceed just post the o/p of ioscan ifnc tape and the device fiel u wnat to use and I will give you the right espression , infact we ahve a SAN Legato wiht more that 14 viraul drive per amchine on a 12 drive 60 slot library.


Manoj Srivastava
harry d brown jr
Honored Contributor

Re: One liner to find a device file for DDS

Manoj,

I totally agree with your approach. I find it very dangerous to script such an IMPORTANT backup with blinders on -> basically hard coding tape drives.

live free or die
harry
Live Free or Die
Q4you
Regular Advisor

Re: One liner to find a device file for DDS

Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
tape 1 8/16/5.1.0 stape CLAIMED DEVICE HP C1533A
/dev/rmt/1m /dev/rmt/c1t1d0BESTn
/dev/rmt/1mb /dev/rmt/c1t1d0BESTnb
/dev/rmt/1mn /dev/rmt/c1t1d0DDS
/dev/rmt/1mnb /dev/rmt/c1t1d0DDSb
/dev/rmt/c1t1d0BEST /dev/rmt/c1t1d0DDSn
/dev/rmt/c1t1d0BESTb /dev/rmt/c1t1d0DDSnb
tape 2 8/16/5.4.0 stape CLAIMED DEVICE HP C1533A
/dev/rmt/2m /dev/rmt/c1t4d0BESTn
/dev/rmt/2mb /dev/rmt/c1t4d0BESTnb
/dev/rmt/2mn /dev/rmt/c1t4d0DDS
/dev/rmt/2mnb /dev/rmt/c1t4d0DDSb
/dev/rmt/c1t4d0BEST /dev/rmt/c1t4d0DDSn
/dev/rmt/c1t4d0BESTb /dev/rmt/c1t4d0DDSnb
tape 3 8/16/5.5.0 stape CLAIMED DEVICE Quantum DLT4000
/dev/rmt/3m /dev/rmt/c1t5d0BEST
/dev/rmt/3mb /dev/rmt/c1t5d0BESTb
/dev/rmt/3mn /dev/rmt/c1t5d0BESTn
/dev/rmt/3mnb /dev/rmt/c1t5d0BESTnb

Q4you
Regular Advisor

Re: One liner to find a device file for DDS

Sorry forgot to add..

I wish to use the first DDS that appears in ioscan ( in above example which is at 1m)

Why we do this ?

We have some 50 HP systems which are standardized with DDS(2/3/4) tape drives and all our ignites are done to DDS ( for simplicity and media mgmt)

We just want to put this in crontab and not to worry about customizations.

Thanks !
Rodney Hills
Honored Contributor

Re: One liner to find a device file for DDS

Rather than using ioscan each time, which might not necesarily always be consistent each time it is run. I think defining a link to the device you want to use should be created.
eg-
ln /dev/rmt/1m /dev/tape.ignite

Do this on each of your systems and use /dev/tape.ignite in your scripts.

Hope this helps...

-- Rod Hills
There be dragons...
harry d brown jr
Honored Contributor

Re: One liner to find a device file for DDS

Q4,

We manage over 400 HP 9000's, and now almost 100 sun sick-laris boxes. The HP 9000 boxes have make_tape_recovery's made at least once a week-month, but it doesn't make sense to LOCK down a tape drive to it, especially in case it fails. Our operators are trained to use the next available drive. If you want to automate such an IMPORTANT backup, then why not just create a CONFIGURATION file, and put the tape drive that THAT server would use for make_tape_recovery's. THAT WAY, if the TAPE DRIVE FAILED, you could easily modify the CONFIGURATION file and recreate the make_tape_recovery!

For 50 machines this is TOO EASY.

live free or die
harry
Live Free or Die