Debian Bug report logs - #627883
initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?

Package: udev; Maintainer for udev is Marco d'Itri <md@linux.it>; Source for udev is src:systemd.

Reported by: Timo Juhani Lindfors <timo.lindfors@iki.fi>

Date: Wed, 25 May 2011 08:06:01 UTC

Severity: normal

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian kernel team <debian-kernel@lists.debian.org>:
Bug#627883; Package initramfs-tools. (Wed, 25 May 2011 08:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Juhani Lindfors <timo.lindfors@iki.fi>:
New Bug report received and forwarded. Copy sent to Debian kernel team <debian-kernel@lists.debian.org>. (Wed, 25 May 2011 08:06:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?
Date: Wed, 25 May 2011 11:02:48 +0300
Package: initramfs-tools
Version: 0.98.8
Severity: normal

Description
===========

On a network booting machine with

oper@watt:~$ zcat /boot/initrd.img-2.6.32-5-amd64 | cpio -i --to-stdout lib/udev/rules.d/70-persistent-net.rules
# lindi: ethernet port #1 (BIOS boots using this)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:36:c0:d2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10ec (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:a1:d7:83", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x8086:0x10ec (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:a1:d7:82", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x8086:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:36:c0:d3", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
53853 blocks

and

$ grep DEVICE= /etc/initramfs-tools/initramfs.conf
DEVICE=eth0

I see that ipconfig gets stuck at bootup trying to send DHCP requests
over a NIC whose MAC is not 00:25:90:36:c0:d2.

Troubleshooting
===============

I placed a call to "/bin/sh" just before configure_networking call in

oper@watt:~$ zcat /boot/initrd.img-2.6.32-5-amd64 | cpio -i --to-stdout scripts/nfs | head -n15
# NFS filesystem mounting                       -*- shell-script -*-

# FIXME This needs error checking

retry_nr=0

# parse nfs bootargs and mount nfs
do_nfsmount()
{

        configure_networking

        # get nfs root from dhcp
        if [ "x${NFSROOT}" = "xauto" ]; then
                # check if server ip is part of dhcp root-path



From this shell I see that the right NIC (i.e. the one with MAC of
00:25:90:36:c0:d2) has the name "eth1-eth0" and "eth0" is a wrong NIC. I
can see in source code of udev that it sometimes generates such names
but I don't fully understand the logic behind that. I did

rmmod ixgbe
rmmod igb
modprobe igb
modprobe ixgbe

and suddenly 00:25:90:36:c0:d2 was correctly named eth0.

The machine has 36 SATA disks and it takes a while to detect
them. Maybe there's a race condition somewhere?

As a workaround I'm now calling my 00:25:90:36:c0:d2 NIC "net0"
instead of "eth0".


-- Package-specific info:
-- initramfs sizes
-rw-r--r-- 1 root root 9.1M May 23 16:01 /boot/initrd.img-2.6.32-5-amd64
-- /proc/cmdline
root=/dev/nfs initrd=watt/initrd.img nfsroot=10.8.8.8:/tftpboot/watt ip=dhcp sysrq_always_enabled break=top BOOT_IMAGE=watt/vmlinuz 

-- resume
RESUME=UUID=d2e19371-27b1-4826-9d93-dd0f4e1f0ea3
-- /proc/filesystems

-- lsmod
Module                  Size  Used by
loop                   11799  0 
snd_pcm                60503  0 
snd_timer              15582  1 snd_pcm
snd                    46446  2 snd_pcm,snd_timer
soundcore               4598  1 snd
snd_page_alloc          6249  1 snd_pcm
psmouse                49937  0 
joydev                  8459  0 
pcspkr                  1699  0 
serio_raw               3752  0 
i2c_i801                7830  0 
evdev                   7352  4 
ioatdma                34876  32 
i2c_core               15819  1 i2c_i801
button                  4650  0 
processor              29935  16 
nfs                   241114  1 
lockd                  57603  1 nfs
fscache                29834  1 nfs
nfs_acl                 2031  1 nfs
auth_rpcgss            33476  1 nfs
sunrpc                161541  9 nfs,lockd,nfs_acl,auth_rpcgss
sd_mod                 29921  0 
crc_t10dif              1276  1 sd_mod
usbhid                 33292  0 
hid                    63257  1 usbhid
uhci_hcd               18521  0 
ehci_hcd               32081  0 
ixgbe                 106622  0 
usbcore               122386  4 usbhid,uhci_hcd,ehci_hcd
mpt2sas                87773  0 
scsi_transport_sas     19865  1 mpt2sas
mdio                    3096  1 ixgbe
scsi_mod              122149  3 sd_mod,mpt2sas,scsi_transport_sas
nls_base                6377  1 usbcore
igb                    77959  0 
dca                     3761  3 ioatdma,ixgbe,igb
thermal                11674  0 
thermal_sys            11942  2 processor,thermal

-- /etc/initramfs-tools/modules

-- /etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
do_bootloader = no
do_initrd = yes
link_in_boot = no

-- /etc/initramfs-tools/initramfs.conf
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
BOOT=nfs
DEVICE=eth0
NFSROOT=auto

-- /etc/initramfs-tools/update-initramfs.conf
update_initramfs=yes
backup_initramfs=no

-- mkinitramfs hooks
/etc/initramfs-tools/hooks/:

/usr/share/initramfs-tools/hooks:
busybox
dmsetup
keymap
klibc
mdadm
thermal
udev


-- System Information:
Debian Release: 6.0.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/16 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initramfs-tools depends on:
ii  cpio                          2.11-4     GNU cpio -- a program to manage ar
ii  findutils                     4.4.2-1+b1 utilities for finding files--find,
ii  klibc-utils                   1.5.20-1   small utilities built with klibc f
ii  module-init-tools             3.12-1     tools for managing Linux kernel mo
ii  udev                          164-3      /dev/ and hotplug management daemo

Versions of packages initramfs-tools recommends:
ii  busybox                       1:1.17.1-8 Tiny utilities for small and embed

Versions of packages initramfs-tools suggests:
ii  bash-completion               1:1.2-3    programmable completion for the ba

-- Configuration Files:
/etc/initramfs-tools/initramfs.conf changed:
MODULES=most
BUSYBOX=y
KEYMAP=n
COMPRESS=gzip
BOOT=nfs
DEVICE=net0
NFSROOT=auto


-- no debconf information




Bug reassigned from package 'initramfs-tools' to 'udev'. Request was from maximilian attems <maks@debian.org> to control@bugs.debian.org. (Wed, 25 May 2011 12:09:02 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions initramfs-tools/0.98.8. Request was from maximilian attems <maks@debian.org> to control@bugs.debian.org. (Wed, 25 May 2011 12:09:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#627883; Package udev. (Wed, 25 May 2011 23:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to md@Linux.IT (Marco d'Itri):
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Wed, 25 May 2011 23:09:03 GMT) Full text and rfc822 format available.

Message #14 received at 627883@bugs.debian.org (full text, mbox):

From: md@Linux.IT (Marco d'Itri)
To: Timo Juhani Lindfors <timo.lindfors@iki.fi>, 627883@bugs.debian.org
Subject: Re: Bug#627883: initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?
Date: Thu, 26 May 2011 01:05:47 +0200
[Message part 1 (text/plain, inline)]
On May 25, Timo Juhani Lindfors <timo.lindfors@iki.fi> wrote:

> oper@watt:~$ zcat /boot/initrd.img-2.6.32-5-amd64 | cpio -i --to-stdout lib/udev/rules.d/70-persistent-net.rules
Did you rebuild the initramfs as explained in README.Debian?
Search for NEED_PERSISTENT_NET.

-- 
ciao,
Marco
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#627883; Package udev. (Thu, 26 May 2011 10:33:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Juhani Lindfors <timo.lindfors@iki.fi>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Thu, 26 May 2011 10:33:14 GMT) Full text and rfc822 format available.

Message #19 received at 627883@bugs.debian.org (full text, mbox):

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: md@Linux.IT (Marco d'Itri)
Cc: 627883@bugs.debian.org
Subject: Re: Bug#627883: initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?
Date: Thu, 26 May 2011 13:31:05 +0300
md@Linux.IT (Marco d'Itri) writes:
> Did you rebuild the initramfs as explained in README.Debian?
> Search for NEED_PERSISTENT_NET.

Yes it detected the scenario automatically since fstab has

/dev/nfs /               nfs    errors=remount-ro 0       0

which is matched by

/usr/share/initramfs-tools/hooks/udev:  if   egrep -q '^/dev/(nbd|nd[a-z]|etherd/e)[^[:space:]]+[[:space:]]+/[[:space:]]' /etc/fstab; then

The right 70-persistent-net.rules is inside the initramfs image:

oper@watt:~$ zcat /boot/initrd.img-2.6.32-5-amd64 | cpio -i --to-stdout lib/udev/rules.d/70-persistent-net.rules
# lindi: ethernet port #1 (BIOS boots using this)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:36:c0:d2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x10ec (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:a1:d7:83", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x8086:0x10ec (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:a1:d7:82", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

# PCI device 0x8086:0x10c9 (igb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:36:c0:d3", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
53853 blocks




Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#627883; Package udev. (Fri, 27 May 2011 01:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to md@Linux.IT (Marco d'Itri):
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Fri, 27 May 2011 01:33:03 GMT) Full text and rfc822 format available.

Message #24 received at 627883@bugs.debian.org (full text, mbox):

From: md@Linux.IT (Marco d'Itri)
To: Timo Juhani Lindfors <timo.lindfors@iki.fi>, 627883@bugs.debian.org
Subject: Re: Bug#627883: initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?
Date: Fri, 27 May 2011 03:29:39 +0200
[Message part 1 (text/plain, inline)]
Please report the output of "ip link".

-- 
ciao,
Marco
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Marco d'Itri <md@linux.it>:
Bug#627883; Package udev. (Fri, 27 May 2011 09:12:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timo Juhani Lindfors <timo.lindfors@iki.fi>:
Extra info received and forwarded to list. Copy sent to Marco d'Itri <md@linux.it>. (Fri, 27 May 2011 09:12:11 GMT) Full text and rfc822 format available.

Message #29 received at 627883@bugs.debian.org (full text, mbox):

From: Timo Juhani Lindfors <timo.lindfors@iki.fi>
To: md@Linux.IT (Marco d'Itri)
Cc: 627883@bugs.debian.org
Subject: Re: Bug#627883: initramfs-tools: uses wrong NIC for DHCP, persistent-net invents "eth1-eth0"?
Date: Fri, 27 May 2011 12:08:34 +0300
md@Linux.IT (Marco d'Itri) writes:
> Please report the output of "ip link".

At what time? When I'm in the beginning of do_nfsmount?

When I workaround the problem by using "net0" instead of "eth0" I see

oper@watt:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:1b:21:a1:d7:83 brd ff:ff:ff:ff:ff:ff
3: net0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:25:90:36:c0:d2 brd ff:ff:ff:ff:ff:ff
4: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:1b:21:a1:d7:82 brd ff:ff:ff:ff:ff:ff
5: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 00:25:90:36:c0:d3 brd ff:ff:ff:ff:ff:ff

when the system is fully booted up.




Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 05:59:17 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.