Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Here's the situation: I had a working network setup on my Debian box, with two Ethernet interfaces being reported by ifconfig - eth0, and eth1. eth0 is an onboard Realtek NIC, and eth1 is a D-Link PCI NIC. Sound, however, was not working on the system.

Following the advice on this page, I went to Realtek's website and downloaded the "LINUX driver for kernel 3.x and 2.6.x and 2.4.x". I unzipped it, and after installing the necessary build and Linux header packages, I ran r8168-8.037.00/autorun.sh as root. Upon review, I made a big mistake here. I clicked on "Realtek PCIe GBE Family Controller Series Drivers" rather than "HD Audio Codec Driver", so I installed their networking driver instead of their audio driver. Oops. In any case, I am now looking for a way to undo this mess.

No error messages seemed to be output, but sound was still not working, so I rebooted the machine. When it came up again, ifconfig -a now only shows me the eth0 interface and not eth1. Also, find /sys/devices/ -type d | grep eth only returns me eth0 devices, and no eth1 devices. Nor does dmesg | grep eth1 give any output. Somehow the new Realtek drivers have prevented eth1 from being detected! Sound still isn't working, by the way.

How is this happening and how can I fix it? I guess I'll have to live without sound but I want to get back my working eth0 and eth1 configuration. How can I get Linux detecting eth1 again?

It looks like it may have installed some stuff into /lib/modules/3.2.0-4-amd64/kernel/drivers/net/ethernet/realtek, if that helps. For example, the r8168.ko file is in both the src directory of the drivers I unzipped, and in that /lib... directory.

share|improve this question
    
You downloaded the wrong driver. The page you should have gone to is probably this one: realtek.com.tw/downloads/… Although there is also realtek.com.tw/downloads/… However, I think you might want to debug the "no sound" issue a little first, just to make sure it is really a driver problem. –  goldilocks Oct 27 '13 at 12:50
    
As I told you before, I'll deal with the sound later. First I want to fix my networking!!! –  Jez Oct 27 '13 at 12:54

2 Answers 2

Somehow the new Realtek drivers have prevented eth1 from being detected!

Kind of a shame, since obviously the in-tree kernel drivers were working in the first place. Why did you install new ones?

If the interface shows up with ifconfig, then the kernel has a driver loaded for the nic. This does not necessarily mean the driver will work perfectly for whatever you are planning to do with it, but in 99%+ of cases, it will. Realtek ethernet chips are common and the kernel has plenty of support for them.

It may seem like "the best" driver to use would be a driver from the manufacturer, but I think this is in fact usually not true. The problem is that manufacturers have little or nothing invested in linux drivers -- both in terms of how much it matters to them (very little, since linux has an insignificant market share) and, consequently, how much resources they will dedicate to it. Further:

  • Because they are not part of the official kernel tree, there is no direct involvement with the actual kernel devs. Meaning, almost any clown could have done it. They are outside of the normal vetting and peer review, etc.

  • Because they are closed source, no one can look at the code and say, "This is wrong", etc. So whatever mistakes are there are hidden from view. If there is some problem and the manufacturer can't be bothered to pay someone to maintain the driver properly, no one else can step up to the plate because the plate is out-of-bounds.

In short, there's no oversight of the product and no commitment from the people providing it. The linux devs are pretty explicit about this: The best driver to use is the official in-tree driver, NOT a proprietary one. Only if the kernel's own driver does not work should you start looking elsewhere.

share|improve this answer
    
I know, and the whole reason I was installing this was to try and get the sound working. Looking at the page now it appears I downloaded and installed the wrong driver actually; I went for "Realtek PCIe GBE Family Controller Series Drivers" instead of "HD Audio Codec Driver". Oops. –  Jez Oct 27 '13 at 12:40
    
Okay, that's actually not very clear in your question. You refer to the sound, but the context implies you are referring a NIC driver (which you were). I don't think Realtek bundles those (look under Computer Peripheral ICs here: realtek.com.tw/downloads Why do you believe they are bundled? –  goldilocks Oct 27 '13 at 12:46
    
I don't anymore, as I just realized there is a separate link for their audio driver. So this question becomes, "how do I get the default Debian driver back again?" –  Jez Oct 27 '13 at 12:47
    
What, you mean they don't have a nice "uninstall" option, lol? The old driver is probably still there; but the realtek installer may have done something to give their's precedence by loading it at boot. You have to figure out which is which and change that -- actually ask the question as a question, it's a good one. –  goldilocks Oct 27 '13 at 12:54
1  
A look at autorun.sh shows the only driver installed is rtl8169.ko, and your old driver is now calle drtl8169.bak. Exchange the two, reboot, and you should be back at square one. –  MariusMatutiae Oct 27 '13 at 16:22

OK I managed to fix it, but it was a real PITA (Linux desperately needs a more mature driver installation system with a built-in rollback IMHO). Here's how:

cd /lib/modules/3.2.0-4-amd64/kernel/drivers/net/ethernet/realtek/

This directory had r8169.bak and r8168.ko. If Realtek's installer had just deleted r8169 instead of backing it up, I'd have been screwed.

/sbin/rmmod r8168
ifconfig -a

Both eth0 and eth1 had now disappeared.

mv r8168.ko r8168.bak
mv r8169.bak r8169.ko
/sbin/depmod `uname -r`
/sbin/modprobe r8169
ifconfig -a

eth0 and eth1 are back, and working.

So in conclusion; driver installation and upgrading in Linux sucks. Better hope your installer is good enough to back up your previous drivers because Linux basically says "do what the heck you want to install your new drivers". There should be some service that gets called to install the drivers whereby Linux keeps a track of previous versions so they can be rolled back.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.