Ethernet card problem – ‘eth2_rena’
July 18th, 2008 | by Sean |This is the sort of problem I expect that only happens to people who muck about with already working kit. Another evening spent regretting ever shutting down a running system ‘for just a few minutes while I add some hardware’.
I run a few websites on a Dell PowerEdge SC440 tower server. I must write in detail about it sometime: I love it – it’s dirt cheap, fast enough for almost anything I want to use it for, very quiet and when I put it on a power meter, I get a reading of 53W. It replaced a noisy, hot, bag of nails that would hardly run for a month without something going wrong. That previous POS was consuming 186W on the power meter, so the SC440 will probably pay for itself in a couple of years. We set up the SC440, switched it on, and then forgot it existed for 8 months – and it’s right here, between all our desks.
A new application I’m working on reminded me the SC440 existed – a rapidly growing database (adding Gigabytes a day), and several data-mining applications running concurrently on the same data. A few rough calcs tell me the cheapest way to cope with the extra load for a few months (until I know whether the project is worth investing heavily in) is to buy a couple more SC440s and connect them to the first via Gigabit ethernet.
I have terrible taste in network equipment, as I’ve mentioned before, so I decided to connect the two new SC440s direct to the original one with extra ethernet cards. So, I posted a ‘down for maintenance for a few minutes’ page on another server, mapped the HTTP port to that server, switched off the SC440 for the first time in 8 months, popped it open, admired the forethought that’s gone into adding cards, inserted the two ethernet cards, closed it all up, switched it on.
Disaster! Elation at seeing eth0, eth1 and eth2 in the startup messages soon turns to panic when the link lights won’t light on inserting the cable from the router. One of the sockets has lights, so that one gets hastily configured as the port incoming HTTP traffic is usually routed to, just to get the websites back online. A quick look at the output from ifconfig tells me that eth0, eth1 and eth2 are now eth2, eth1 and eth2_rena.
I searched for help on ‘eth2_rena’, and found the very handy ‘ip link‘ command – ifconfig was truncating the device name to 9 characters and the name of the device was ‘eth2_rename‘. I imagine the ports are enumerated first by the driver module as it loads – my cards (and the embedded adapter) are all Broadcom NetXtreme Gigabit Ethernet, so rely on the tg3 kernel module. Later in the boot sequence, udev works its magic on the adapters and renames them according to rules in (on my setup)
/etc/udev/rules.d/75-network-devices.rules
If I wasn’t still reeling from the unexpected problem, I’d have a go at removing the network card naming rules altogether (though leaving the file in place – there’s a comment that says it’ll be regenerated if the file is deleted). Since all my cards are the same, I could just put up with the order the module picks when it loads. For some reason, the naming rules attempted to rename some of the cards, based on MAC address, but I’m guessing the ‘eth2_rename’ is the result of naming eth0 to eth2 when the name eth2 is assigned to another card. My hastily concocted solution was to give them all new names:
KERNEL=="eth?", ATTR{address}=="00:1d:09:ff:ff:ff", NAME="eth_bc0"
KERNEL=="eth?", ATTR{address}=="00:10:18:ff:ff:fe", NAME="eth_bc1"
KERNEL=="eth?", ATTR{address}=="00:10:18:ff:ff:fd", NAME="eth_bc2"
I had to edit /etc/rc.d/rc.inet1.conf to update the network card names there, and /etc/rc.d/rc.inet1 for a regular expression for setting up the cards, but once this was done, it all worked like a charm. My preconceived (and ultimately silly, I realise) notion that my cards should be numbered 0, 1, 2 from the top is satisfied too!
I hope that’s useful to someone, if only to increase the number of results you get from a search when your ‘only take a second‘ job suddenly becomes indefinite!