Ok, here is what I've found out:
The system has a 32bit UEFI, while Ubuntu (and all other distros I know) currently only supports 64bit UEFI. I managed to do the following:
- Create a bootable Ubuntu USB stick using UnetBootin.
- Download the latest rEFInd binary and installed it manually to the USB stick according to the instructions in rEFInd's online manual.
- Create an entry in rEFInd's config file, equivalent to the "Try without installing" GRUB entry.
- Reboot the system and manually select rEFInd's 32bit EFI executable.
- Select the created menu entry and boot it.
rEFInd now tries to boot the live system. As I removed the quiet splash
options, I could see the boot log. However, after a few seconds, the screen turned black. I have not yet found out where the black screen comes from or what causes it, but I doubt it is an X11 issue, as Ctrl+Alt+Del reboots the system, which wouldn't happen if the graphical environment were running. But I managed to boot the kernel from the live system, which technically could count as booting the live system ;)
However, I decided not to try installing Ubuntu any further, but I think this procedure can be helpful if someone else runs into a similar problem.
UPDATE: After some more annoyances by Windows, I tried again. The solution for the black screen was simple: Added the nomodeset
argument to the boot options, and the system properly booted.
However, half of the device's hardware, including both WiFi and Bluetooth adapters, is not recognized (I'm not talking about no drivers, I'm talking about not even found by the system, e.g. listed in lshw
).
So I guess I'll have to stick to Windows, then.
Overview
See this link,
Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it
Answering your questions
mkusb creates a persistent live drive where partition #1 has the NTFS file system, which can be read by Windows. (Sometimes Windows wants to repair it. It will find no error, but after that it is happy. Probably it wants to mark that it has accepted it.)
In a persistent live system you can install program packages. But you cannot use new kernels, because the overlay system for persistence is activated after the linux kernel from the live system is started. Usually you should avoid general upgrades like you do with installed systems. (But if you have a lot of drive space for the casper-rw partition, you can do general upgrades. I am testing it with a 60 GB SSD, and it has worked well for a long time now.) Otherwise, if you want a fully up to date system, you should use an installed system (in the USB pendrive).
mkusb creates a persistent live drive, that can boot in both UEFI and BIOS mode. See this link for more details,
Compressed image file with a persistent live system
mkusb makes a persistent live system, where journaling is turned off, which reduces wear.
If you make an installed system, you should consider the following points, as described at this link,
help.ubuntu.com/community/Installation/UEFI-and-BIOS#Final_system_tweaks
- Add the mount option noatime in /etc/fstab
- Turn off journaling
- Maybe remove swap
Live/portable SSDs
Advice from @karel here at AskUbuntu: USB flash drives are not the best devices to install a live USB distro from a durability standpoint. Some live/portable SSDs have almost the same form factor as live USBs and come in sizes up to 256GB. As you might expect, live/portable SSDs are quite a bit more expensive than ordinary USB flash drives.
I agree that this is a good alternative, if you are prepared to pay for it. See also these links,
help.ubuntu.com/community/Installation/FromUSBStick#Notes_about_speed
help.ubuntu.com/community/Installation/FromUSBStick#The_flash_hardware
Best Answer
Overview
Creating UEFI-only booting USB live media is pretty straight forward. Just copy the files to your FAT32-formatted USB drive. That's it!
Remember that for an installation or booting the media:
Table of contents
1. Copy files from the ISO method
This method also works for other install media that contains EFI loaders, like Windows for example.
1.1. Example via terminal
You can do something like the following if
604A-00EA
is your USB drive and you already havep7zip
installed:You're done if you have only one partition on this USB drive, otherwise you need to flag the partition as bootable e.g. via
parted
:Where
/dev/sdX
would be your USB drive and1
the partition number that should be used to boot.1.2. Example via GUI
Mount the .iso-file and copy the contents over to your USB drive. Press Ctrl+H in Nautilus to display and copy hidden files as well.
Add the boot flag via GParted.
1.3. Example on Windows
diskmgmt.msc
, that would open Disk Management.2. The ISO loopback method (advanced)
Instead of extracting contents from an ISO image, GRUB and GRUB2 have been able to boot from ISO images directly through a loopback device. Given that the ISO image is UEFI bootable, we can set up a USB drive containing multiple ISOs with different operating systems without creating a mess on the USB drive.
If you want to boot Windows too you might want to look at SARDU. I remember using it with Windows PE around 2005 and it seems to have been updated to support USB drives and UEFI, but remember that this tool also supports legacy booting.
What do we need?
2.1. Creating the binary
On your Ubuntu machine or VM make sure the package grub-efi-amd64-bin is installed (grub-efi-ia32-bin is also available for 32-bit Intel architectures on newer releases). The package may have a different name on another distribution, you can compare the file listing of the package to find the right package on your distribution.
The following command will generate the GRUB image, in this case an EFI binary that every computer with a UEFI firmware should be able to run:
Every standard UEFI firmware should look into
\EFI\BOOT\
for a file namedboot{arch}.efi
, so create the folders on the USB drive and copy the image we just created to this location. Other architectures instead of x64 are possible, but let's keep it simple with x64/amd64.2.2. Creating the configuration file
A very basic example for a the
grub.cfg
configuration file that should be placed in the same directory asbootx64.efi
would look like this:The important thing is the configuration block with the title
Boot Ubuntu 14.04.2 LTS from ISO
. You can change the color and timeout to your preference. I choseblack/light-magenta
as it still looks a bit Ubuntu-ish but is easily distinguishable when chainloading other configurations. You can find more examples for other distributions in the Arch Wiki and reading the GRUB manual is really worth your time if you want to go beyond that.Getting back to the configuration block, it should be obvious that the ISO is referenced as
/efi/boot/ubuntu-14.04.2-desktop-amd64.iso
, so copy your ISO to\EFI\BOOT\
and replaceubuntu-14.04.2-desktop-amd64.iso
in the configuration with the actual filename of your ISO.loopback loop $isofile
is the line, that will load our ISO file to a loopback device from which we can boot the Linux kernel directly. This is possible because our EFI GRUB image includes the loopback module. (A bit of trial and error was involved in figuring out which modules are reasonable to include. You shouldn't see any error messages, it's still not perfect though.) Speaking of the kernel you can add kernel parameters liketoram
, parameters for different languages (examplelocale=de_DE bootkbd=de
) and as in the example:persistent
2.3. Adding persistency
You can add a partition as described in: How do I get a live-USB to use a partition for persistence? Or you can create a
casper-rw
file and place it at the root of your USB drive.I haven't tested what the absolute maximum is, it should be somewhere between 4094 and 4096 MB. Use a partition if you intend to use more space. Note that every change to the (root) is a modification to the overlay filesystem, even deleting files.
2.4. Checking the integrity
You should look at answers to the following questions to verify that the Live ISO content on the USB drive is in pristine condition:
2.5. UEFI Secure Boot
Secure Boot will become mandatory with Windows 10 machines, I suggest you have a look at the Linux Foundation's PreLoader to add Secure Boot functionality to this setup. Here is some ASCII art illustrating menus of the accompanying HashTool.
3. Review in 2020
I wrote this answer more than 5 years ago. How well does it still work? It works well for Ubuntu. install.wim from latest Windows 10 images however exceeds the FAT32 maximum file size and bigger images like RHEL 8 also don't fit. I tried Rufus yesterday and noticed that it uses GRUB too with NTFS EFI modules to read another NTFS partition where it stored the Windows installation files. It failed to load data from this partition though. Also exFAT is now commonplace.
Windows is picky with drives that have no partition tables. Trying to re-purpose older SSDs as chunky USB thumb drives does not work really well on Windows. Maybe I need to read some Microsoft documentation to find out what the rationale was to make it a bit more complicated than on Linux.
ChromeOS is a different topic, I think it's not possible to create recovery media the way I prefer. Which is cumbersome when you have to use Windows and reformat the entire drive to create media for your Chromebook.
Interesting stuff, let's hope I find time to fix some of this and learn a few more new things.
Congratulations, I'd say you now mastered UEFI booting and shouldn't be afraid anymore.