Operating System - HP-UX
1833877 Members
2230 Online
110063 Solutions
New Discussion

renaming tape device files

 
SOLVED
Go to solution
Jagadesh_2
Regular Advisor

renaming tape device files

In HPUX 11i. I need to change the tape device file names. After installing the device files using insf, i am getting the device files with 1m, 1mn, 1mnb etc. I need to change it to 0m, 0mn, 0mnb etc.
I renamed those device files residing under /dev/rmt/ to 0m, 0mn.. etc.
crw-rw-rw- 2 bin bin 205 0x050000 Jul 27 09:41 0m
crw-rw-rw- 2 bin bin 205 0x050080 Jul 27 09:41 0mb
crw-rw-rw- 2 bin bin 205 0x050040 Jul 27 09:41 0mn
crw-rw-rw- 2 bin bin 205 0x0500c0 Jul 27 09:41 0mnb
crw-rw-rw- 2 bin bin 205 0x050000 Jul 27 09:41 c5t0d0BEST
crw-rw-rw- 2 bin bin 205 0x050080 Jul 27 09:41 c5t0d0BESTb
crw-rw-rw- 2 bin bin 205 0x050040 Jul 27 09:41 c5t0d0BESTn
crw-rw-rw- 2 bin bin 205 0x0500c0 Jul 27 09:41 c5t0d0BESTnb

Do i have to do any additional things apart from renaming the device files?

Thanks
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: renaming tape device files

I've answered tape device file naming questions so often that I finally put together this little canned response:

First, let me echo Bill Hassell in saying you can simply rename the existing device file. There is no significance other than historical to the device names as
we know them.

Second, if you're still nervous about it, you can use a link - linking the undesired name to the preferred name.

Third, if you really want to re-create the device names properly, here is a guide:

1. Use "ioscan" to find out what the current device files look like and what the 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 with the correct tape drive:

ioscan -kfnCtape



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


Hope this helps!


Pete

Pete
Simon Hargrave
Honored Contributor

Re: renaming tape device files

This will technically work, however you may have problems in future when insf is executed to create new special files.

If you execute ioscan -fnCtape on your server, you will notice for your drive you will have instance number 1 (under the I column). This means that when the system next creates system files (insf -e for example) it will recreate the 1m* files. You may also risk overwriting the 0m* files if new tape drives are subsequently added.

To make sure everything remains okay you need to change your tape drive (assuming it is the only one you have and is currently instance 1) to be instance 0.

Create a file /tmp/tapemove to contain

16/5.0.0 tape 0

(substitute the hardware path with the path of your tape drive)

then run ioinit -f /tmp/tapemove -r

(this will reboot the server so make sure you can).

After reboot you can empty /dev/rmt and run ioinit to create all the files correctly.
Venkatesan_5
Frequent Advisor

Re: renaming tape device files

hi,

you can do the following steps.

1. make sure all the renamed files and created files are having the same major number and minor number..

2. how did u created the device files ? using mknod....if it is not u can create using mknod also but you have to do it manually for all devices such as 1mn,1mnb,BEST...etc....

hope this helps you...

regds

Venkatesan.
Jagadesh_2
Regular Advisor

Re: renaming tape device files

Thanks for your response.
Jagadesh_2
Regular Advisor

Re: renaming tape device files

Thanks for your response