K.S. Bhaskar on 14 Jul 2016 06:26:23 -0700
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
[PLUG] Making a UEFI partition bootable after an upgrade
- From: "K.S. Bhaskar" <firstname.lastname@example.org>
- To: "Philadelphia Linux User's Group Discussion List" <email@example.com>
- Subject: [PLUG] Making a UEFI partition bootable after an upgrade
- Date: Thu, 14 Jul 2016 09:26:13 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to; bh=SI3dGpNSFkkNCxtaMj87fO/r/ded3FnwjyYdkaYqdPg=; b=A4xER+fTPoVCZEYBQ6NjnQ154CW5L3T9oF9KkeXQDKTz10vJeckYAvcvwgbwdrqaP8 LQcYQCMes2QcXdhC8E/CntVOXLj7TXrlKAYupUZnse1bgzreEKfENfP96lbEjBIsMXSY nL3Qq+J1fGjdtOeHbwzMbF1Mjwfvb68aVEkweZW634rNsiCFK3dU2MOe5STybadL4tuN R+abW6JYjrW/6LnzKDQXiXcDdxnCCll4YuLpDZu7YoKdz0yBPjsTuTpa2udMovrrvq/O YmCcYmJpsSCy9HeTMd9MjAkt0qessJnj1xh4GVy8bkE/ENaEnsQIJugDTI9+6qNGmyen SXqQ==
- Reply-to: Philadelphia Linux User's Group Discussion List <firstname.lastname@example.org>
- Sender: "plug" <email@example.com>
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).
Run 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.
Edit 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.
Upgrade 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.
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug