More on booting: a practical Fedora UEFI guide, and don't use "universal" USB stick writers

Yesterday I penned another tome on UEFI. In contrast to my blog post, this is more of a practical guide to installing Fedora on UEFI-capable systems: it doesn't go into the technical details of how UEFI works, it's more just about what you should and shouldn't do when installing Fedora to UEFI-capable systems in various circumstances.

On a related topic, if I can put in a word on so-called "universal" tools for writing bootable images - like Fedora live or install images, for instance - to USB sticks: they're never actually "universal", and it's usually a bad idea to use them.

I'm talking about tools like UNetbootin and Universal USB Installer. Don't use them, and don't let your friends use them. Mail them to your enemies.

I haven't looked into them all very deeply, but everyone who's done support for a Linux distribution can probably tell you that they're often the cause of "mysterious" failures in booting USB sticks. A lot of them, as far as I can tell, seem to just dump the contents of the image onto the stick and then stick a syslinux bootloader onto it.

This comes with myriad problems. I haven't seen a "universal" USB stick writer which came close to writing something that would boot in native UEFI mode, for instance, never mind boot properly on a Mac. By contrast, distributions like Fedora and SUSE and Arch quite carefully tune their images so that if you write them with a dd-style tool, or the distribution's supported USB stick writing tools, you will get a stick that does boot in all these ways.

Although they usually manage to write a stick that boots in BIOS-native mode on a PC, you can't rely on it booting properly, or being reliable for doing installations. For instance, the way non-live Fedora installation images are set up to boot from USB is for the early init stage to look for a filesystem with a particular label to find the installer itself - if you look at the kernel parameters when booting a Fedora DVD or netinst image written to a USB stick, you'll notice something like inst.stage2=hd:LABEL=Fedora\x2020\x20x86_64, and that's what that means.

When you write a Fedora image to a USB stick with a correct tool, it will apply the correct label to the correct filesystem to make this work. If you use a "universal" tool, it may well not, and you'll be left wondering why the boot fails with an error like Warning: /dev/root does not exist. This is why.

So: don't use these "universal" tools, or at least if they fail, don't report it to your distributor, report it to the tool. For Fedora, the guide to writing images to USB sticks the safe way is here (it's also covered in the Installation Guide, though that's usually a bit behind the wiki page). SUSE has three pages: Linux, Windows and OS X. Arch's page is here. Ubuntu's is here. Mageia covers it along with other media types here - their images are hybrid like Fedora's, SUSE's and Arch's, so the graphical direct write utilities described in the Fedora, SUSE and Arch instructions should work for Mageia as well.

Comments

carlos wrote on 2014-02-04 21:05:
Thanks, i did not know this.
hermelijn wrote on 2014-02-04 23:08:
unbalievably that is shows up at hit #1 in google already, I bearably was able to reply at bugzilla :-). Anyway, I want fall for this one again, so thanks for your time!
finid wrote on 2014-02-05 02:39:
Hey, Adams, you are telling people to not use UNetbootin when even the official Fedora wiki you linked to lists it as an option. Yes it does come with a caveat, but it's still listed as an option on your official wiki. For the record, I've been working on a number of UEFI-related tutorials since yesterday, using UNetbootin on Fedora 19 KDE to transfer the ISO images to USB. It works, you just have to know what to do. Installing a Linux distribution via USB in UEFI mode is not a problem. The pain in the neck is dual-booting with Windows in UEFI mode. So UNetbootin works. I've been using it all day, no problems.
adamw wrote on 2014-02-05 04:07:
"Hey, Adams, you are telling people to not use UNetbootin when even the official Fedora wiki you linked to lists it as an option. Yes it does come with a caveat, but it’s still listed as an option on your official wiki." I *wrote* that wiki page. :) (At least, several major revisions, including the most recent one. Check the history.) I left unetbootin in it because it's better to explicitly list it and say that it doesn't work reliably than just to leave it out. If you leave it out, people assume we just don't know about it and it works fine. "For the record, I’ve been working on a number of UEFI-related tutorials since yesterday, using UNetbootin on Fedora 19 KDE to transfer the ISO images to USB. It works, you just have to know what to do." Last time I looked at unetbootin it didn't attempt to write an ESP. I still wouldn't particularly trust it. When you say 'you just have to know what to do', what do you mean excatly?
kparal.wordpress.com/ wrote on 2014-02-05 08:48:
It's very unfortunate that we nurture our NIH syndrome and develop our own USB writers (two of them, not counting dd). If we participated upstream in those "universal" writers, the world could be a better place. For developers, for users, for QA. So, even though you're completely right in this article, it's also a sad demonstration how much we fail in this area.
adamw wrote on 2014-02-05 09:01:
I don't actually agree; I think any tool that attempts to be truly *universal* - i.e. cover any image at all that's supposed to be bootable - is doomed to fail. What I do think would be useful would just be for distros to standardize on hybrid images and a few good graphical dd tools - one for Windows (the couple I cite in the Fedora docs are mostly fine, they could just be polished and de-branded a bit), one for OS X, and maybe a more desktop-independent one for Linux. We had a chat on #fedora-devel (lmacken, me, and I think mjg59) the other day about making liveusb-creator just do a dd. We could also make the images have a very small empty partition at the end, and have the tools expand that to fill the stick after doing the dd, for persistent storage use.
kparal.wordpress.com/ wrote on 2014-02-05 11:32:
Well, "universal" doesn't need to mean "can burn everything and anything using the same approach". I imagine the project can contain a definition file for every supported system (if needed) that defines the particular bits necessary for correctly writing that image (partition labels, etc). So I think our ideas are pretty much same - have a single (ideally multiplatform) graphical USB writer that distributions collaborate on and keep functional. There are some good opensource ones already, I hope they would be willing to accept such patches. And then we could ditch our homegrown tools which suffer from a serious lack of maintenance time (liveusb-creator being the prime example of this, it's UI and usability is one of the worst I've ever seen, I can't really recommend it anywhere).
adamw wrote on 2014-02-05 16:44:
I filed a bug against unetbootin asking it to use a dd-style method to burn Fedora, just last week. Radio silence. https://bugs.launchpad.net/unetbootin/+bug/1274346
Steven Rosenberg wrote on 2014-02-05 17:28:
Can you comment specifically on Fedora's Live USB Creator and whether or not it should be used for Fedora installations.
adamw wrote on 2014-02-05 18:29:
Refer to the wiki page - I wrote the last major update of it. LUC is better than third-party 'universal' tools for Fedora purposes, but not as good as a dd-like method or livecd-iso-to-disk . It doesn't configure the stick correctly for Mac booting, I don't think. It has a shot at configuring it for UEFI booting, but not as thoroughly as dd or livecd-iso-to-disk --format --reset-mbr --efi will do.
BubbaButch wrote on 2014-02-08 15:09:
Can anyone tell me a reason I should be interested in UEFI if I have built a system from scratch rather than convert a Windows 8 system that comes with UEFI turned on in the BIOS. I have the option to turn it off so I did after have massive issues in an older version of LINUX. Is there a reason to use UEFI is LINUX is the HOST OS ??
Da_mENIZ wrote on 2015-04-12 09:43:
Thanks for very precise info. I've tried to figure out, how come dd tool can make LiveCD on USB both BIOS and UEFI bootable, and other tools not, but no luck until I read your article. I'm trying to add several liveCD images on one USB, and that works fine for UEFI with livecd-iso-to-disk with --multi and --livedir, but than there can't be booted with BIOS, and vice versa, as USB gets formated either MBR or GPT, but I see dd formats like loop interface. So is there any simple (without Kickstart..) way to pertain "dual" dual boot ability and have several images? Basically I would just need to edit iso somehow and modify boot menu, and add new folder for booting other image, but I'm not sure how to edit and repack back iso then. Problem with dd is that makes usb read-only and it's normally half empty and you can't store anything on it Thanks
Rusty wrote on 2015-08-04 12:23:
This article has saved lot of wasted time & frustration for me. Thanks!
Balamurugan Thangamani wrote on 2015-09-13 15:02:
Thanks lot. I was breaking my head. You made it! Thanks Bala
ed wrote on 2017-03-12 18:32:
Thankyou. After my live fedora usb kept hanging after a unetbootin (and much hassle me thinking the USB stick was corrupt) I tried dd and it worked beautifully first time. I'll never trust those snazzy gui usb tools anymore!