HP 9000
cancel
Showing results for 
Search instead for 
Did you mean: 

how to change Instance number for a tape drive?

Selvaraj
Advisor

how to change Instance number for a tape drive?

Hi experts,

Good afternoon. We have Hp 9000 L2000 series nodes in our production site. Recently we swapped root hard disks from our lab nodes which has same hard configuration and same model. System boots up and started working very fine. So our production nodes changed to lab nodes and vice-versa. Only problem we noticed that our tapes drives instance number got changed from "0" to "1".

For eg,
/dev/rmt/0mn device files changed to /dev/rmt/1mn.

All our scripts referenced to "0mn" but not "1mn". We cannot reboot our production nodes now. Can u please suggest how to bring back original instance number without rebooting the box. If you feel reboot is neccessary, then what are the steps to be followed.

FYI, I already tried several options like insf -e, rmsf, insf -e -q, insf -e -q -I 0,
ioinit. Its again and again creating same "1mn" instead of "0mn". The ioinit command says error message as
"Instance number 0 already exists for class tape".

Kindly respond asap to earn your maximum points from me. Thnks in advance.
You can do it man !
14 REPLIES
Geno Church_1
Valued Contributor

Re: how to change Instance number for a tape drive?

Attached is a step by step document....

Geno
A. Clay Stephenson
Acclaimed Contributor

Re: how to change Instance number for a tape drive?

This is really simple. You can use ioscan to force a change of the bus instance number but that will can have the effect of redefining other things as well. Those names like 0m, 1mnb, ... don't mean anything to the computer; they are just for ous dumb ole humans. What the computer cares about are the major/minor device number tuples.

cd /dev/rmt
ls -l | lp (so that you have hard copy in front of you).

Let's say that 1m
Is now major numer 205 Minor Device 0x052000

All you need to do is,
rm 1m
mknod 0m c 205 0x052000

You now have a 0m with the correct major/minor device numbers. Repreat for the 1mn,1mnb, and 1b nodes.

This is the way device nodes were created in the dim mists of time before there were insf commands.
If it ain't broke, I can fix that.
Selvaraj
Advisor

Re: how to change Instance number for a tape drive?

Geno,
your step by step procedure is not working for me. But the procedure is right. The error message is:
"Instance number 0 already exists for class tape"
It exited without doing anything. So there is no point in rebooting the node also. Please suggest some other option to change instance number for this hardware.

Stephen,
your procedure will give us temporary solution. But the instance number remains same while performing ioscan. Basically we are using 1m/1mn device file for 0m/0mn which is not permanent solution. Can u please suggest us some other method to resolve this issue permanently. I tried to reboot a lab node to see whether it creates new device file with instance number "0". But the effort goes invain.

Any help from both of you would be highly appreciated.

You can do it man !
Selvaraj
Advisor

Re: how to change Instance number for a tape drive?

Can anyone help me out with this problem?
You can do it man !
Joshua Scott
Honored Contributor

Re: how to change Instance number for a tape drive?

What ioscan options are you using to see the instance number?

Josh
What are the chances...
A. Clay Stephenson
Acclaimed Contributor

Re: how to change Instance number for a tape drive?

Actually, recreating the tape device nodes works perfectly and is preserved across boot as long as you don't issue a rmsf command.
If it ain't broke, I can fix that.
Selvaraj
Advisor

Re: how to change Instance number for a tape drive?

Josh,

I am using "ioscan -funC tape" as well as "ioscan -kf" to see instance number. Whenever I perform "ioinit -f /tmp/infile" with instance number as "0", I receive message as "Instance number 0 already exists for class tape".

Stephen,
you are right, the tape device file remains same until we issue "rmsf" command on that system. But that is not a permanent solution for us. Is there any toher method to perform ioinit by removing existing instance number and configure again with instance number "0".

You can do it man !
Joshua Scott
Honored Contributor

Re: how to change Instance number for a tape drive?

I tried this out on a workstation I have here (rm'd all of the tape device files) then I did a mknod to recreate them. originally in /dev/rmt I had 0m, 0mn, etc. The ones I remade were 1m, 1mn, etc.

I then rebooted.

attached is the output of ioscan -kf
What are the chances...
Joshua Scott
Honored Contributor

Re: how to change Instance number for a tape drive?

attached:
ioscan -funC tape

What are the chances...
Joshua Scott
Honored Contributor

Re: how to change Instance number for a tape drive?

Then I did an insf -e, just for good measure.

attached is the ioscan -funC tape after the insf -e

What are the chances...
Joshua Scott
Honored Contributor

Re: how to change Instance number for a tape drive?

Also, I did this:
# /usr/sbin/fbackup -f /dev/rmt/1m -i/home
fbackup(1004): session begins on Thu Mar 25 15:13:37 2004
fbackup(3205): WARNING: unable to read a volume header
fbackup(3024): writing volume 1 to the output file /dev/rmt/1m
fbackup(3055): total file blocks read for backup: 630
fbackup(3056): total blocks written to output file /dev/rmt/1m: 717
fbackup(1030): warnings encountered during backup
# cd /home/ftp/etc
# ll
-r--r--r-- 2 root other 174 Mar 15 11:51 group
-r--r--r-- 2 root other 174 Mar 15 11:51 logingroup
-r--r--r-- 1 root other 479 Mar 15 11:51 passwd
# mv group group.test
# /usr/sbin/frecover -x -f /dev/rmt/1m -i /home/ftp/etc/group
# ll
total 64
-r--r--r-- 1 root other 174 Mar 15 11:51 group
-r--r--r-- 2 root other 174 Mar 15 11:51 group.test
-r--r--r-- 2 root other 174 Mar 15 11:51 logingroup
-r--r--r-- 1 root other 479 Mar 15 11:51 passwd
# rm group
# /usr/sbin/frecover -x -f /dev/rmt/0m -i /home/ftp/etc/group
# ll
total 64
-r--r--r-- 1 root other 174 Mar 15 11:51 group
-r--r--r-- 2 root other 174 Mar 15 11:51 group.test
-r--r--r-- 2 root other 174 Mar 15 11:51 logingroup
-r--r--r-- 1 root other 479 Mar 15 11:51 passwd

---

As you can see, the both devices worked well at the same time.

Having both the 0m and 1m device files didn't affect my backup and restore.

Josh
What are the chances...
Selvaraj
Advisor

Re: how to change Instance number for a tape drive?

I found the issue with tape drive IDs. Hope you can understand from my first question, we swapped hard disk between production and lab nodes with same hardware configuration and model number. But it mismatched with tape drive IDs. The production node tape drive pointed to ID number "3" and the lab node pointed to ID number "0". That is the reason, it says "Instance number 0 already exists for class tape". Now I changed tape drive ID manually and corrected the issue without rebooting the box. The steps I followed are in production node:
1. Removed special files on tape devices using "rmsf -C tape -H "
2. Powered off tape drive while system runs online.
3. Changed tape drive SCSI ID to match production node (manually pulled out to change settings)
4. Powered on tape drive.
5. Performed "ioscan" command.
6. Performed "insf -e -q -C tape -H ".

Then it creates "0m/0mn" successfully and instance number on hard path also got changed to "0". My problem is solved for now.

Only concern is, how do we clear old instance number and create new one with instance number "0" without changing SCSI ID on tape drive but using the existing ID. Is there any method to remove "ioconfig" file and create new one with kernel files?. your suggestion is highly appreciated.

Thanks for all your help.
You can do it man !
Bill Hassell
Honored Contributor

Re: how to change Instance number for a tape drive?

Instance numbers are always created in the order in which new hardware is discovered. So the history of your server is what creates the apparent mismatch. If keeping the naming conventions is important, then hardware must be carefully added and deleted. However, it may be a much more portable solution to use symbolic links. Whatever name belongs to the desired tape drive (/dev/rmt/0mn, etc) just create a symlink called tape. For example:

ln -s /dev/rmt/0mn /dev/rmt/tape

So when you move to another server, figure out what the name of the tape is and create the symlink. A lot simpler, and avoids editing the fairly critical ioinit file.


Bill Hassell, sysadmin
Amrutha
Occasional Advisor

Re: how to change Instance number for a tape drive?

Thanks for this doc,