# genkernel all killed eth0

## auddoula

Hi,

i am a novice in administering a Gentoo machine... I nearly had a workable workstation. however, I was having problem with my NVIDIA card, to resolve it I followed one of the many forum topics wherein i used:

1.genkernel all

2. emerge nvidia-drivers

It fixed the graphics problem but my network card eth0 disappeared.

'Ifconfig' results in only :

lo

/etc/init.d/net.eth0 start gives me an error that 'network interface eth0 does not exist'.

Oddly enough I could not locate grub.conf or menu.lst files anywhere and when I look at :

1. ls /boot

there is nothing in there but once I:

> mount /dev/sda1 /boot

I get all the necessary 'grub' stuff.

I am quite a bit of novice so any advice you may have, has to be on an elementary level. Posting long outputs from the machine will be difficult since i do not have the network working.. Thanks in advance for help,

----------

## bunder

Moved from Networking & Security to Kernel & Hardware.

genkernel probably removed the network stuff... try compiling the kernel by hand?

cheers

----------

## auddoula

 *bunder wrote:*   

> Moved from Networking & Security to Kernel & Hardware.
> 
> genkernel probably removed the network stuff... try compiling the kernel by hand?
> 
> cheers

 

I did try, but then i got 'Kernel panic''.... I think main problem now is that tg3 module cannot be loaded.

----------

## SeaTiger

Since you have kernel panic now, the first thing to do is to have your machine back to bootable stage, even that means without network capability. As not sure what cause the kernel panic, I will leave that part to you, or till more info is provided.

As for the network part, it is possible that the udev layer may has added additional nic entries as you update/change the network card driver in kernel.

You can test that by doing the following:

```
ifconfig ethX up
```

Where the 'X' in ethX start from 0, 1, 2, 3, ... etc. I used to have a linux drive got moved around multiple machines and accumulated like 7 nic entries in the udev config files. And if you do:

```
cat /etc/udev/rules.d/70-persistent-net.rules
```

 You will properly see multiple entries in it. It is easy to rectify that by:

```
rm /etc/udev/rules.d/70-persistent-net.rules
```

Then reboot your machine. udev will just recreate that file and put your nic as eth0.

----------

## auddoula

 *junksiu wrote:*   

> Since you have kernel panic now, the first thing to do is to have your machine back to bootable stage, even that means without network capability. As not sure what cause the kernel panic, I will leave that part to you, or till more info is provided.
> 
> As for the network part, it is possible that the udev layer may has added additional nic entries as you update/change the network card driver in kernel.
> 
> You can test that by doing the following:
> ...

 

Thanks, I restarted using the previous kernel after deleting /etc/udev/rules.d/70-persistent-net.rules. During the startup module tg3 fails to load (I have Broadcom NIC that requires tg3) and again ehtX fails to load. Ifconfig produces only lo. I checked /etc/udev/rules.d/70-persistent-net.rules file compared to the one I deleted, they are identical.  Here is the line:

SUBSYSTEM=="net", ACTION=="add",DRIVERS==?*", ATTR{address}=="somenumbers", KERNEL=="eth*", NAME="eth0"

----------

## SeaTiger

I did use a few board come with Broadcom card and the tg3 did work. BTW, can you post the comment right above the SUBSYSTEM line, it actaully tells which drive it is trying to use.

Do you have lspci and lshw? Can you post output from them?

Also double check that the network card is activated in the bios(I am assuming it is an on board nic).

----------

## auddoula

 *junksiu wrote:*   

> I did use a few board come with Broadcom card and the tg3 did work. BTW, can you post the comment right above the SUBSYSTEM line, it actaully tells which drive it is trying to use.
> 
> Do you have lspci and lshw? Can you post output from them?
> 
> Also double check that the network card is activated in the bios(I am assuming it is an on board nic).

 

I do hahev lspci and lshw, but I will have to type in everything since my network does not work (unless there is another easy way of doing it i don't know about...)

The line above subsystem was:

PCI device 0x14e4:0x1659 (tg3)

Note that tg3 could not be loaded at the startup. I did try to recompile the kernel manually, but I must have been doing something terribly wrong since I am getting the kernel panic. if you know a forum/site that tells you step-by-step way of recompiling a kernel, i can give it a shot.

From lspci, I get:

Ethernet Controller Broadcom Corp NetXtreme BCM5721 Gigabit Ethernet PCI Express

From lshw:

*network UNCLAIMED

..

capabilities: bus_master cap_list

configuration: latency=0

----------

## jburns

You can configure the kernel using genkernel if you use the --menuconfig option

```
genkernel --menuconfig all
```

Do a man genkernel to see what options are available.

----------

## auddoula

 *jburns wrote:*   

> You can configure the kernel using genkernel if you use the --menuconfig option
> 
> ```
> genkernel --menuconfig all
> ```
> ...

 

Thanks, I tried this, I included Broadcom TG3 support but then when I reboot I get an error message that /dev/sda3 which is my root partition is not a valid root device. This is what I had in my /boot/grub/grub.conf:

root (hd0,0)  [valid range is hd0 hd1 hd2 and hd3; for the second digit it is 0,1 2 where 0 and 2 are ext2fs type 0x83]

kernel /boot/kernel/kernel-genkernel-x86_64-2.6.24-gentoo-r4 root=dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev

initrd /boot/initramfs-kernel-genkernel-x86_64-2.6.24-gentoo-r4 

when I press the tab in real_root, I get an error that it is an unrecognized device string.

My /etc/fstab says:

/dev/sda1 /boot ext2 noauto,noatime 1 2

/dev/sda3 / ext3 noatime 0 0

/dev/sda2 none swap sw 0 0

/dev/cdrom /mnt/cdrom auto noauto,ro  0 0

----------

## jburns

The most likely cause of "root partition is not a valid root device" is that the kernel is not using the correct driver for the disk.  This could be because the correct driver was not built or that it selected a different driver to use.  If CONFIG_IDE is set in the kernel configuration the kernel may be using the IDE drivers instead of the SATA and PATA drivers.  This would result in the kernel using /dev/hdxx instead of /dev/sdxx.

When you get the error message that /dev/sda3 is not a valid root device you should be able to enter the command "shell" to get to a command shell where you can check which devices are configured.

----------

## auddoula

 *jburns wrote:*   

> The most likely cause of "root partition is not a valid root device" is that the kernel is not using the correct driver for the disk.  This could be because the correct driver was not built or that it selected a different driver to use.  If CONFIG_IDE is set in the kernel configuration the kernel may be using the IDE drivers instead of the SATA and PATA drivers.  This would result in the kernel using /dev/hdxx instead of /dev/sdxx.
> 
> When you get the error message that /dev/sda3 is not a valid root device you should be able to enter the command "shell" to get to a command shell where you can check which devices are configured.

 

You are probably right. Now, how do I fix it? 

---

I went back to 'genkernel --menuconfig all'. Now I see an option Serial ATA and PArallel ATA (Experimental) drivers..

there are a number of options. i am not sure which one I should choose.

----------

## jburns

Adding doscsi to the end of the kernel line in grub.conf may fix the problem.

```
kernel /boot/kernel/kernel-genkernel-x86_64-2.6.24-gentoo-r4 root=dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev doscsi
```

----------

## auddoula

 *jburns wrote:*   

> Adding doscsi to the end of the kernel line in grub.conf may fix the problem.
> 
> ```
> kernel /boot/kernel/kernel-genkernel-x86_64-2.6.24-gentoo-r4 root=dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 udev doscsi
> ```
> ...

 

I tried addding doscsi but tit did not help. i am in the 'shell' now. when i ls /dev i do not see any of the sda's. there is one 'hda' though

----------

## auddoula

I think you are right about SATA drivers not being loaded... I see that Uniform Multi-Platform E-IDE driver 7.00alpha2 is laoded. Good news is that tg3, Tigon3 is loaded and eth0 is recognized.

it chokes after activating 'mdev'

it says 'Determining root device..':

Block device  /dev/sda3 not a valid rot device..

--------

OK, thanks for the help.. I recompiled the kernel with 'Generic SATA and PATA' support, and added doscsi to the kernel line. Now. my network works just fine.

Let us consider this topic SOLVED.

----------

