Operating System - HP-UX
1833778 Members
2510 Online
110063 Solutions
New Discussion

How can I change device name ?

 
SOLVED
Go to solution
dapeng.liu
Occasional Contributor

How can I change device name ?

Now I want to change my lan adapter device name, such as from lan0 to lan1 and lan1 to lan0?
By the way, I alse want change tape device name for /dev/rmt/0m to /dev/rmt/1m?
many thanks
2 REPLIES 2
Matti_Kurkela
Honored Contributor

Re: How can I change device name ?

You could simply "mv /dev/rmt/0m /dev/rmt/1m", but this will cause much confusion if/when you add a second tape device. So this is not recommended.

The correct way to do this is to use the "ioinit -f" command. Re-assigning the devices will require a reboot. Read "man ioinit" very carefully before using it.

MK
MK
Bill Hassell
Honored Contributor
Solution

Re: How can I change device name ?

The lan adapter name can be changed in /etc/rc.config.d/netconf. Just swap the instance numbers (which re defined as array values) between [0] and [1]. It will require a reboot. There is no way to change lan numbers online without losing your networking.

You can go the ioinit route but it is highly risky when mistakes are made. A better way is to remove and re-add the two tape drives using rmsf. Find the hardware address for both 0m and 1m like this:

lssf /dev/rmt/[01]m

Then use rmsf -aH to remove the devices:

rmsf -aH 0/0/4/1/0.3.21.255.0.1.0
rmsf -aH 0/0/4/1/0.3.20.255.0.1.0

Now, keeping in mind which disk addresses are to be 0 and 1, add them back by specifying the instance you'd like to use (instance = 0 or 1), like this:

insf -I 0 -H 0/0/4/1/0.3.20.255.0.1.0
insf -I 1 -H 0/0/4/1/0.3.21.255.0.1.0

You never want to just rename a couple of tape device filenames. List the tape device files with:

ioscan -knfC tape

and you'll see many different names for each tape drive. They all must be renamed, thus the use of rmsf and insf above.


Bill Hassell, sysadmin