Why am I getting the error "you need to load the kernel first"?
I booted my Linode from the command line and now it won't come back up. It keeps displaying the error message
Loading Linux 4.9.0-9-amd64 ...
error: attempt to read or write outside of diskhd0'.
Loading initial ramdisk …
error: you need to load the kernel first.
Press any key to continue…
But then nothing happens. What am I doing wrong?
It may be that your Grub configuration mentioned one of your Linode's disks by a unique identifier. This could prevent it from booting up normally, if one of those disk identifiers has been altered. We recommend against issuing reboots from the command line, in a virtualized environment the Linode cannot reboot itself internally. So rather than booting gracefully it will just die and then the Watchdog will bring it back up. This can lead to system instability such as you are experiencing.
From here, I'd recommend either booting with one of our stock kernels temporarily to double check or edit the Grub configuration, or booting into Rescue Mode so that you can edit the Grub configuration from there. If you want to change to the latest 64 bit Linode kernel you can do so by following these instructions and selecting "Latest 64 bit" from the dropdown menu. If you want to use Rescue Mode, you can do so by following these directions.
Once you are in either of those modes I would recommend checking your
/etc/fstab file to make sure all your disks are present and properly labeled. You could also take a look at the
/boot/grub directory and verify that settings there look correct. I would strongly recommend making sure your Linode is backed up before you make any changes to the files in that directory.
We recommend against issuing reboots from the command line, in a virtualized environment the Linode cannot reboot itself internally.
I wasn't aware of this, and this is exactly what I did. I'll use the console for reboots from now on.
I'd recommend either booting with one of our stock kernels
Switching to the latest 64 bit kernel fixed the problem. Two quick questions:
- Since it's working, should I go ahead and leave it set to the latest kernel?
- Should I set all my Linodes to use the latest 64 bit kernel?
Thank you for the helpful information!
@hdb2 If Linode's latest kernel is working for you, it's fine to stay on that kernel. Likewise, if the rest of your Linodes are on GRUB 2 and performing without issue, you might as well leave them as they are unless you have a reason to switch.
The upstream kernel may support features not present in the Linode kernel (for example, SELinux). The upstream kernel is easily installed and updated from your distribution’s package management system.
The Linode kernel is quick to update and does not require you to enter any terminal commands: if you’re using the Linode kernel marked as latest, then you just need to reboot in order to update it.
First, a big difference between our kernel vs. what you might find on a distribution like Debian/Ubuntu is that our kernels are very vanilla - we apply very few patches to the upstream source code (usually none).
Another big difference is that Linode kernels do not use kernel modules like what you find on most distros. Instead, support for all of our (virtualized) hardware and features is built directly into the kernel itself. This means that we don't need to install any additional files onto your Linode in order to use our kernel, and results in a smaller kernel overall.
This of course also means that you can only use features of the kernel that we've explicitly built in, whereas on distribution-supplied kernels you can load kernel modules on the fly to extend its functionality. We try to account for all of our customers' use-cases when building our kernels, but occasionally we miss things and we encourage customers to let us know if there's something they'd like us to include in our kernels. We can build and deploy new kernels pretty quickly, so ultimately I think the trade-off is worth it.
Lastly, if you are interested to see what our kernel configuration looks like, you can run
zcat /proc/config.gzon any Linode running one of our kernels. This will print all of the options that the kernel was built with.
Hope this helps!