Thursday, February 25, 2016

Fix UEFI Boot on Surface Pro if you've Installed Linux

At work I wanted to test run Linux on a Surface Pro 3. I installed Ubuntu Gnome 14.04 to a flash drive so I wouldn't disturb the Windows install, ran it up a few times, played around, etc., then unplugged the flash drive and tried to boot back into Windows.

Got the "Minimal BASH-like line editing is supported..." grub error message.

Seems that, due to the way UEFI work with Ubuntu, the EFI partition is mounted in the Linux file system, and grub is half written there, and half written to the "regular" file system in /.

So when the Linux drive is removed, the boot loader is still looking for the Ubuntu install that no longer exists. FML.

The (workaround) fix, it turns out, is pretty easy — but only if you still have access to the Linux install. In my case I did, so I booted up from the flash drive one more time, and did as suggested in this askubuntu answer:

cd /boot/efi/EFI/Boot
sudo mv ubuntu/ ubuntu~

This will cause the bootloader to fall back onto the Windows install when it can no longer find the Ubuntu one. It's not a clean fix, but it works.

Disappointing that this is how it works in UEFI — one of the golden features of trying a Linux install on a separate drive is that it honoured the existing boot setup so you could revert back instantly.

(As an addendum, I would never buy a Surface Pro 3 myself — they are flaky in all sorts of ways. Yuk yuk yuk).

No comments:

Post a Comment