0

The short story is this (as I understand it): I can't boot ubuntu over LAN (PXE boot) with the help of initramfs without compiling my own kernel. As I see, the problem is this: network interface device is not started at all.

So here's the long story. I have two identical servers. One is master with HDD and the other is the diskless node. I want the node to boot from network with root fs taken from NFS. I set everything up (dhcp, tftpd-hpa, nfs-kernel-server). I made an /nfsroot. After this I compiled a custom kernel and - here is the first important step - I booted ubuntu without the help of initrd.img. It's fine, root fs was taken from the master. But then - and here is the next important step - I want to do the same boot but without compiling a custom kernel. I want to do it with the help of initrd.img.

So I made the following steps:

  1. I changed BOOT=nfs and MODULES=netboot in /etc/initramfs-tools/initramfs.conf
  2. run mkinitramfs -o ~/initrd.img-uname -r``
  3. copied the generated initrd image to my /tftproot
  4. changed KERNEL=<my bundled kernel> and added initrd=... to the cmdline in /tftproot/pxelinux.cfg/default

After this I power up the node and... get a kernel panic. Here is the panic:

[   18.415714] Freeing unused kernel memory: 824K (ffff880001732000 - ffff880001800000)
[   18.424996] Freeing unused kernel memory: 700K (ffff880001b51000 - ffff880001c00000)
Loading, please wait...
[   18.446709] systemd-udevd[340]: starting version 204
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/nfs-top ... done.
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
ipconfig: no devices to configure
/init: .: line 252: can't open '/run/net-*.conf'
[   18.604039] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[   18.604039] 
[   18.613180] CPU: 0 PID: 1 Comm: init Not tainted 3.13.0-30-generic #54-Ubuntu
[   18.620323] Hardware name: Supermicro X9DRFF-iG+/-7G+/-iTG+/-7TG+/X9DRFF-iG+/-7G+/-iTG+/-7TG+, BIOS 3.0 07/29/2013
[   18.630668]  ffff8817f8748000 ffff8817fb1d7e48 ffffffff8171a324 ffffffff81a4dcc0
[   18.638135]  ffff8817fb1d7ec0 ffffffff81713525 ffffffff00000010 ffff8817fb1d7ed0
[   18.645599]  ffff8817fb1d7e70 ffffffff81f229e0 0000000000000200 ffff8817fb1d8398
[   18.653070] Call Trace:
[   18.655539]  [<ffffffff8171a324>] dump_stack+0x45/0x56
[   18.660696]  [<ffffffff81713525>] panic+0xc8/0x1d7
[   18.665498]  [<ffffffff8106a391>] do_exit+0xa41/0xa50
[   18.670554]  [<ffffffff8109dd94>] ? vtime_account_user+0x54/0x60
[   18.676562]  [<ffffffff8106a41f>] do_group_exit+0x3f/0xa0
[   18.681954]  [<ffffffff8106a494>] SyS_exit_group+0x14/0x20
[   18.687458]  [<ffffffff8172aeff>] tracesys+0xe1/0xe6
[   18.695229] ------------[ cut here ]------------
[   18.699859] WARNING: CPU: 0 PID: 1 at /build/buildd/linux-3.13.0/arch/x86/kernel/smp.c:124 native_smp_send_reschedule+0x5d/0x60()
[   18.711494] Modules linked in:
[   18.714572] CPU: 0 PID: 1 Comm: init Not tainted 3.13.0-30-generic #54-Ubuntu
[   18.721707] Hardware name: Supermicro X9DRFF-iG+/-7G+/-iTG+/-7TG+/X9DRFF-iG+/-7G+/-iTG+/-7TG+, BIOS 3.0 07/29/2013
[   18.732044]  0000000000000009 ffff88181fc03d90 ffffffff8171a324 0000000000000000
[   18.739500]  ffff88181fc03dc8 ffffffff810676bd 0000000000000001 ffff88181fc14440
[   18.746956]  00000000fffeec2c 0000000000000000 ffff88181fc34440 ffff88181fc03dd8
[   18.754421] Call Trace:
[   18.756883]  <IRQ>  [<ffffffff8171a324>] dump_stack+0x45/0x56
[   18.762675]  [<ffffffff810676bd>] warn_slowpath_common+0x7d/0xa0
[   18.768676]  [<ffffffff8106779a>] warn_slowpath_null+0x1a/0x20
[   18.774512]  [<ffffffff8104022d>] native_smp_send_reschedule+0x5d/0x60
[   18.781041]  [<ffffffff810a800a>] trigger_load_balance+0x16a/0x1e0
[   18.787232]  [<ffffffff810992c4>] scheduler_tick+0xa4/0xf0
[   18.792737]  [<ffffffff81076230>] update_process_times+0x60/0x70
[   18.798753]  [<ffffffff810d5bf5>] tick_sched_handle.isra.17+0x25/0x60
[   18.805188]  [<ffffffff810d5c71>] tick_sched_timer+0x41/0x60
[   18.810874]  [<ffffffff8108e547>] __run_hrtimer+0x77/0x1d0
[   18.816362]  [<ffffffff810d5c30>] ? tick_sched_handle.isra.17+0x60/0x60
[   18.822980]  [<ffffffff8108ed4f>] hrtimer_interrupt+0xef/0x230
[   18.828821]  [<ffffffff81043077>] local_apic_timer_interrupt+0x37/0x60
[   18.835360]  [<ffffffff8172d0bf>] smp_apic_timer_interrupt+0x3f/0x60
[   18.841715]  [<ffffffff8172ba5d>] apic_timer_interrupt+0x6d/0x80
[   18.847722]  <EOI>  [<ffffffff810b0bd2>] ? up+0x32/0x50
[   18.852981]  [<ffffffff817135f0>] ? panic+0x193/0x1d7
[   18.858036]  [<ffffffff8171355a>] ? panic+0xfd/0x1d7
[   18.863004]  [<ffffffff8106a391>] do_exit+0xa41/0xa50
[   18.868059]  [<ffffffff8109dd94>] ? vtime_account_user+0x54/0x60
[   18.874065]  [<ffffffff8106a41f>] do_group_exit+0x3f/0xa0
[   18.879459]  [<ffffffff8106a494>] SyS_exit_group+0x14/0x20
[   18.884947]  [<ffffffff8172aeff>] tracesys+0xe1/0xe6
[   18.889906] ---[ end trace 614851f5bf760874 ]---

I also tried to do the following. Since the machines are identical I took the output of lsmod on the master and added all modules to /etc/initramfs-tools/modules and changed to MODULES=list. After this mkinitramfs -o ~/initrd.img-uname -r`` and copy it to /tftproot. And the result is the same. The same kernel panic.

I also tried to netboot a virtualbox vm. It still gives me this kernel panic.

So my question is.. What is wrong?? My steps seem to me to be THE steps to make a netbootable node without compiling my own kernel.

Some additional info.

  1. LUbuntu 14.04
  2. Network interface is Intel i350 (the driver for it is igb)
  3. /tftproot/pxelinux.cfg/default https://dl.dropboxusercontent.com/u/8057759/netboot/default
  4. .config which I used to build my custom kernel which booted without initrd https://dl.dropboxusercontent.com/u/8057759/netboot/.config
  5. The current bundled /boot/config-3.13.0-24-generic (if it can help anyhow) https://dl.dropboxusercontent.com/u/8057759/netboot/config-3.13.0-24-generic
  6. The log with the kernel panic. You can see it at the very bottom. As you see there is no any mention of igb OR eth0 https://dl.dropboxusercontent.com/u/8057759/netboot/console.txt

Thank you.

0

2 Answers 2

1

1) The kernel panic is caused because the init script fails when trying to find a net device for dhcp.

2) You do not have to compile your own kernel for PXE boot/install Ubuntu/Lubuntu; things are much simpler;

Please see the parameters used by Serva when PXE booting/installing Lubuntu (I'm related to Serva development)

[PXESERVA_MENU_ENTRY]
asset    = Lubuntu 14.04 Desktop Live
platform = amd64
kernel   = NWA_PXE/$HEAD_DIR$/casper/vmlinuz
append   = showmounts toram root=/dev/cifs initrd=NWA_PXE/$HEAD_DIR$/casper/initrd.lz,NWA_PXE/$HEAD_DIR$/casper/INITRD_N11.GZ boot=casper netboot=cifs nfsroot=//$IP_BSRV$/NWA_PXE_SHARE/$HEAD_DIR$ NFSOPTS=-ouser=serva,pass=avres,ro ip=bootp ro

In this case Serva uses CIFS instead of NFS but you can easily change the corresponding append parameters. You will also see some other directory and IP parameters that point to Serva repository that must be edited accordingly to your needs. See that you need to download a tiny complementary initrd INITRD_N11.GZ freely available from Serva's site.

Of-course you do not need to use Serva for booting your client; you can use Serva parameters with your own PXE server. Even if your are not going to use Serva you should probably use it in order to fine tune your parameters; once you got a working set then you can move to whatever PXE server you might want to use.

1
  • I actually studied all the links that you wrote. I even understood what your patch was for the CIFS root. I'm sorry for such a late answer. The problem was actually very simple and stupid. Please, see my answer here. Thanks for the hints anyway.
    – Grigory
    Jul 19, 2014 at 18:33
0

I've made it. The problem turned out to be very simple. I gave to PXE client a 3.13.0-30 kernel. But I was running mkinitramfs on a machine with a 3.13.0-24 kernel.

I started to give a PXE client the 3.13.0-24 kernel and it worked.

Not the answer you're looking for? Browse other questions tagged .