[clug] After hardware failure udev remaps eth0 to eth1

Neil Pickford neilp at goldweb.com.au
Tue Mar 12 07:14:23 MDT 2013

I have had a 24x7 Linux host computer (running Slackware 13) that has 
been freezing occasionally and today it got terminal.
So I pulled the 40G IDE HDD out of the box and placed it in another 
chassis of the same type.
The machine booted up - however udev decided to remap eth0 to eth1 and 
because of this the network is not configured.

I fixed the network by changing rc.inet1.conf to point at eth1 instead 
of eth0 however I should not have had to do this.

I researched why udev would do this remapping and was going to ask a 
question until I solved it - So I thought I would provide my solution.

Udev has a network fingerprint from the previous motherboard stored in 
/etc/udev/rules.d/70-persistent-net.rules like:
# PCI device 0x8086:0x2449 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:08:02:5d:65:f6", ATTR{type}=="1", KERNEL=="eth*", 

The fix is to delete this file and reboot - udev will then regenerate 
this file and be happy with eth0.

After the reboot the file looks like:
# This file was automatically generated by the //lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x2449 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="00:08:02:5d:65:f6", ATTR{type}=="1", KERNEL=="eth*", 

So basically changing the NAME attribute with vi would have done the job.

Below is the tail end of /var/log/dmesg file.
udev network remap occurs 13 lines from the end.

Neil Pickford

Linux agpgart interface v0.103
processor ACPI_CPU:00: registered as cooling_device0
ACPI: Processor [CPU0] (supports 8 throttling states)
parport_pc 00:07: reported by Plug and Play ACPI
parport0: PC-style at 0x378 (0x778), irq 7 [PCSPP,TRISTATE]
rtc_cmos 00:03: RTC can wake from S4
rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one month, y3k, 114 bytes nvram
agpgart-intel 0000:00:00.0: Intel 845G Chipset
agpgart-intel 0000:00:00.0: AGP aperture is 64M @ 0xf8000000
e100: Intel(R) PRO/100 Network Driver, 3.5.23-k6-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
e100 0000:02:08.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20
e100 0000:02:08.0: PME# disabled
e100: eth0: e100_probe: addr 0xfc400000, irq 20, MAC addr 00:08:02:5d:65:f6
Intel ICH 0000:00:1f.5: PCI INT B -> GSI 17 (level, low) -> IRQ 17
Intel ICH 0000:00:1f.5: setting latency timer to 64
intel8x0_measure_ac97_clock: measured 50976 usecs
intel8x0: clocking to 41152
input: ImPS/2 Generic Wheel Mouse as 
ppdev: user-space parallel port driver
udev: renamed network interface eth0 to eth1
Adding 1566296k swap on /dev/hda5.  Priority:-1 extents:1 across:1566296k
fuse init (API version 7.11)
EXT4 FS on hda1, internal journal on hda1:8
lp0: using parport0 (interrupt-driven).
lp0: console ready
EXT4-fs: barriers enabled
kjournald2 starting: pid 2589, dev hda6:8, commit interval 5 seconds
EXT4 FS on hda6, internal journal on hda6:8
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4-fs: mounted filesystem hda6 with ordered data 

More information about the linux mailing list