Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the name of an ent device 1

Status
Not open for further replies.

trifo

MIS
May 9, 2002
269
HU
Hi folks,

I have a trouble on ethernet devices. There was a host whith 2 ent devices: ent2 and ent3. And a software which heavily relies on constant device numbering.

The host has been reconfigured recently (al ent devices rmdev-ed and the cfgmgr has been run)

Now I have 2 ent devices called ent0 and ent1.

Can you tell me how to set the original device numbering in a correct manner?

What I tried was the following:
1) sent both adapters to Defined state
2) mixed up some info in CuDv
(the name of parent pci device and the location)
3) run cfgmgr.

Appeared 2 fake (Defined) devices and 2 real (Available)

4) at this point eliminated the Defined adapters using rmdev -Rdl ...

All this seems OK, but is it really?

--Trifo
 
It is not advicable to play around with the CuDv odm class!

If this is an LPAR, try creating virtual ents!

Regards,
Khalid
 
This is how I normally do it.

Code:
First, get all the information about the adapters.

for i in ent0 ent1 ent2
do
odmget -q name=”$i” CuDv >> /tmp/$i
odmget -q name=”$i” CuAt >> /tmp/$i
odmget -q name=”$i” CuVPD >> /tmp/$i
done

Next, down the interfaces and detach them.

for i in en0 en1 en2 et0 et1 et2
do
ifconfig $i down
ifconfig $i detach
done

Now, remove all the references to the devices from the ODM

for i in ent0 ent1 ent2 en0 en1 en2 et0 et1 et2
do
odmdelete -q name=”$i” -o CuAt
odmdelete -q name=”$i” -o CuDv
odmdelete -q name=”$i” -o CuVPD
odmdelete -q value3=”$i” -o CuDvDr
done

We can verify that no adapters and no interfaces exist now by issuing the lsdev commands again. All we should see is the loopback interface.

lsdev -Cc adapter -l ent*
lsdev -Cc if
lo0 Available Loopback Network Interface

Edit the files we created the first step and replace every instance of the adapter name with the new adapter name. For instance, I would edit /tmp/ent0 and replace all instances of “ent0? with “ent2?. We can do this with a sed script.

sed -e “s/ent0/ent1/g” /tmp/ent0 > /tmp/ent1.new
sed -e “s/ent1/ent2/g” /tmp/ent1 > /tmp/ent2.new
sed -e “s/ent2/ent0/g” /tmp/ent2 > /tmp/ent0.new

Then add the files back to the ODM.

odmadd /tmp/ent0.new
odmadd /tmp/ent1.new
odmadd /tmp/ent2.new

At this point, our adapters will now be redefined. Issue another lsdev command to check:

lsdev -Cc adapter -l ent*
ent0 Available 05-08 10/100/1000 Base-TX PCI-X Adapter (14106902)
ent1 Available 07-08 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902)
ent2 Available 07-09 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902)

You can see now that ent0 is now the external PCI-X adapter and ent1 and ent2 are the two onboard adapters. But, we still have no interfaces for the adapters. You can verify this by issuing the usual lsdev command again. You should only see the loopback interface.

lsdev -Cc if
lo0 Available Loopback Network Interface

To fix this ( and to make sure our changes stick upon a reboot… ), run a cfgmgr, then check for our interfaces.

cfgmgr
lsdev -Cc if
en0 Defined 05-08 Standard Ethernet Network Interface
en1 Defined 07-08 Standard Ethernet Network Interface
en2 Defined 07-09 Standard Ethernet Network Interface
et0 Defined 05-08 IEEE 802.3 Ethernet Network Interface
et1 Defined 07-08 IEEE 802.3 Ethernet Network Interface
et2 Defined 07-09 IEEE 802.3 Ethernet Network Interface
lo0 Available Loopback Network Interface

As you can see, we have successfully gotten our interfaces back. We’re almost done! All you need to do now is reboot the system.

shutdown -Fr

Once the reboot has completed, issue one last check to verify that the adapters have changed:

entstat -d ent0 | grep “Device Type”
Device Type: 10/100/1000 Base-TX PCI-X Adapter (14106902)

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top