Joe Rosato on 16 Jul 2016 07:53:57 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Making a UEFI partition bootable after an upgrade

I have been using refind since Rich's talk on UEFI and I like it a lot.


On Thu, Jul 14, 2016 at 11:40 AM Keith C. Perry <> wrote:
I get never remember the commands to do that in the grub shell.  I usually just use a live of usb installation to boot and then chroot to the filesystem and run the update-grub and grub-install.

Glad you at least booting.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Keith C. Perry, MS E.E.
Owner, DAO Technologies LLC
(O) +1.215.525.4165 x2033
(M) +1.215.432.5167

From: "K.S. Bhaskar" <>
To: "Philadelphia Linux User's Group Discussion List" <>
Sent: Thursday, July 14, 2016 11:06:19 AM
Subject: Re: [PLUG] Making a UEFI partition bootable after an upgrade

The magic was to set configfile on the grub minimal shell to point (hd0,gpt2)/boot/grub/grub.cfg and boot into the Ubuntu 14.04 partition, then do update-grub followed by grub-install. Now I'm booted into 14.04 from where I can do further troubleshooting / repair.

-- Bhaskar

On Thu, Jul 14, 2016 at 9:26 AM, K.S. Bhaskar <> wrote:
I have a PC with UEFI that is unbootable after an Ubuntu 14.04 to 16.04 upgrade.

First, I should explain how I set up PCs. I have two root partitions, let me call them A & B. When A is booted, it mounts B as /spare, and when B is booted, it mounts A as /spare.The goal is to enable safe upgrades as follows, assuming that the system is running with A booted:
  • rm -rf /spare/*, and clone / to /spare/ with a command such as rsync -auvx --sparse / /spare/ (I usually also need --exclude=lastlog and then manually copy it with cp -av --sparse=always /var/log/lastlog /spare/var/log/, but that's incidental, and not a core part of the technique).
  • ​Edit /spare/etc/fstab to swap the UUIDs of / and /spare (so that when B is booted, it mounts A as /spare).
  • ​R​
    un update-grub, and edit /boot/grub/grub.cfg (when B boots, I want boot the root and boot image to come from B, and this requires some manual editing of the os-prober section of grub.cfg generated by update-grub). I save the file.
  • E​
    dit the grub.cfg to swap the UUIDs and partitions between A and B, and save as /spare/boot/grub/grub.cfg.
  • ​Reboot the machine (which brings up the grub.cfg from A) and manually boot into B as root.
  • ​U​
    pgrade B (typically using do-release-upgrade -d). If at any point, the upgrade fails, I just reboot, and the machine boots by default into A because neither the bootloader nor partition A have been touched.
  • As the last step of the upgrade is to install a new boot loader, once the upgrade completes, rebooting by default boots B.

This has been my standard configuration and technique for perhaps 10 years, perhaps longer, and this belt-and-suspenders technique has always worked… until yesterday when I tried it on a machine with A booting via UEFI rather than legacy boot (someone else did the original install; I have always installed with legacy boot).

After starting with Ubuntu 14.04 on A, I cloned to B, booted B and upgraded it to 16.04. The upgrade appeared to be successful, but when booting it now takes me to the minimal shell and I am not sure what to do next. If I try a legacy boot, it says there is no bootable partition.

Where did I go wrong, and more importantly, how do I fix it? I am able to UEFI boot it with live CD images on USB drives - both Kubuntu 16.04 and System Rescue boot, and would presumably be one path to fixing it (the minimal shell would be the other).

Thank you very much, in advance.

-- Bhaskar

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --