Restore Ubuntu UEFI Boot Entries after BIOS Update

From Thomas-Krenn-Wiki
Jump to navigation Jump to search
Please note that this article / this category refers either on older software / hardware components or is no longer maintained for other reasons.
This page is no longer updated and is purely for reference purposes still here in the archive available.

The Ubuntu installer will create an UEFI boot entry in BIOS during the installation of Ubuntu 12.04 LTS Server on a server with a Supermicro X9SCM-F Motherboard. When updating the BIOS of a Supermicro X9SCM-F motherboard (from BIOS Version 1.x to 2.x), these boot entries will be lost and Ubuntu will no longer boot afterwards. The problem can also occur alongside a BIOS or Grub update.

This article shows you how to make the startup entries again.

Problem with BIOS update

  • Only updating the BIOS from version 1.x to 2.x is affected (such as from 1.1a to 2.0 or 1.1a to 2.0a).
  • Updating the BIOS from one version 1.x to a higher version 1.y is not affected by this.
  • Updating the BIOS from one version 2.x to a higher version 2.y is not affected by this.

Problem with Grub update

We are also aware of some cases where the UEFI boot entries from the Grub update, (ie regardless of the BIOS update), that could not be created correctly. We also know about such documented cases with both X9SCM-F and X9DR7-LN4F motherboards with Ubuntu Launchpad. [1] We recommend checking the UEFI boot entries before and after the Grub update with the following command: sudo efibootmgr -v. If there are missing UEFI boot entries after the core update they can be restored as described below after restarting the system.

The following example illustrates a case where after the Grub update there are missing UEFI boot images:

adminuser@ubuntu-12-04:~$ sudo efibootmgr -v
BootCurrent: 0001
Timeout: 10 seconds
BootOrder: 0001,0000,0002,0003,0005
Boot0000* ubuntu	HD(1,800,f3800,caff37a0-8078-4b24-956e-79eb5e33631f)File(\EFI\ubuntu\grubx64.efi)
Boot0001* ubuntu2	HD(1,800,f3800,957eb480-5f2f-409e-95b8-62c38a3305c0)File(\EFI\ubuntu2\grubx64.efi)
adminuser@ubuntu-12-04:~$ sudo apt-get update; apt-get upgrade
[...]
Reading state information... Done
The following packages will be upgraded:
  apt apt-transport-https apt-utils grub-common grub-efi grub-efi-amd64 grub-efi-amd64-bin grub2-common libapt-inst1.4 libapt-pkg4.12 libcib1
  libcrmcluster1 libcrmcommon2 libpe-rules2 libpe-status3 libpengine3 libstonithd1 libtransitioner1 libudev0 mdadm pacemaker udev
22 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[...]
Preparing to replace grub-efi 1.99-21ubuntu3.9 (using .../grub-efi_1.99-21ubuntu3.10_amd64.deb) ...
Unpacking replacement grub-efi ...
Preparing to replace grub-efi-amd64 1.99-21ubuntu3.9 (using .../grub-efi-amd64_1.99-21ubuntu3.10_amd64.deb) ...
Unpacking replacement grub-efi-amd64 ...
Preparing to replace grub-efi-amd64-bin 1.99-21ubuntu3.9 (using .../grub-efi-amd64-bin_1.99-21ubuntu3.10_amd64.deb) ...
Unpacking replacement grub-efi-amd64-bin ...
Preparing to replace grub2-common 1.99-21ubuntu3.9 (using .../grub2-common_1.99-21ubuntu3.10_amd64.deb) ...
Unpacking replacement grub2-common ...
Preparing to replace grub-common 1.99-21ubuntu3.9 (using .../grub-common_1.99-21ubuntu3.10_amd64.deb) ...
Unpacking replacement grub-common ...
[...]
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-51-generic
Found initrd image: /boot/initrd.img-3.2.0-51-generic
[...]
Found memtest86+ image: /boot/memtest86+.bin
  No volume groups found
Adding boot menu entry for EFI firmware configuration
done
Setting up grub-efi (1.99-21ubuntu3.10) ...
adminuser@ubuntu-12-04:~$ sudo efibootmgr -v
BootCurrent: 0001
Timeout: 10 seconds
BootOrder: 0001,0000,0002,0003,0005
adminuser@ubuntu-12-04:~$ sudo grub-install --bootloader-id ubuntu /dev/sda
Installation finished. No error reported.
adminuser@ubuntu-12-04:~$ sudo efibootmgr -v
BootCurrent: 0001
Timeout: 10 seconds
BootOrder: 0001,0000,0002,0003,0005
adminuser@ubuntu-12-04:~$ 

Recovering UEFI Boot Entries for Ubuntu

Do the following steps to recover the boot entries:

  1. Start the server using an Ubuntu installation CD or USB stick in UEFI mode:
    Ubuntu-12.04-UEFI-Boot-01-UEFI-boot-Ubuntu-USB-Stick.png
  2. Select the Rescue a broken system option. The following screen should appear:
    Ubuntu-12.04-UEFI-Boot-02-Rescue-a-broken-system.png
    • If the following screen appears, the installation medium was not started in UEFI mode. In this case, return to the BIOS and start the installation medium in UEFI mode.
      Ubuntu-12.04-UEFI-Boot-02-Wrong-boot-mode.png
  3. Select the desired language and other settings.
    Ubuntu-12.04-UEFI-Boot-03-Select-a-language.png
  4. Select the root partition for your system (a software RAID array will be used in this example). If you have installed Ubuntu on a single device (hard disk or hardware RAID), select that device directly (such as /dev/sda2).
    Ubuntu-12.04-UEFI-Boot-04-Enter-rescue-mode-Example-software-raid-1.png
  5. Select the Execute a shell in ... option and then Continue.
    Ubuntu-12.04-UEFI-Boot-08-Enter-rescue-mode-Execute-a-shell.png Ubuntu-12.04-UEFI-Boot-09-Enter-rescue-mode-Execute-a-shell.png
  6. Execute efibootmgr in order to display the current entries.
    Ubuntu-12.04-UEFI-Boot-10-efibootmgr.png
  7. Mount the EFI partition (generally /dev/sda1), start a bash shell and execute grub-install --bootloader-id ubuntu /dev/sda.
    Ubuntu-12.04-UEFI-Boot-11-grub-install.png
  8. (Optionally) With a software RAID array, mount the EFI partition on the second hard disk and execute grub-install --bootloader-id ubuntu-hdd2 /dev/sdb.
    Ubuntu-12.04-UEFI-Boot-12-grub-install-hdd2.png
  9. Finally, close the shell with the exit command and re-boot.
    Ubuntu-12.04-UEFI-Boot-13-Reboot.png

Additional Steps for a Software RAID 1 Array

For a software RAID 1 array, the following steps are required after Step 4 in this procedure above:

  • Select the software RAID array’s partitions:
    Ubuntu-12.04-UEFI-Boot-05-Enter-rescue-mode-Example-software-raid-1.png
  • Optionally, check the software RAID array from a second console (which can be opened by pressing [Alt]-[F2]. The original console can be re-opened by pressing [Alt]-[F1]
    Ubuntu-12.04-UEFI-Boot-06-Search-partitions-in-second-console.png
  • Select the RAID device:
    Ubuntu-12.04-UEFI-Boot-07-Enter-rescue-mode-Example-software-raid-1.png

References


Foto Werner Fischer.jpg

Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.