7

After hardly rebooting my raspberry pi 2 running raspian it does not work anymore, when I turn it on everything works fine until this error message shows up repeatedly.

[FAILED] Failed to start udev Kernel Device Manager

The machine then goes to emergency mode. I didn't find any answer online, any ideas?

1
  • 1
    Years ago, I had the same problem with udev after an Raspbian-update (it crashed, and/or reboot didn't work). But today, good news: I updated Raspbian, an udev seems to be working fine (even after reboots etc.)! So I assume the problem has been solved by now.
    – Chris
    Jul 19, 2018 at 11:00

6 Answers 6

13

It might be interesting to know which version you are running, and if you happened to update packages recently.

I encountered a similar error message on my raspberry pi2 after upgrading to raspbian testing today (from stretch). However I fear that it may be caused by a full range of different reasons.

The more precise error message I got (from journalctl -u systemd-udevd) was:

Sep 27 16:33:46 raspberrypi systemd-udevd[10856]: /lib/systemd/systemd-udevd: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libarmmem.so: cannot restore segment prot after reloc: Operation not permitted

It does not seem to be related to lib/systemd/systemd-udevd itself. Indeed, if I systemctl restart another service, I get a similar error:

root@raspberrypi:/home/pi# systemctl restart systemd-timesyncd.service
Job for systemd-timesyncd.service failed because the control process exited with error code.
See "systemctl  status systemd-timesyncd.service" and "journalctl  -xe" for details.
root@raspberrypi:/home/pi# journalctl  -xe
[...]
Sep 27 18:54:50 raspberrypi systemd-timesyncd[26811]: /lib/systemd/systemd-timesyncd: error while loading shared libraries: /usr/lib/arm-linux-gnueabihf/libarmmem.so: cannot restore segment prot after reloc: Operation not permitted
[...]

My understanding is that systemd runs binaries in an environment that clashes with a relocation that is used in libarmmem.so. That is either a bug in systemd (version 234-3 here), or in the package that provides libarmmem.so (raspi-copies-and-fills, version 0.6 from stretch here).

systemd of course is essential, while raspi-copies-and-fills is not (it's an important optimization, but the system can run without it). I solved my problem with the following interim solution:

root@raspberrypi:/home/pi# apt purge raspi-copies-and-fills

Clearly, I'll monitor the possible updates to raspi-copies-and-fills (so far at version 0.6), hoping to get both a bootable system and the fast memcpy's.

7

As of systemd 235-2 this still continues with the exact same error.


For people landing here from google:

If you see that after apt dist-upgrade that either udev, journald or even timesyncd are crashing,

Until raspi-copies-and-fills, is updated, purging it like Emmanuel Thomé suggested is the only viable solution so far.

2

Rebuilding raspi-copies-and-fills from https://github.com/bavison/arm-mem fixes this in buster.

1
  • Could you please elaborate on this how to do this? Feb 10, 2019 at 0:03
1

I had the same issue with my pi-3 and raspi-copies-and-fills installed. Udev/systemd 232-25+deb9u1 was the last working version. All updates to a newer udev version failed and i was always forced to revert to 232-25+deb9u1

Now i have removed raspi-copies-and-fills and updating to 239-7 worked without error.

1

I had a similar issue after upgrading from Raspbian 8 to Raspbian 9. After udev package was upgrading to latest backport version, the raspberry was booting in emergency mode :

Welcome to emergency mode! After logging in,type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or ^D
to try again to boot into default mode.
Give root password for maintainence
(or type control-D to continue):

removing raspi-copies-and-fills solve it !!

2
  • And why would that help?
    – RalfFriedl
    Jun 7, 2019 at 20:43
  • What is this raspi-copies-and-fills? Where is it?
    – Ingo
    Jun 8, 2019 at 23:50
0

I ran into the same issue today after upgrading to Raspbian buster. I was able to get the system booting again after purging version 0.11 of raspi-copies-and-fills from recovery mode as per @emmanuel-thomé 's answer.

Given @vhdirk's answer (that a rebuild from arm-mem source works), here's how I rebuilt a new raspi-copies-and-fills package...

I pulled the upstream (arm-mem) and RPi-Distro repos, then bumped the version to 0.12 (the udev 241-5 package blacklists prior raspi-copies-and-fills versions).

git clone https://github.com/p00ya/arm-mem.git -b p00ya
cd arm-mem
debuild -b -uc -us
sudo dpkg -i ../raspi-copies-and-fills_0.12+nmu1_armhf.deb

This seems to work (tested with sudo systemctl restart udev after installation).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.