0

Given:

  • A laptop (albeit a tablet in a laptop chasis) with an eMMC as an internal storage;
  • Contains an existing Windows 10 installation (out of the box),
  • A live Kubuntu USB stick and;
  • A USB flash drive

How do you properly install:

  • rEFInd (see below for more details)
  • Kubuntu unto the USB flash drive

Provided that the desired outcome and rEFInd behavior would be that:

  • rEFInd automatically presents an OS (Operating System) as an option if and only if that OS is bootable / present, i.e. the USB flash drive where Kubuntu is installed is plugged in

I have attempted to do the installation twice, and twice did rEFInd present an Ubuntu option both when the USB flash drive with Kubuntu installation is plugged and when it is not (presents screen with "grub>" when option selected with USB flash drive unplugged);

  • First install, /dev/sdb (the USB flash drive, as sda is the live USB) was selected as the boot loader installation device
  • Second install /dev/sdb5 (the USB flash drive's EFI System Partition) was selected as the boot loader installation device

Hoping for some answers. Thank you.

1 Answers1

1

First, be aware that many tablets have 64-bit CPUs and 32-bit EFIs. In principle, such computers are best used with 32-bit OSes, and in fact they generally ship with 32-bit versions of Windows; however, 32-bit versions of Ubuntu generally ship with installers that lack EFI boot loaders. It's possible to install either 32-bit or 64-bit Ubuntu on such a computer by jumping through some hoops (see here for an introduction to this topic). A 32-bit GRUB can boot a 64-bit kernel or vice-versa; but if you don't want to use GRUB, rEFInd can only launch a like-bit-depth kernel -- that is, if the tablet has a 32-bit EFI, you'll use a 32-bit rEFInd, which can launch only a 32-bit kernel. This fact may be limiting, depending on your exact hardware and software needs, since you'd need to involve GRUB to switch from a 32-bit EFI to a 64-bit kernel, if that's your intent.

If this is not an issue (that is, if your EFI is 64-bit or if you can jump through the right hoops to install a 32-bit Ubuntu), then one way to get the result you want is:

  1. Start with the out-of-the-box configuration with Windows installed to the internal eMMC.
  2. Download the rEFInd CD-R or USB flash drive image from its downloads page and prepare a boot medium from it.
  3. Disable Secure Boot on the computer. (You can re-enable it later, although you may need to jump through some hoops to do so.
  4. Pre-partition the USB flash drive in whatever way you like, but do not create an ESP on the disk.
  5. Launch the Ubuntu installer on the computer, but select the "try before installing" mode.
  6. Open a Terminal window.
  7. In the Terminal window, type ubiquity -b. This command launches the Ubuntu installer, but the -b option tells it to not install a boot loader.
  8. In Ubiquity, select the "something else" scheme for disk layout. If you're unfamiliar with this option, see this question and its answers for a basic orientation.
  9. Proceed with the installation in the usual way.
  10. When the installation completes, shut down the computer.
  11. Leave the just-installed Ubuntu USB drive plugged in and replace the Ubuntu installation medium with the rEFInd medium you prepared in step #2.
  12. Boot to the rEFInd medium. It should give you an option to boot the Ubuntu you've just installed. Use that option. (Note that if you don't completely eliminate the GRUB you've already installed, it will likely appear in the rEFInd menu, too. You can delete it later.)
  13. Once in Ubuntu, install the rEFInd PPA or Debian package.

At this point, you should be able to unplug the rEFInd USB drive and reboot into rEFInd, which should enable you to boot either Windows or Ubuntu. If you then reboot with the Ubuntu USB drive unplugged, rEFInd will show only the Windows option. (If you see the old GRUB entry, you can delete it from Ubuntu by deleting the /boot/efi/EFI/ubuntu directory tree.) You may also want to tweak various rEFInd features, like the default option, by editing /boot/efi/EFI/refind/refind.conf in Ubuntu.

There are variants of this procedure that would work, too. The key points are:

  • The Ubuntu installation's bit depth matches that of the EFI.
  • The ESP is on the internal eMMC drive.
  • Ubuntu is entirely confined to the USB drive, except for rEFInd.
  • rEFInd has a filesystem driver that enables it to read kernels from a Linux filesystem. (This will happen automatically when you install the PPA or Debian package, provided you use ext2/3/4fs or Btrfs. If you use XFS or JFS, you'll need to jump through extra hoops.)
Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • Thank you for replying. rEFInd can automatically detect boot loaders right? Meaning I can also install the EFI boot loader (grub) unto an ESP of the USB flash drive and let rEFInd dynamically adjust selections based on what is available. This can solve the issue you mentioned in your first paragraph right? Why is it though that the installer keeps installing the boot loader unto the internal drive and not the USB flash drive, specifically the ESP of the USB flash drive I specifically selected in the manual partition ("something else") page? – Gelo Tress Sep 23 '17 at 11:31
  • Yes, if you've got a 32-bit EFI but want to install a 64-bit Ubuntu, putting the 32-bit GRUB on the USB drive would be a good solution. Ubuntu has a bug that causes it to install GRUB to the first ESP it finds; that's just the way it is (for now). Workarounds include temporarily changing partition type codes before installation or not installing GRUB (as in my procedure) and manually installing it yourself after installing Ubuntu. – Rod Smith Sep 24 '17 at 13:08
  • Had done it and it works well. rEFInd seems to have detected the kernel as well. I discovered that Ubiquity does bug like that, I just manually transferred GRUB to the ESP on the flash drive and modified fstab for the ESP (changed the UUID from the eMMC to the flash drive), and it worked. Thanks for the help. – Gelo Tress Sep 24 '17 at 23:33