2

My Optiplex 990 with ubuntu server 16.04.3 won't boot. I'm left with a flashing cursor in the top left. I have run into the spectre kernel issue with Kernel panic after update to 4.4.0-108-generic

I have tried following How to get to the GRUB menu at boot-time? to get into grub, but no amount of tapping / holding shift (or escape as listed elsewhere) has got me into grub.

I tried a live cd and ran boot-repair (https://help.ubuntu.com/community/Boot-Repair) and that succeeded in running but fixed nothing.

Any other ideas?

Zanna
  • 69,223
  • 56
  • 216
  • 327
edwardmlyte
  • 223
  • 2
  • 6
  • 1
    Take a look at this: https://askubuntu.com/questions/994067/kernel-panic-after-update-to-4-4-0-108-generic – fregger Jan 11 '18 at 19:58
  • 1
    Possible duplicate of [Kernel panic after update to 4.4.0-108-generic](https://askubuntu.com/questions/994067/kernel-panic-after-update-to-4-4-0-108-generic) – N0rbert Jan 12 '18 at 18:39
  • 1
    **To close voters:** OP is obviously aware of https://askubuntu.com/questions/994067/kernel-panic-after-update-to-4-4-0-108-generic and the answers to that question require the use of the Grub boot menu which OP can't reach. Sending them back to that question achieves nothing. – David Foerster Jan 13 '18 at 12:39
  • Possible duplicate of [How can I repair grub? (How to get Ubuntu back after installing Windows?)](https://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows) – David Foerster Jan 13 '18 at 12:40
  • My mistake. I should add that I specifically mean [this answer about Boot-Repair](/a/326661/175814) which allows changes to the Grub menu display setting. On top of that Boot-Repairs default action unhides the Grub menu. @Zanna – David Foerster Jan 13 '18 at 18:15

1 Answers1

1

The top answer to the question you linked to explains how to get into the GRUB menu if pressing shift does not work. You just edit the file /etc/default/grub and comment out GRUB_HIDDEN_TIMEOUT=[some number]. Then you run sudo update-grub.

Since you can't boot at all, you can't do that so easily.

However, you can do it from a live system, so go ahead and boot from a live system as you did before.

Now you can set up a chroot. If you're not sure of the device label of your installation's root partition, try running sudo fdisk -l to identify it. You should see something in the output like

/dev/sda2 <numbers indicating size> Linux filesystem

Try mounting that partition:

sudo mount /dev/sdXY /mnt

where sdXY is the correct label. Then have a look to see if the mounted partition has the directories you expect to see in your root partition:

ls /mnt

If you see things like this (not necessarily exactly like this, but at least most of them)

bin    dev   mnt         root        sys   var
boot   etc   lost+found  opt         run   srv  tmp 
home   lib   media       proc        sbin  usr 

then you got the right partition.

If you have a separate boot partition, you will need to mount it. If you are not sure, check the file /mnt/etc/fstab to see if it has a partition mounted on /boot. Ignore any mention of a partition mounted on /boot/efi.

If you have a separate boot partition, mount it:

sudo mount /dev/sdXY /mnt/boot

where sdXY is the correct label of the boot partition.

We might need to bind some additional resources (I am not sure this is necessary in this case):

for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done

OK, now enter the chroot

sudo chroot /mnt

Now we can act as if we are in our installed system. First let's edit the configuration file:

sudoedit /etc/default/grub

(or call your favourite text editor). Find the line

GRUB_HIDDEN_TIMEOUT=0

(it may have a different number, but that is not important). Comment out the line by placing # at the start of it, so it says

#GRUB_HIDDEN_TIMEOUT=0

If you do not have the above line, look for

GRUB_TIMEOUT_STYLE=hidden

and comment that out instead to

#GRUB_TIMEOUT_STYLE=hidden

check that the line

GRUB_TIMEOUT=[some number]

ends in a number greater than 0 (the default may be 10). Save the file and exit.

Run this command to write the configuration to /boot/grub/grub.cfg

sudo update-grub

Now you can reboot into your installation, and the GRUB menu will be forced to come up every time.

Zanna
  • 69,223
  • 56
  • 216
  • 327
  • Fantastically thorough. Though I think my system's a lost cause. The first step, finding the Linux partition. When I mount it I don't get any of the directories. I only get a list like abi-4.4.0-104-generic, abi-4.4.0-108-generic, boot-sav etc. Shown in https://imgur.com/a/yLj9O. No other partition can mount as mnt, so it's definitely the right one. I think it's going to have to be reinstalled – edwardmlyte Jan 12 '18 at 17:27
  • 1
    @edwardmlyte that's the boot partition. You may be able to edit the file there `grub/grub.cfg` directly to force grub to appear. Change the line `set timeout_style=hidden` to `set timeout_style=menu` and `set timeout=0` to `set timeout=10` (about 80-90 lines down I guess?) Then just reboot, no need to chroot. I didn't recommend that before as it's risky to edit the file directly (it will be somewhat unique to your system) but try it before reinstallation! – Zanna Jan 12 '18 at 17:49
  • Perfect. Once grub loaded I could update the kernel. Thanks – edwardmlyte Jan 12 '18 at 21:41
  • Awesome! Great to hear you solved it @edwardmlyte – Zanna Jan 12 '18 at 21:43