Today our custom Linux wasn’t being loaded from PXE as usual, instead, we were stuck at “initramfs”.

Current Scenario:

  • Loading Linux Lubuntu 16_04 via PXE
  • Hardware: ThinClient HP-T630
  • No local disks where used in the process, the whole O.S is loaded in RAM.
  • Turning on the machine will Load Kernel > Call Initramfs > get stuck in initramfs prompt.

There I was able to take a look on dmesg where I couldn’t find anything useful. Later I’ve checked the ethernet configuration (some network cards may interfere with the boot loading process) so I took a look on /run/<ETH>.conf. In my case it was “net-enp1s0.conf”:

Also after executing ip addr I saw the same information, I did a ping from another machine and it worked, so the network card wasn’t my problem.

Checking the mounted file systems everything seemed right, I’ve executed mount to check them:

/dev/sdb2 was a pendrive I’ve prevously connected and mounted in /tmp/test to export the files and read them in other computer with vim, forget about vi, less or tail which are not included in the initramfs binaries. The pendrive must be connected before starting the computer.

Running out of ideas I’ve tried executing sh init just to see that it didn’t provide any output and just hanged there, but that was a clue.

Writing exit after being dropped in (initramfs) triggered a kernel panic:

Usually when mount problems are present, executing “exit” will show us the errors to resolve in order to continue. In this case the kernel panic wasn’t something good.

So I’ve started disabling the new features of the HP-T630 in the BIOS such as: fast boot, ACPI modes, and those ones that could have any conflict with the kernel). No luck.

Next step was passing parameters to the kernel:

Parameters:

  • nomodeset: The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesnt work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded. (this one solved my problem of being stuck at initramfs).
  • ipv6.disable=1 I do not require IPV6
  • net.ifnames=0 This one was required because an startup script had “eth0” hardcoded and the network card was being recognized as enp1s0.

Finally after fixing a custom splashscreen using (fbi – Linux framebuffer image viewer) which was throwing this error:

because I didn’t enable the kernel parameter vga=791 I was able to boot Linux correctly.