38

today I installed Ubuntu 64-bit on a netbook. When the netbook boots this, error report appeared. I think there is a problem with the partitions.

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

BusyBox v.1.21.1 (Ubuntu 1:1.21.1-1ubuntu1) built-in shell (ash)   
Enter 'help' for list of built-in commands.  

(initramfs)

Output of lsblk as requested:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0   231G  0 part 
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0     2G  0 part [SWAP]
sr0     11:0    1   1.2G  0 rom  /cdrom
loop0    7:0    0   1.1G  1 loop /rofs
knocte
  • 1,016
  • 1
  • 12
  • 25

9 Answers9

39

In certain Ubuntu versions (e.g. Xubuntu 18.10) this issue might be caused by an apt autoremove. Due to this bug apt will suggest to remove

cryptsetup cryptsetup-bin cryptsetup-initramfs cryptsetup-run dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2

which makes the system non-bootable (because the root partiation cannot be mounted and unencrypted using LVM).

If you are not using LVM and disk encryption this answer is probably not for you.

I was able to fix it by re-installing cryptsetup and lvm2 in a chroot environment: boot from a live USB stick, run commands below in a terminal, reboot.

# find root partition
sudo fdisk -l

unencrypt partition

Note: replace /dev/nvme0n1p3 with your disk

replace "nvme0n1p3_crypt" with the correct name

check by running this in chroot:

$ cat /etc/crypttab | cut -f1 -d " "

nvme0n1p3_crypt

sudo cryptsetup luksOpen /dev/nvme0n1p3 nvme0n1p3_crypt

mount root partition

sudo vgscan sudo vgchange -ay sudo mount /dev/mapper/xubuntu--vg-root /mnt

prepare chroot environment

sudo mount /dev/nvme0n1p2 /mnt/boot/ # replace nvme0n1p2 with your boot partition! sudo mount -o rbind /dev/ /mnt/dev/ sudo mount -t proc proc /mnt/proc/ sudo mount -t sysfs sys /mnt/sys/

make dns available in chroot

sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

enter chroot

sudo chroot /mnt /bin/bash

re-install missing packages

apt install cryptsetup lvm2

re-generate (this might be done also by apt in the step before, I'm not sure)

update-initramfs -u -k all

Leave chroot environment - not sure if the following is really necessary...

exit

Write buffers to disk

sudo sync

Unmount file systems

sudo umount /mnt/sys sudo umount /mnt/proc sudo umount /mnt/boot

This Q&A helped me collecting the commands.

This Q&A is kind of related, but maybe not relevant for you anylonger if you are having this issue already.

lumbric
  • 4,129
18

Please add the outputs of lsblk -fs, fdisk /dev/sda with p flag and the report of grub repair to the question as pastebin links.

Based on searching, there seems to be similar questions on Ask Ubuntu that has no answer up to date here and Here one answer is given which explains about raid and ubuntu.

There seems to be several suggestions, some of which seem to work for some people.

  1. From the initframs prompt try typing ls /dev/mapper and see if your root volume is listed. If it is not listed, try waiting 10 seconds and run ls again.

    If it is now listed, type exit and it should now find the root device and boot (taken from here

  2. Edit the boot config by pressing e when grub alert to choose OS, and replace root=UUID-6500... by root=/dev/sdx where sdx is the boot partition. The problem here seems to be that the UUID is either wrong, or /dev/disk/by-UUID... does not exist(1)

  3. Adding the parameter all_generic_ide to the end of the boot-line like kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=43206294-74ef-434d-aca2-db74b4257590 ro quiet splash all_generic_ide seems to work for some people (2)
  4. The Super User question here, seems to suggest the error is due to LVM. The solution is also given in the same which is to install lvm2.
  5. The same Super User site also suggests booting using an older Kernel, if available. It seems to work for some people. Trying to boot using the Recovery option might work for some people
  6. Post by nux_man777 here seems to suggest the error may be in the installation medium.
  7. The error /dev/mapper/ubuntu-vg-root seems to be related to raid as described here.

    "In the installer summary screen right before the copy process starts, click the Advanced button. Change the boot partition (this is the MSDOS-style "parent" partition not the Linux partitions) to /dev/mapper/pdc_feddabdf (or whatever dmraid lists as your fakeraid partition) Make sure the checkbox is clicked to boot from this disk. note that the installer will modify grub2 to point to the correct logical partition /dev/mapper/pdc_feddabdf1 or whatever / is on."

    Detailed instructions regarding installation is given in the referred site. Please check there for more info on installation of grub.

  8. Booting into a live installation media and updating ubuntu by changing root using chroot seems to work for some people (suggested by cpttripzz here). Instruction regarding chroot is here. You can also refer to this question at Unix & Linux. More details can be found at Arch Wiki and Gentoo Wiki.
  9. Changing the SATA Controller to Native IDE from RAID and doing a fresh install seems to work for some people here and here
  10. IDE cable or the hard disk may be bad (the same ubuntu forum as above page 40)
One Face
  • 331
9

I had this problem and nothing on any posts here or elsewhere were able to help. Specifically in my case, I could see that /dev/mapper did not contain ubuntu--vg-root or anything else for that matter. This means that something either went wrong when LVM tried to mount/map the volumes OR something went wrong earlier in the boot process, and this error is just a catch-all symptom for any earlier problem.

The second of these was the case for me and only because of my reading about initramfs I was able to understand and diagnose the issue. This should be the first thing you do if you suspect something has gone wrong prior to LVM doing its thing.

In my case (which may not be the same as you but is worth documenting), I had full disk encryption (LUKS) enabled, and somehow the cryptsetup tools had been removed from initramfs, therefore I was not being prompted for the passphrase to unlock, and the drives were not accessible, which meant that /dev/sdaX could not be mounted, and therefore ubuntu--vg-root could not be mounted/mapped into /dev/mapper. If you try to run cryptsetup from the BusyBox prompt, youll know you have the same issue if thecryptsetup` cannot be found.

The solution was to boot from a LiveCD, unlock the drive manually with cryptsetup, chroot into the root filesystem, reinstall cryptsetup and call update-initramfs.

Zanna
  • 72,312
cwilko
  • 91
7

Had a very similar issue after an update of Ubuntu 20.04 on a Dell XPS13 (2020). Searched for hours, the solution was actually super easy.

reboot and go to BIOS using "fn and F2" BIOS > System Configuration > Sata Operation > switch to "AHCI" from "RAID On"

For some reason this BIOS settings was switched.

KoenBal
  • 344
  • 3
  • 3
5

For those here suffering from encryption-related problems, as in @Zanna's answer, you'll need to follow a procedure similar to this:

  1. Boot into your system using a live distro / USB.

  2. Mount the encrypted partition (in Ubuntu, you should see the encrypted volume available on the desktop; double-clicking and entering the password should suffice). The partition will be mounted at /media/ubuntu/[mount point]. (The username will change based on distro; e.g., Xubuntu uses xubuntu.)

  3. Open a terminal window and a bourbon.

  4. Set appropriate bindings for mount points within the system:

    sudo su -
    mount -t auto /dev/sdX /media/ubuntu/[mount point]/boot
    mount --bind /dev /media/ubuntu/[mount point]/dev
    mount --bind /dev/pts /media/ubuntu/[mount point]/dev/pts
    mount --bind /sys /media/ubuntu/[mount point]/sys
    
  5. chroot into the root directory of your encrypted disk: chroot /media/ubuntu/[mount point]

  6. Ensure that your system has appropriate initramfs packages installed: sudo apt install cryptsetup-initramfs lvm2.

  7. Critically, you'll also need to ensure that your configuration files force initramfs to include the cryptsetup binaries, which were removed at some point, it seems: nano /etc/cryptsetup-initramfs/conf-hook, uncomment the CRYPTSETUP line, and make sure it reads CRYPTSETUP=Y.

  8. Finally, run update-initramfs -u -k all, shut down, pull the live media, and start back up.

Your mileage here may vary depending on what's happened with your system. If, for example, you've changed the LVM group name or the UUID, you may need to align /etc/crypttab and /etc/fstab to use the right identifiers. If, like me, you were migrating from one release to another, you may find that you have two encrypted volumes with the same group name—this makes mounting the disk rather difficult (you need to use the UUID explicitly).

All in all, the upgrade to Xubuntu 18.10 was awful because of this. (A stock system wouldn't reboot once the upgrades to the kernel were pulled in!) At least in the current setup I have, the system is stable through reboots.

N.b., the ACPI errors that led me all over the Internet looking for a solution were a red herring: they have no bearing on whether you can boot from an encrypted disk.

Thomas
  • 6,433
Ethan
  • 151
1

Try the following:

(initramfs) reboot

Then, at the OS chooser prompt, try booting with an older kernel.

If you succeed, then probably this will fix the problem, as suggested in @One Face's bullets 4 and 5, and the link it refers:

sudo apt-get install lvm2
e18r
  • 279
0

My system couldn't boot after an update and wasn't prompting me to enter my LUKS passphrase for my root partition. However, I was able to boot after a manual unlock.

Note: Change /dev/vda3 to your root partition that contains Ubuntu.

(initramfs) cryptsetup luksOpen /dev/vda3 ubuntu
            Enter passphrase: *****
(initramfs) exit

The system boots.

0

Use boot-repair-disk

Download source: https://sourceforge.net/p/boot-repair-cd/home/Home/

I had the same problem, I solved it running an image with boot-repair-disk and less than 15 seconds it was solved. Try it.

0

In my case, booting with the oldest kernel version available in the "Advanced options for Ubuntu" menu in Grub worked.