0

So I thought I had faced the typical problem of getting a superblock corrupted (which I think happened because of an intended hard/unclean reboot). However after following the guide in the first accepted answer of the linked question, by restoring an alternate superblock, the system is still booting into (initramfs). [NOTE: after using fsck like advised in that answer, I could successfully mount the filesystem and copy stuff from it, and create a folder inside it with sudo rights.]

At the beginning, I didn't get any text before the (initramfs) prompt, except for:

BusyBox v.1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
Enter 'help' for a list of build-in commands.

But now I sometimes get also this:

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)
ALTER! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!

So then, given that restoring the superblock didn't work, what options do I have to fix my boot? I imagine I could try to reinstall Ubuntu from LiveCD/LiveUSB but I have to add an aspect which adds extra complexity: my main hard disk partition is encrypted (by using the default Ubuntu way, which I guess is called LUKS).

Is there a way to fix the boot without reinstalling? Or reinstalling without wiping everything? Should I debug my problem by looking at the boot logs? (If yes, where are they?)

Booting from a LIVE ubuntu USB ISO, I can issue a fdisk -l /dev/sda command, and the result is:

Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 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
Disklabel type: dos
Disk identifier: 0x60229a0a

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda1  *       2048    999423    997376   487M 83 Linux
/dev/sda2       1001470 937701375 936699906 446.7G  5 Extended
/dev/sda5       1001472 937701375 936699904 446.7G 83 Linux

And this is the result for sudo blkid -c /dev/null:

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="7ec61194-f216-4f1b-b684-5b2e2d643c25" TYPE="ext2" PARTUUID="60229a0a-01"
/dev/sda5: UUID="11613ca4-65f2-4079-a750-6f71b6318903" TYPE="crypto_LUKS" PARTUUID="60229a0a-05"
/dev/sdb: UUID="674B-9411" TYPE="vfat"

FWIW, if I mount my encrypted drive via nautilus, I can open /etc/fstab in an editor, and these are the contents:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=7ec61194-f216-4f1b-b684-5b2e2d643c25 /boot           ext2    defaults        0       2
/dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0

UPDATE: If I press shift at grub booting time, then I can see some options before it goes to boot into (initramfs):

  1. Ubuntu
  2. Advanced options for Ubuntu
  3. Memory test (memtest86+)
  4. Memory test (memtest86+, serial console 115200)

If I choose the first, then I get the (initramfs) boot. If I choose the second, then more options show up:

  1. Ubuntu, with Linux 4.4.0-28-generic
  2. Ubuntu, with Linux 4.4.0-28-generic (upstart)
  3. Ubuntu, with Linux 4.4.0-28-generic (recovery mode)
  4. Ubuntu, with Linux 4.4.0-24-generic
  5. Ubuntu, with Linux 4.4.0-24-generic (upstart)
  6. Ubuntu, with Linux 4.4.0-24-generic (recovery mode)

If I choose 1 here, the result is the (initramfs) prompt as well.

But if I choose the option (4), the computer asks me for the encryption password and boots alright!! So then, I guess the kernel 4.4.0-28 is at fault here, how to get rid of it and mark the -24 as default?

knocte
  • 996

1 Answers1

1

Reinstalling the faulty kernel, as advised here, didn't work.

Removing the faulty kernel worked (by booting on the one that works, pressing SHIFT at boot time), as explained in this other answer.

knocte
  • 996