Ubuntu drops to shell on 16.04 kernel

5,135

Solution 1

I have a recently installed 16.04 Ubuntu Server with root on an encrypted lvm. It booted fine with Kernel 4.4.0-34, but with 4.4.0-36 i got the same problem. Repeating messages about lvmetad and then dropping to shell. As a workaround i declared 4.4.0-34 the default boot option and turned off automatic updates. So installing 4.4.0-34 might help you get a working 4.4 kernel. I have not found a long term solution yet.

Solution 2

  • Change the grub.cfg "root=/dev/mapper/ubuntu--vg-root" to "root=UUID=XXXX"
  • Added "vgchange -a y" to somewhere before mountroot

Basically the root cause is "/dev/mapper/ubuntu--vg-root" is not fully ready when the root got checked. In some way, vgchange command could trigger the lvm updated and shows in /dev/mapper. Suggested use "UUID" instead of using dev mapper name to make it more general.

Share:
5,135

Related videos on Youtube

Warner
Author by

Warner

Updated on September 18, 2022

Comments

  • Warner
    Warner over 1 year

    I've been struggling with an issue for hours:

    After upgrading Ubuntu, first from 15.04 to 15.10 and then from 15.10 to 16.04, I'm unable to boot with the new Kernel. After the second upgrade I'm left with Kernels 4.4.0-36 and 3.16.0-33 (no trace of any 4.2.x). This makes me think that I upgraded from 15.10 to 16.04 while still running 3.16.0-33. This may be the cause of my issues.

    On boot (4.4.0-36), I get: "ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!"

    Booting with 3.16.0-33 works just fine.

    What I've tried:

    • reinstalled the Kernel (4.4.0-36). No change.
    • In busybox I've tried to enter "vgchange -ay" but I don't manage: my keyboard does not work in busybox.
    • installed 4.4.0-38. Same result.
    • attempting to follow instructions in http://pifuge.com/ubuntu/V0Wn-cant-find-lvm-root-dropped-back-to-initramfs however, the file /usr/share/initramfs-tools/scripts/local-top/lvm2 does not contain any "modprobe -q" after which I can add anything.

    Any help would be greatly appreciated!

    Warner

    Some more detail:

    • Running LVM2. It is (obviously) installed.
    • No multiboot. Just Ubuntu.
    • No encryption (as far as I know)
    • Busybox does not respond to inputs, strangely. This is the same regardless of how I boot (unless I run 3.16.0-33, then the system boots fine)
    • It tries to mount the root directory about 20 times before dropping to shell (busybox). Here's the output it gives:

    Begin: Running root file system ... Begin: Running /scripts/local-top ... lvmetad is not active yet, using direct activation during sysinit Failed to find logical volume "ubuntu-vg/root" done. Begin: Running /scripts/local-premount ... done Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... lvmetad is not active yet, using direct activation during sysinit Failed to find logical volume "ubuntu-vg/root" done.

    (this last one repeats 20 times)

    Gave up waiting for root device. Common problems: Boot args (cat /proc/cmdline) Check rootdelays (did the system wait long enough?) Check root= (did the system wait for the wrong device?) Missing moduels (cat /proc/modules: ls /dev) "ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!"

    • Warner
      Warner over 7 years
      So I managed to activate the LVM (by adding "lvm vgchange -ay" just before "activate_vg "$ROOT" in the /usr/share/initramfs-tools/scripts/local-top/lvm2 file...) Now I have a whole set of new problems: 1. The system boots to the login screen, but the keyboard and mouse (usb) are not working; 2. The network is not connecting With the old (15.04) kernel everything is perfectly fine. With the new one, nothing but problems. Should I re-generate it somehow to take the right configurations?
  • Dmitry Grigoryev
    Dmitry Grigoryev over 7 years
    This answer could use a little explanation.
  • EmilyC
    EmilyC over 7 years
    Basically the root cause is "/dev/mapper/ubuntu--vg-root" is not fully ready when the root got checked. In some way, vgchange command could trigger the lvm updated and shows in /dev/mapper. Suggested use "UUID" instead of using dev mapper name to make it more general.
  • Dmitry Grigoryev
    Dmitry Grigoryev over 7 years
    Thanks. I don't have the rep to edit your answer for you, but you should really consider including the explanation in the answer.
  • EmilyC
    EmilyC over 7 years
    True, Dmitry. Met the similar issue yesterday, was busy in fixing it, excited to share the fix, so that did not get enough time to put details. hope it helps