random-archer / mkinitcpio-systemd-tool

Provisioning tool for systemd in initramfs (systemd-tool)
https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/
Other
113 stars 27 forks source link

Failed to switch root: os-release file is missing #18

Closed ShapeShifter499 closed 6 years ago

ShapeShifter499 commented 6 years ago

So I'm noticing this error today. I get thrown into a emergency shell and the below is some output with errors. It's saying something about os-release missing but it is there. /etc/os-release which is a symlink to /usr/lib/os-release exists.

● initrd-switch-root.service - Switch Root                                     
   Loaded: loaded (/usr/local/lib/systemd/system/initrd-switch-root.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2018-07-05 20:20:11 UTC; 7min ago
  Process: 892 ExecStart=/usr/bin/systemctl --no-block switch-root /sysroot (code=exited, status=1/FAILURE)
 Main PID: 892 (code=exited, status=1/FAILURE)                                  

Jul 05 20:20:11 archlinux systemd[1]: Starting Switch Root...                   
Jul 05 20:20:11 archlinux systemctl[892]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.
Jul 05 20:20:11 archlinux systemd[1]: initrd-switch-root.service: Main process exited, code=exited, status=1/FAILURE
Jul 05 20:20:11 archlinux systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'.
Jul 05 20:20:11 archlinux systemd[1]: Failed to start Switch Root.              
Jul 05 20:20:11 archlinux systemd[1]: initrd-switch-root.service: Triggering OnFailure= dependencies.

And what my os-release file looks like below

NAME="Arch Linux ARM"
ID=archarm
ID_LIKE=arch
PRETTY_NAME="Arch Linux ARM"
ANSI_COLOR="0;36"
HOME_URL="http://archlinuxarm.org/"
SUPPORT_URL="https://archlinuxarm.org/forum"
BUG_REPORT_URL="https://github.com/archlinuxarm/PKGBUILDs/issues"
ShapeShifter499 commented 6 years ago

Solved! I have my /boot files on a different partition, both rootfs and boot are on a Micro SD card. I changed the kernel I use for my device and that recently changed the device name from mmcblk0p1 to mmcblk1p1. The solution is to use the UUID of the partition instead of the dev name in the /etc/fstab.