Ubuntu installer mishandling of previously existing EFI partitions

Bug #1840697 reported by Jean-Francois Gratton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
New
Undecided
Unassigned

Bug Description

Issue seen on Ubuntu 19.04 (workstation); might present in previous versions ?

Previous situation ("pre-bug") :

/dev/sda = WDC disk 2TB
/dev/sdb = SSD disk, 256GB
boot loader in /dev/sda

Ubuntu 19.04 was installed before Windows as I wanted it on the SSD drive for most of it; slow I-Os went on the WDC disk.

disk layout:
  /dev/sda1 = Windows Recovery partition, 500MB
  /dev/sda2 = Windows EFI partition, 100MB
  /dev/sda3 = Windows NTFS OS + Data partition, 400G
  /dev/sda4 = Linux LVM2. remainder of disk

  /dev/sdb1 = ubuntu /boot partition, xfs, 512MB
  /dev/sdb2 = ubuntu /boot/efi, 350MB
  /dev/sdb3 = Linux LVM2, remainder of disk

1. Ubuntu and Windows both boot just fine, Windows using /dev/sda2 as its EFI partition, Ubuntu using /dev/sdb2 for its EFI partition.

2. For some reason I needed to re-install Ubuntu exactly where it was. I slapped my DVD in the reader, booted the installer, and started. At the partman section, I've left off everything Windows-related on /dev/sda, making sure that /dev/sda2 was left at "Do not use partition". As /dev/sd[ab]2 was already tagged as "EFI partition", and that I've left /dev/sda2 at "Do not use", I was assuming the installer would use /dev/sdb2 as /boot/efi.

Expected result is as above. Actual result follows.

3. End result: the installer leaves off /dev/sdb2 and overwrites /dev/sda2 even with a "Do not use partition flag". Subsequent boots would not see the Windows OS installed as its EFI partition had been overwritten by the installer. Looks like that the installer (or whatever its subcomponent) grabs the first EFI partition it sees and uses it.

4. To fix (workaround):
  a=> mount -t vfat /dev/sdb2 /mnt && cd /boot/efi && tar cf - . | (cd /mnt ; tar xf -)
  b=> find a win10 boot cd, go in repair mode, reinstall EFI code+files in /dev/sda2
  c=> reboot in Ubuntu, os-prober && update-grub

Further observations:
  Other installers (Fedora's anaconda, to name one) would let you specify the mountpoint of an EFI partition (yes, it should always be /boot/efi). This is not foolproof, I agree, but at least it'd leave no place to doubt on setups similar as mine on which EFI partition Ubuntu is directed to use.

--Jeff

Tags: partman uefi
description: updated
Revision history for this message
Jean-Francois Gratton (jfgratton) wrote :

Bug replicated on Ubuntu 18.10 this evening.

Same result, same outcome, same workaround

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.