Image of Modern Operating Systems (3rd Edition)
Image of Beginning Google Maps API 3
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)

EFI Stub "/etc/os-release missing"

When I updated my Fedora 20 installation today I ran into trouble booting my system using the EFI Stub mechanism even though it booted fine using GRUB. I ended up in the Emergency Shell.

Looking at the logs using journalctl, here are the relevant entries (with times and irrelevant entries removed):

[ ]: Reached target Switch Root.
[ ]: Started Plymouth switch root service.
[ ]: Starting Switch Root...
[ ]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.
[ ]: Failed to start Switch Root.
[ ]: Startup finished in 211ms (kernel) + 0 (initrd) + 45ms (userspace) = 256ms.
[ ]: Unit initrd-switch-root.service entered failed state.
[ ]: Triggering OnFailure= dependencies of initrd-switch-root.service.
[ ]: Starting Emergency Shell...

Looking at the contents of /sysroot:

# ls

There was no sign of an /etc directory. Instead, the full path to the os-release file was /sysroot/root/etc/os-release.

Why is the systemd initrd-switch-root service testing for the presence of /etc/os-release? Well, the /etc/os-release file contains operating system identification data. The file format is a newline-separated list of environment-like shell-compatible variable assignments. It was one of the new configuration files that systemd introduced and systemd, per Poettering, is architected to fail to the Emergency Shell if this file cannot be located and read.

I am not sure what changed in the updates I installed but the fix itself is to add the following to the kernel command line parameters.


So here is the UEFI shell script I am now using to EFI Stub boot the current version of Fedora 20:

vmlinuz-3.12.6-300.fc20.efi root=UUID=4d1c04a2-838a-439c-a17c-40bac9377b25 rd.lvm=0  KEYTABLE=us SYSFONT=True rd.luks=0 ro LANG=en_US.UTF-8 rhgb quiet rootflags=subvol=root initrd=.initramfs-3.12.6-300.fc20.x86_64.img

By the way, my root file system is btrfs and not ext4 but I do not think this has anything to do with the problem but I need to investigate further.

2 comments to EFI Stub "/etc/os-release missing"

  • kai

    Im in the same situation with you.So im’ in the Emergency Shell. What is your method to get this working? Can you specifiy where/how to use your UEFI shell script ?

  • Mark

    I did add rootflags=subvol=root to the grub command lineļ¼ŒBut it did not work out.