1838378 Members
4444 Online
110125 Solutions
New Discussion

Special files for Tape

 
SOLVED
Go to solution
HDgio
Regular Advisor

Special files for Tape

Hi,
I have a L1000 with a DAT DDS3 (rmt0) and id scsi 3.
I need install another device (TZ89 Compaq) and I wont see it with rmt0 and not a DDS.

I have setting at 2 id SCSI of TZ and 5 a DAT.
Do you now why when I reboot my system the result is:
TZ rmt1
DAT rmt2
thanks to all
11 REPLIES 11
Ravi_8
Honored Contributor

Re: Special files for Tape

Hi

can u post the o/p of
#ioscan -fnC tape
never give up
Pete Randall
Outstanding Contributor
Solution

Re: Special files for Tape

You can make the device files anything you want them to be. Just follow the following procedure:


1. Use "ioscan" to find out what the current device files look like and what th
e instance number is:
ioscan -kfnCtape


2. Use "mksf" to create each of the four types of device files:

/sbin/mksf -d stape -I 12 -a -b BEST rmt/12m
/sbin/mksf -d stape -I 12 -u -b BEST rmt/12mb
/sbin/mksf -d stape -I 12 -a -n -b BEST rmt/12mn
/sbin/mksf -d stape -I 12 -u -n -b BEST rmt/12mnb


3. Use "ll" to compare your newly created device files with those created by the
system. Major and minor numbers should match between corresponding entries (205
0x061000 for both 12m and the equivalent c6t1d0BEST):

ll /dev/rmt |more

crw-rw-rw 1 bin bin 205 0x061000 Mar 17 08:40 12m
.
.
.
crw-rw-rw 1 bin bin 205 0x061000 Mar 17 08:40 c6t1d0BEST
.
.
.



4. repeat the ioscan to double check that your new device files are associated w
ith the correct tape drive:

ioscan -kfnCtape



I was using 12m in the example but you can use anything you want.


Pete

Pete
Mark Greene_1
Honored Contributor

Re: Special files for Tape

Pete,

Where can I find info on what major/minor number combinations to use for various hardware?

Thanks!
mark
the future will be a lot like now, only later
Pete Randall
Outstanding Contributor

Re: Special files for Tape

Mark,

Try lsdev.


Pete

Pete
Bill Hassell
Honored Contributor

Re: Special files for Tape

There is not a single source (anymore) for all devices. Information on tape device major and minor numbers can be found in:

man 7 mt

A major number is just a pointer to a specific driver. The lsdev command will list all the major numbers. Section 7 man pages for the various classes of drivers (tape, stape, scsi_disk, cent, etc) will detail the minor numbers.


Bill Hassell, sysadmin
Mark Greene_1
Honored Contributor

Re: Special files for Tape

Pete, Bill,

Thanks for the info. Can't leave you points, consider yourself each to have a guinness due from me!

mark
the future will be a lot like now, only later
HDgio
Regular Advisor

Re: Special files for Tape

Dear Friens
At reboot of my system with a mksf(thanks to Pete) command and only TZ89 connected I have this configuration:
tape 1 0/0/1/0.2.0 stape CLAIMED DEVICE DEC TZ89 (C) DEC

/dev/rmt/0m /dev/rmt/c0t2d0BEST
/dev/rmt/0mb /dev/rmt/c0t2d0BESTb
/dev/rmt/0mn /dev/rmt/c0t2d0BESTn
/dev/rmt/0mnb /dev/rmt/c0t2d0BESTnb
After I have connected a DAT and with ioscan and insf -v the special file for a DAT is:
tape 0 0/0/1/0.3.0 stape CLAIMED DEVICE HP C1537A

/dev/rmt/c0t3d0BEST /dev/rmt/c0t3d0DDS
/dev/rmt/c0t3d0BESTb /dev/rmt/c0t3d0DDSb
/dev/rmt/c0t3d0BESTn /dev/rmt/c0t3d0DDSn
/dev/rmt/c0t3d0BESTnb /dev/rmt/c0t3d0DDSnb

I don't understand why not are
/dev/rmt/1m /dev/rmt/c0t3d0BESTn
/dev/rmt/1mb /dev/rmt/c0t3d0BESTnb
/dev/rmt/1mn /dev/rmt/c0t3d0DDS
/dev/rmt/1mnb /dev/rmt/c0t3d0DDSb
And why, in other L1000 if I disconnect a DAT,reboot a system, insert a TZ see it with /dev/rmt/0m with't mksf.
Thank to all
HDgio
Regular Advisor

Re: Special files for Tape

Do you now why the Istance number of the device
is different from one system to another ?
Class I H/W Path Driver S/W State ==========================================
tape 0 0/0/1/0.3.0 stape CLAIMED DEVICE HP C1537A

Class I H/W Path Driver S/W State ==========================================
tape 4 0/0/1/0.3.0 stape CLAIMED DEVICE HP C1537A

Thanks

Bill Hassell
Honored Contributor

Re: Special files for Tape

Instance numbers are chosen as the next occurance of a device for the driver. So the first tape drive seen by the system will be instance zero, and the next one will be one, etc. The instance has nothing to do with the SCSI address, model of the drive, etc. Instance numbers may change if you reinstall with multiple tape drives. At reinstall (even with Ignite/UX), ioscan will find the devices in backplane order, lowest slot first moving to the highest numbered slot which is usually the combination board. Now if you originally had a tape drive connected to the combo board's SCSI connector, it will be instance 0. Add another drive to a different SCSI card and it will be instance 1.

But leave both tape drives attached and reinstall HP-UX and now the drive attached to the SCSI card will be instance 0 (it will be found first) and the drive connected to the combo board will be instance 1. To make things a bit more confusing, many sysadmins remove and add devices without informing the kernel and the instance numbers will not make much sense. The proper way is to use rmsf so the instance number is freed up.

However, instance numbers can just be looked at as arbitrary characters in the devicefile name. You can use mknod to create any devicefile name you would like to use. Or you can rename the devicefile. The minor number has the instance number which is the devicefile's connection to the device. All the other characters (BEST, DDS, etc) are just descriptive mnemonics. You can call the first tape /dev/rmt/dds3 and the second tape /dev/rmt/tz89 if you want. There are some commands like tar and mt that assume /dev/rmt/0m is the default tape but I never use defaults as I work on too many different machines.


Bill Hassell, sysadmin
HDgio
Regular Advisor

Re: Special files for Tape

Dear Bill Thanks for you reply.
My problem is caused from an application of a GUI that for error it has wired within the code rmt0 and must absolutely address the TZ in the simpler way why the operation will have to be made in several installations in the world and to make it they will not be just of the technicians.
Always thanks for your availability.
Bill Hassell
Honored Contributor

Re: Special files for Tape

Although the code is poorly designed (hardcoded devicefile names), you can still work around the issue. You can use symbolic links from your desired names (rmt0 and TZ) to the actual devicefile name:

ln -s /dev/rmt/1m /dev/rmt/rmt0

Or you can create a duplicate devicefile with the required name using mknod. Use ll to show the major and minor number and use those values for mknod.


Bill Hassell, sysadmin