How to boot linux kernel without bootloader?

Rebooting after installing a new kernel takes me to busybox shell (initramfs). What am I doing wrong?

  • I have a virtual machine with Ubuntu 14.04 in it. I recently built and installed linux-3.14.5 kernel on it, and tried to boot into it, but it drops me to BusyBox v1.21.1 built-in shell. Here's what I did:       wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz            mkdir ~/linux       mv linux-3.14.5.tar.xz ~/linux       tar -xJf linux-3.14.5.tar.xz       mkdir linux-3.14.5       cd linux-3.14.5_src/       make defconfig O=../linux-3.14.5       make menuconfig O=../linux-3.14.5  /* i didn't change anything */       make O=../linux-3.14.5       cd ../linux-3.14.5       sudo make install I could see a file called initrd.img-3.14.5 in /boot alongside the intrd.img-3.13.0-24-generic (which i guess, is the kernel of Ubuntu 14.04). There were also 2 files called vmlinuz-3.14.5 and vmlinuz-3.13.0-24-generic. After that, ran     sudo blkid and got the following:       /dev/sda1: UUID="92ec153c-cb92-4300-8d2a-f63b747ddd35" TYPE="ext4"       /dev/sda5: UUID="439a6423-28dc-4363-b47e-580f1e65e951" TYPE="swap" I also ran     sudo fdisk -l which gave me      Disk /dev/sda: 21.5 GB, 21474836480 bytes      255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors      Units = sectors of 1 * 512 = 512 bytes      Sector size (logical/physical): 512 bytes / 512 bytes      I/O size (minimum/optimal): 512 bytes / 512 bytes      Disk identifier: 0x000268be          Device Boot      Start         End      Blocks   Id  System       /dev/sda1   *        2048    39845887    19921920   83  Linux     /dev/sda2        39847934    41940991     1046529    5  Extended     /dev/sda5        39847936    41940991     1046528   82  Linux swap / Solaris I checked the /boot/grub/grub.cfg file which had the following entry:     menuentry 'Ubuntu, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-92ec153c-cb92-4300-8d2a-f63b747ddd35' {              recordfail              load_video              gfxmode $linux_gfx_mode              insmod gzio              insmod part_msdos              insmod ext2              set root='hd0,msdos1'              if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35              else                search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35              fi              echo    'Loading Linux 3.13.0-24-generic ...'              linux   /boot/vmlinuz-3.13.0-24-generic root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet              echo    'Loading initial ramdisk ...'              initrd  /boot/initrd.img-3.13.0-24-generic     } So, I went ahead and added the following lines to /etc/grub.d/40_custom ( i just changed lines 1, 14, 15 and 17)     menuentry 'MyNewKernel' {          recordfail          load_video          insmod gzio          insmod part_msdos          insmod ext2          set root='hd0,msdos1'          if [ x$feature_platform_search_hint = xy ]; then            search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35          else            search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35          fi          echo    'Loading My New Kernel ...'          linux   /boot/vmlinuz-3.14.5 root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US          echo    'Loading initial ramdisk ...'          initrd  /boot/initrd.img-3.14.5 } and ran      sudo update-grub      sudo reboot Did not work! The error message said     ALERT! /dev/disk/by-uuid/92ec153c-cb92-4300-8d2a-f63b747ddd35 does not exist.      Dropping to a shell! So I tried replacing the UUID by /dev/sda1 resulting in the following file.     menuentry 'MyNewKernel' {              recordfail              load_video              insmod gzio              insmod part_msdos              insmod ext2              set root='hd0,msdos1'              if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  /dev/sda1              else                search --no-floppy --fs-uuid --set=root /dev/sda1              fi              echo    'Loading Linux 3.13.0-24-generic ...'              linux   /boot/vmlinuz-3.14.5 root=/dev/sda1 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US              echo    'Loading initial ramdisk ...'              initrd  /boot/initrd.img-3.14.5     } That did not work either, and gave me a very similar error message.     ALERT! /dev/sda1 does not exist.     Dropping to a shell! I think I am doing some stupid mistake, but I cant figure out what, since this is my first time. I would appreciate any help. Thanks for reading through the long post. Please let me know if you need any more information.

  • Answer:

    it looks as if your kernel or initrd hasn't got a device driver in it for the hard drive. you might need to rebuild it with mkinitrd, and to ensure the driver for the hardware is included in it. note that you may have AHCI even tho' you think you've got something else.

Paul Mansfield at Quora Visit the source

Was this solution helpful to you?

Other answers

1. Don't install upstream kernel by "sudo make install". For some reason it is broken in every Ubuntu dist (at least that was my impression, having done dozens of times), and header would not correctly install. Do "make deb-pkg" instead of simple "make" to build and install the resulting deb archives. 2. Don't touch /boot/grub/grub.cfg directly. Update /etc/default/grub and make the initramfs generated automatically by "sudo update-grub". Also, if you did it the way I recommended in 1, all grub setting will be done automatically. 3. Just to add, was the virtualization enabled in the kernel config?

Sak Lee

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.