Operating System - HP-UX
1833760 Members
2232 Online
110063 Solutions
New Discussion

To Change tape device file

 
SOLVED
Go to solution

To Change tape device file

Hi,
MY Unix tape device file is /dev/rmt/0m with major/minor number as follow : 0x005000

Need assistant to change the device file to /dev/rmt/1m and is it recommended in HP-UX and what happend for next reboot?

Rgds
6 REPLIES 6
Bharat Katkar
Honored Contributor
Solution

Re: To Change tape device file

Hi,
Simple way is to create a Soft link as follows:

# ln -s /dev/rmt/0m /dev/rmt/1m
# ln -s /dev/rmt/0mn /dev/rmt/1mn

Repeat this for all device.

Make sure you don't have 1m device already existing on your system.

# ioscan -fnC tape | grep 1m

Hope that helps.
Regards,

You need to know a lot to actually know how little you know

Re: To Change tape device file

Tq.

Is thre any other way such mmknod command, please assist.

Rgd
Simon Hargrave
Honored Contributor

Re: To Change tape device file

You can do it with symbolic links as suggested above, but that may get overwritten eg if you add extra tape devices in future.

The best way (but this required a reboot) is to change the instance number of the device.

If you execute: ioscan -fnCtape

You will get output like: -

Class I H/W Path Driver S/W State H/W Type Description
=================================================================================
tape 0 0/0/1/0.4.0 stape CLAIMED DEVICE HP C5683A
/dev/rmt/0m /dev/rmt/c0t4d0BESTn
/dev/rmt/0mb /dev/rmt/c0t4d0BESTnb
/dev/rmt/0mn /dev/rmt/c0t4d0DDS
/dev/rmt/0mnb /dev/rmt/c0t4d0DDSb
/dev/rmt/c0t4d0BEST /dev/rmt/c0t4d0DDSn
/dev/rmt/c0t4d0BESTb /dev/rmt/c0t4d0DDSnb


This shows instance number 0, which is why /dev/rmt/0mn is in use.

If you create a text file with contents similar to the following (substituting the correct IO path as indicated with ioscan): -

0/0/1/0.4.0 tape 1

Then run: ioinit -f

This will reassign the tape device as Instance 1. When you reboot, the new device file will be created as /dev/rmt/1m, and you can be sure nothing will reuse this.
Pete Randall
Outstanding Contributor

Re: To Change tape device file

Attached is the method I use.


Pete

Pete

Re: To Change tape device file

Hi Pete, your attachment please.

Rgds
Pete Randall
Outstanding Contributor

Re: To Change tape device file

To see the attachment, you can click on the "paper clip" symbol. Just in case there's a problem with it, I'll paste it here:


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