Operating System - HP-UX
1837242 Members
4919 Online
110115 Solutions
New Discussion

how to change a tape device filename

 
Nabil Boussetta
Frequent Advisor

how to change a tape device filename

i'd like to change a tape device filename from /dev/rmt/0mn to /dev/rmt/1mn.
how to do?
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: how to change a tape device filename

Here's a guide:

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
Robert-Jan Goossens
Honored Contributor

Re: how to change a tape device filename

How about creating a link to /dev/rmt1mn ?

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

Regards,
Robert-Jan
Thierry Poels_1
Honored Contributor

Re: how to change a tape device filename

hi,

renaming tape, lan ... device filenames is tricky stuff.

How about creating a simple link?
ln -s /dev/rmt/0mn /dev/rmt/1mn

or always use links:
ln -s /dev/rmt/0mn /dev/rmt/DLT1
ln -s /dev/rmt/1mn /dev/rmt/LTO2
...

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Bill Hassell
Honored Contributor

Re: how to change a tape device filename

Actually, tape device names are quite neutral. You can simply use mv to rename the device file. Other than some default 0mn names in tar and other backup tools, you can rename 0mn to tape37 if you want. Note also that insf/mksf create some lengthy names that are duplicates of other device file values. A tape device file is just a connection to the driver (major number) and options for the tape operation (minor number) such as rewind and density. There are no special connections to the 0mn 1mn 2mn ... names other than historic.


Bill Hassell, sysadmin
Hoang Chi Cong_1
Honored Contributor

Re: how to change a tape device filename

Hi Nabil

Here are the proceduces:

1. rm -f /dev/rmt/*
2. insf -eC tape

That's all!

Goodluck
Looking for a special chance.......
Nguyen Anh Tien
Honored Contributor

Re: how to change a tape device filename

Hi Nabil.
I recommand you use hard link. (read Hard link doc at attached doc)
#ln /dev/rmt/0mn /dev/rmt/1mn
I usually use this way for my tape in backup.
HTH
HP is simple