Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

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).

Sunday, January 6, 2013

Dual-booting Vista and Linux

I found these notes from a while back on re-partitioning (and then reverting) a dual-boot Linux install on Windows. After working this out I now prefer to install on physically separate disks (due to the problem of reverting it if you ever want to). However, someone might find the following process of use.

Installation is easy; reverting back to a single boot, single partition is much more difficult.

If you're thinking of installing Linux as an alternative to the wonderland of Windows, consider these things:

  • Run Linux from a Live DVD (basically the .iso image of the distribution burnt to a CD/DVD) to test device drivers for all your hardware. This way you don't have to change disk partitions until you're happy that it's going to work. Consider the software you want to run as well.
  • Decide what is a showstopper, hardware compatibility-wise.
  • If you want to go ahead and dual-boot Linux and Windows on the same drive, be really sure because you will need to repartition the hard drive. Repartitioning isn't hard -- the Linux installer takes care of it -- but if you want to reverse the process and remote the partition, it is a pain in the arse.
  • Backup everything first.
If you install and then decide you want to revert, these are the steps I found worked (note: this was done in Vista. Process may be different for Windows 7):
  1. Download mbrfix to restore the Master Boot Record (MBR). Run the following from a command prompt:
    mbrfix /drive 0 fixmbr /vista
    Important: To start the command prompt, right click on the shortcut and choose "Run as administrator" (even if you're logged in as administrator), otherwise you will get the following error:
    System error 5 has occurred. Access is denied
  2. Check that Windows boots normally.
  3. Delete and reallocate the partitions. Avoid Vista's partition management -- it doesn't work. I burnt a GParted Live CD (iso image) and used that. It takes a long time, but it works.
  4. After re-partitioning the drive, I had a problem with a missing winboot.exe. Inserting the Vista installation DVD and choosing the "Repair your computer" option fixed this problem.

Saturday, December 15, 2012

Crowdsourcing FTW

Awesome example of a crowd-sourced investigation and solution:

http://forums.whirlpool.net.au/forum-replies.cfm?t=2025126.

Monday, May 9, 2011

Getting rid of Media Info from context menus

If a "Media Info" option appears in Windows Explorer context menus and you want to get rid of it, delete the following key from the registry:
HKEY_CLASSES_ROOT\*\shell\Media Info
(Original link for solution.)

This option in the menu is particularly annoying if you're using the keyboard to rename a file (pressing Menu, m). Instead of jumping to rename, it would select Media Info first.

Mercurial/Vim compatibility

If you want to use vim as your editor in the .hgrc file (on Windows), install vim to a directory with no spaces in the path.