17

I have tried to update my Ubuntu version and after updating, my boot screen is displaying a kernel panic message and I'm unable to access my login screen.

enter image description here

Vijay
  • 21

3 Answers3

16

You are missing the initramfs for kernel version 4.8.0-44.

It looks like you got a kernel panic error message after updating the kernel in Ubuntu 16.04.1 to 4.8.0-44-generic. To fix it enter a text-only console and either replace 4.8.0-44-generic with the more stable default kernel version or run sudo update-initramfs -u -k 4.8.0-44-generic && sudo update-grub.

  1. After the boot stops at the black screen, open a text-only virtual console by using the keyboard shortcut Ctrl+Alt+F3

  2. At the login: prompt type your username and press Enter.

  3. At the Password: prompt type your user password and press Enter.

  4. After you have logged in in the console type:

     sudo apt remove linux-image-4.8.0-44-generic linux-image-extra-4.8.0-44-generic linux-headers-4.8.0-44-generic    
     sudo apt install linux-image-4.4.0-71-generic linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic 
     sudo reboot
    

    Alternatively you can run the following commands to update initramfs for kernel version 4.8.0-44-generic :

     sudo update-initramfs -u -k 4.8.0-44-generic
     sudo update-grub
    
  5. Immediately after the motherboard / computer manufacturer logo splash screen appears when the computer is booting, with BIOS, quickly press and hold the Shift key, which will bring up the GNU GRUB menu. (If you see the Ubuntu logo, you've missed the point where you can enter the GRUB menu.) With UEFI press (perhaps several times) the Esc key to get to the GRUB menu. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GRUB screen, and then pressing Shift is unnecessary.

  6. From the purple GRUB screen select Advanced options for Ubuntu with the ↑ and ↓ keys and press Enter.

  7. A new purple screen will appear showing a list of kernels. Select Ubuntu, with Linux 4.4.0-71-generic and press Enter.

  8. Ubuntu will load the selected kernel and proceed to the login screen as usual.

  9. Don't let Ubuntu update the kernel to the 4.8.0-44 version that caused the black screen again, or else you'll get the same black screen problem that you got before.

karel
  • 114,770
  • 1
    Remember that 16.04.2 (they weren't specific what version they installed, but it looks like .2) comes with kernel 4.8, not 4.4. It might be better to first try and boot the previous kernel from the GRUB menu and see if that works. Then I'd reinstall/update to 16.04.whatever they were trying to update to. Also, the last error message indicates a file system error. – heynnema Mar 30 '17 at 13:42
  • @heynnema The first line of the screenshot in the question says that user1900238 is using Ubuntu 16.04.1 which came with Linux kernel version 4.4, the same as the first 16.04 release. – karel Mar 30 '17 at 14:35
  • Ah, interesting... they're trying to run kernel 4.8 on 16.04.1... or trying to update to .2. It's not important, as they can't mount root due to a file system error. – heynnema Mar 30 '17 at 14:39
  • I got it working now. I went to grub options and than did update initramfs.. It even updated my kernel. Thanks guys, now it's working fine.. – user1900238 Apr 01 '17 at 13:18
  • @karel how did you determine that initramfs was missing? Inquiring minds want to know :-) – heynnema Apr 01 '17 at 13:27
  • @heynnema After your first comment, I used Google to search for additional information about the error message in the screenshot in the question: VFS: Unable to mount root fs on unknown-block(0,0) which led me to this question on Ask Ubuntu: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0). It was the 4th search result returned by Google by my search for "Ubuntu VFS: Unable to mount root fs on unknown-block(0,0)". – karel Apr 01 '17 at 14:20
  • @heynnema As a further consequence of this search I also discovered this new question on Ask Ubuntu: Why there is an update-initramfs error when removing a kernel by dpkg? which I found very helpful, however unfortunately it was closed as a duplicate. I checked it when writing this comment and noticed that it has been nominated to be reopened, so I voted to reopen it, and if jarno's answer helps you, please nominate it to be reopened too. – karel Apr 01 '17 at 14:26
  • @karel very observant! Thanks for the information. I did vote to reopen jarno's question. I learn something here every day! – heynnema Apr 01 '17 at 15:03
  • A fresh version of 16.04.2 LTS had kernel version 4.4.0 for me, so I'm not sure where you're getting 4.8 from. I upgraded to 16.04.3 and I'm still running 4.4.0. – William T Froggard Aug 03 '17 at 18:18
6

Steps:

  1. Turn off the system completely. 
  2. Turn system back on.
  3. Immediately after the System Manufacture Logo or Boot Message Press Shift to goto Grub options. Or You can force kill the system with power button and turn it back on, the Grub menu should appear.
  4. Choose Advance option For Ubuntu.
  5. A selection menu should appear with list of kernels installed on the system, take note of the version number of the latest kernel ( Usually the First one) choose the recovery option of the  old kernel (one with lower version number of the first one, normally the fourth 4th option).
  6. Another list of options should appear, choose root : Drop to to root shell option, if you set root account password enter that here else press enter.
  7. Execute the following commands:  

    mount -o remount,rw /
    mkinitramfs -o /boot/initrd.img-{kerner_version}-generic {kernel_version}-generic
    update-grub
    

    Here {Kernel_version} is the kernel version number you take note of in step 5 (The Problematic kernel, latest installed one).

Reboot the system that is it, you're all set and ready to continue your work. Hope that helps.

xealits
  • 242
  • 2
  • 12
0

You have a file system error that caused your kernel panic. Unable to mount root. It might be because you're trying to run kernel 4.8 on 16.04.1, or a failed 16.04.2 update, or it might even be a bad hard drive, or one that needs to be reinitialized... but lets try this first...

To check the file system on your Ubuntu partition...

  • boot to the GRUB menu
  • choose Advanced Options
  • choose Recovery mode (from the prior 4.4 kernel)
  • choose Root access
  • at the # prompt, type sudo fsck -f /
  • repeat the fsck command if there were errors
  • type reboot

Let me know if you can't do this, and I'll give you another method.

heynnema
  • 70,711
  • Thanks for the tip. I did go through grub mention option and logged into previous version and updated initramfs.. It even updated my kernel. Thanks, now it's working fine.. – user1900238 Apr 01 '17 at 13:19
  • @user1900238 so what did you finally end up with? What version Ubuntu? What version kernel? Please begin comments directed to me with @heynnema or I may miss them. – heynnema Apr 01 '17 at 13:29