Operating System - HP-UX
1836645 Members
1515 Online
110102 Solutions
New Discussion

How to control "short" /dev/rmt/ file names?

 
Fedon Kadifeli
Super Advisor

How to control "short" /dev/rmt/ file names?

Once we had two DLT devices connected to the system. Their names were:

/dev/rmt/1m
/dev/rmt/2m

The only DDS drive has the name:

/dev/rmt/0m

Then we removed the DLT drives and connected the two drives of our new DLT 4/60 library. The new drives got the names:

/dev/rmt/3m
/dev/rmt/4m

Then we connected the remaining two drives of the DLT 4/60 library. The new drives got the names

/dev/rmt/5m
/dev/rmt/6m

but, by mistake, there were connected in reverse order; so I switched the cables of the last two drives. The system now created two new device files:

/dev/rmt/7m
/dev/rmt/8m

As a result the "ioscan -fnC tape" output is as follows:

Class I H/W Path Driver S/W State H/W Type Description
===================================================================
tape 3 0/2/0.1.0 stape CLAIMED DEVICE QUANTUM DLT8000
/dev/rmt/3m /dev/rmt/c0t1d0BEST
/dev/rmt/3mb /dev/rmt/c0t1d0BESTb
/dev/rmt/3mn /dev/rmt/c0t1d0BESTn
/dev/rmt/3mnb /dev/rmt/c0t1d0BESTnb
tape 4 1/2/0.2.0 stape CLAIMED DEVICE QUANTUM DLT8000
/dev/rmt/4m /dev/rmt/c2t2d0BEST
/dev/rmt/4mb /dev/rmt/c2t2d0BESTb
/dev/rmt/4mn /dev/rmt/c2t2d0BESTn
/dev/rmt/4mnb /dev/rmt/c2t2d0BESTnb
tape 0 4/2/0.1.0 stape CLAIMED DEVICE HP C1537A
/dev/rmt/0m /dev/rmt/c4t1d0BESTn
/dev/rmt/0mb /dev/rmt/c4t1d0BESTnb
/dev/rmt/0mn /dev/rmt/c4t1d0DDS
/dev/rmt/0mnb /dev/rmt/c4t1d0DDSb
/dev/rmt/c4t1d0BEST /dev/rmt/c4t1d0DDSn
/dev/rmt/c4t1d0BESTb /dev/rmt/c4t1d0DDSnb
tape 7 5/0/0.3.0 stape CLAIMED DEVICE QUANTUM DLT8000
/dev/rmt/7m /dev/rmt/c5t3d0BEST
/dev/rmt/7mb /dev/rmt/c5t3d0BESTb
/dev/rmt/7mn /dev/rmt/c5t3d0BESTn
/dev/rmt/7mnb /dev/rmt/c5t3d0BESTnb
tape 8 5/2/0.4.0 stape CLAIMED DEVICE QUANTUM DLT8000
/dev/rmt/8m /dev/rmt/c6t4d0BEST
/dev/rmt/8mb /dev/rmt/c6t4d0BESTb
/dev/rmt/8mn /dev/rmt/c6t4d0BESTn
/dev/rmt/8mnb /dev/rmt/c6t4d0BESTnb

Since we have only 4 DLT drives connected to the system now, I want them to have the names:

/dev/rmt/1m, /dev/rmt/2m, /dev/rmt/3m and /dev/rmt/4m

respectively. This is necessary, since these drives will be connected to another (similar) system (via shared bus) and the device names should be the same on both systems.

I tried to delete all the files in /dev/rmt and run insf, but the result was the same. Even rebooting the system, will not prevent it for giving the same names. There should be somewhere a permanent location (a configuration file?) which keeps track of the "short" device names to be generated for tape devices. How can I change this?
6 REPLIES 6
Patrick Wessel
Honored Contributor

Re: How to control "short" /dev/rmt/ file names?

Fedon,

Do you really want to do that?
If you answered that question with yes (and only than) you have to modify the /stand/ioconfig file.

1) The first step should be a reliable backup!!!

2) Than, create a file with the current io configuration, which can be used by ioinit:

ioscan -kf | grep -e INTERFACE -e DEVICE |
grep -v target |
awk '{printf "%s %s %sn",$3,$1,$2}' > infile


3) Change the instance number of the DDS and DLT drives in the way you want them to be:

vi infile


4) Move the infile to /stand.

mv infile /stand/infile


5) Move the ioconfig files.

mv /stand/ioconfig /stand/ioconfig.sav
mv /etc/ioconfig /etc/ioconfig.sav


4) Reboot the box in single user mode (not sure if this is really necessary, but it can't be wrong)


5) Create the new ioconfig files.

cd /stand
/sbin/ioinit -c
/sbin/ioinit -f infile


6) reboot the system


Be aware that a corrupt ioconfig can make your system unbootable!
Good luck
There is no good troubleshooting with bad data
Derek Davey
New Member

Re: How to control "short" /dev/rmt/ file names?

Fedon,

Details of hardware are generally held in the /etc/ioconfig file, which is not changeable manually.
You can update details by using the ioinit command (See the man page).

Yous shoould be able to change the instance numbers by using a file where each line contains the following details -



e.g

10/12/0 stape 1

then running the command

ioinit -f

Hope this helps

Derek
Gadi
Advisor

Re: How to control "short" /dev/rmt/ file names?

Hi Fedon,

first you have to delete all of
the dev files using rmsf.
for example: rmsf -H 4/2/0.1.0.
After /dev/rmt becoms empty, use
insf for recreating special files.
for example: insf -e -H 0/2/0.1.0.
This will create device files.

Don't rename the files, use ln for
the desired names. (for example:
ln /dev/rmt/c0t1d0BEST /dev/rmt/1m).

Good luck
Jerry Whelan
Occasional Contributor

Re: How to control "short" /dev/rmt/ file names?

If you don't care about the numbering of any other devices,
a simple "ioinit -c" from single user mode looks like it will do the
trick. Your tape devices will be renumbered as well as any other
devices (extra lan cards, etc).
Eddie Warren
Valued Contributor

Re: How to control "short" /dev/rmt/ file names?

To simply rename the /dev/rmt/ files to what you want, have you tried for example:

mv /dev/rmt/3m /dev/rmt/1m (Do this for all the device files you want to rename). HP has recommended this to me in the past and it worked fine. Hope this helps.
Fedon Kadifeli
Super Advisor

Re: How to control "short" /dev/rmt/ file names?

The problem was solved with help from HP Support. The solution is to use the following procedure (should work on all machines):

1. ioscan -kf | grep -e INTERFACE -e DEVICE | grep -v target |
awk '{printf "%s %s %sn",$3,$1,$2}' >infile

2. vi infile (change the 'tape 7' to 'tape 3' for example)

3. mv infile /stand/infile

4. mv /stand/ioconfig /stand/ioconfig.sav
mv /etc/ioconfig /etc/ioconfig.sav

5. shutdown -ry 0

6. interrupt the boot process, boot pri, interact with ISL.

7. ISLboot (1/0/0.6.0;0)/stand/vmunix -is

8. The system will come to an ioinitrc prompt. Recreate the ioconfig file by typing:

cd /stand
/sbin/ioinit -c
^D # To exit and continue the boot process

9. Once system is booted make sure it is in single user mode:

init s
/sbin/ioinit -f infile -r

Once the system has rebooted verify that all instance numbers are correct.

Note:
-----
On HP-UX 11.xx the device file for the SCSI controller (/dev/rscsi/c2t7d0) is based on the instance number of the 'ext_bus' and not of the 'ctl' Instance number. In order for SCSI instance numbers and device files to line up you must change both the ext_bus and ctl Instance numbers to the same number. Therefore the 'infile' would look something like this:

0/2/0 ext_bus 0
0/2/0.0.0 autoch 0
0/2/0.1.0 tape 1
0/2/0.6.0 ctl 0
1/2/0 ext_bus 2
1/2/0.2.0 tape 2
1/2/0.6.0 ctl 2

Thank you, to everybody for their help...