You are not logged in.

#1 2018-02-26 13:30:03

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Kernel panic with systemd (error -2)

I recently (Friday) updated via pacman but now when I boot, I get a kernel panic:

Kernel Panic -- not syncing. Requested init /usr/lib/system/systemd failed (error -2)

Any idea how I can track down what systemd's problem is, besides an "error -2"?

Last edited by jdarnold (2018-02-26 13:30:17)

Offline

#2 2018-02-26 13:53:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Kernel panic with systemd (error -2)

The error is pretty self explanatory.  What is /usr/lib/system/systemd and where did it come from?  Did you enter that manually in your boot loader (what is your bootloader) or did you attempt to recreate the /bin/init symlink and enter a typo?  Systemd is /usr/lib/systemd/systemd.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2018-02-26 18:33:42

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Sorry, just a typo on my part for the kernel panic line, as I was swapping between displays. I re-tried it just to be sure and the error actually says /usr/lib/systemd/systemd got an error -2. It's nothing I've changed myself, and has remained the same for years now, pretty much ever since the move to systemd. I've been an Arch user for quite some time.

Offline

#4 2018-02-26 20:35:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

You forgot to mount your /boot partition before the update and now cannot mount the /root partition?
https://wiki.archlinux.org/index.php/Pa … _rebooting

That said, the kerne should still load /bin/init by default, so you probably also have a custom kernel commandline, containting "init=/usr/lib/systemd/systemd" ?

Offline

#5 2018-02-27 19:06:59

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Well, maybe I'll try the arch_chroot and the pacman -S linux thing and see if it helps.

Offline

#6 2018-02-28 13:49:57

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Yeah, that didn't help at all. I tried booting with the latest Arch image and doing an arch-chroot. Then I ran pacman -Syu mkinitcpio systemd linux. But I still get the same error. It tells me that systemd is running but it returns a -2, meaning it can't find something. Any idea on logging?

Offline

#7 2018-02-28 13:50:38

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

That said, the kerne should still load /bin/init by default, so you probably also have a custom kernel commandline, containting "init=/usr/lib/systemd/systemd" ?

Offline

#8 2018-02-28 15:20:26

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Yes, I sure do. Here's my boot screen with the selected kernel line. And systemd is there in the right place, it's the correct UUID for the hard drive it is on

20180227_145640.jpg

Last edited by jdarnold (2018-02-28 15:49:48)

Offline

#9 2018-02-28 15:25:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

"Why"?
Also please replace the oversize image w/ a thumbnail or link.

Offline

#10 2018-02-28 15:34:40

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,623

Re: Kernel panic with systemd (error -2)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#11 2018-02-28 15:50:17

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Sorry about the image - fixed it.

Not sure what you mean by "Why?"

Offline

#12 2018-02-28 16:00:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Kernel panic with systemd (error -2)

Why do you explicitly specify the init parameter in the kernel command line?

By default it is /init which is systemd.  Does your initramfs have a /usr/lib/systemd/systemd?  Mine doesn't.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#13 2018-02-28 17:54:43

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Kernel panic with systemd (error -2)

Trying to load /bin/init is not going to work unless systemd-sysvcompat is also installed, so trying to specify /usr/lib/systemd/systemd directly should work.

pacman -Qo /bin/init
/usr/bin/init is owned by systemd-sysvcompat 237.64-1

I have a vague idea that I've had things setup that way but later decided to just install systemd-sysvcompat and get rid of the long 'init=/usr/lib/systemd/systemd' kernel parameter. Maybe the OP can try installing systemd-sysvcompat and see if that makes things work, although I suspect the problem might be something else.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2018-02-28 18:20:12

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Well, desperate times call for desperate measures, so I'll give it a try. But, as I've said, this is a file that I haven't touched for years. And it sure seems to me that it finds systemd, loads it, but then systemd exits with the -2 error. It is *not* getting init not found, just that systemd is returning an error.

How can I tell if my intramfs has a /usr/lib/systemd/systemd?

Offline

#15 2018-02-28 18:22:47

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Kernel panic with systemd (error -2)

jdarnold wrote:

How can I tell if my intramfs has a /usr/lib/systemd/systemd?

With 'lsinitcpio /boot/initramfs-linux.img | grep systemd'.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#16 2018-02-28 20:18:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: Kernel panic with systemd (error -2)

jdarnold wrote:

Well, desperate times call for desperate measures

Using the default init is not a desperate meaure, it is the default measure.

jdarnold wrote:

And it sure seems to me that it finds systemd, loads it, but then systemd exits with the -2 error.

On what do you base this suspicion?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#17 2018-02-28 21:14:51

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Trilby wrote:
jdarnold wrote:

Well, desperate times call for desperate measures

Using the default init is not a desperate meaure, it is the default measure.

It's a desperate measure because it won't have any effect. The init is specified correctly, and has been specified correctly for years. It may or may not be pretty, and, at least according to R00KIE, your "fix" won't work if I don't install another piece of software.

Trilby wrote:
jdarnold wrote:

And it sure seems to me that it finds systemd, loads it, but then systemd exits with the -2 error.

On what do you base this suspicion?

Because the kernel error literally says

Requested init /usr/lib/system/systemd failed (error -2)

To me, that says the kernel tried to run /usr/lib/system/systemd, and it returned an error (-2). Do you have any better explanation?

Last edited by jdarnold (2018-02-28 21:15:26)

Offline

#18 2018-02-28 21:23:38

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Kernel panic with systemd (error -2)

I would double check that the initramfs matches with the kernel you are trying to run and try to check if all modules needed to access the root filesystem are present in the initramfs.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#19 2018-02-28 21:26:18

loqs
Member
Registered: 2014-03-06
Posts: 18,879

Re: Kernel panic with systemd (error -2)

jdarnold wrote:

Requested init /usr/lib/system/systemd failed (error -2)

To me, that says the kernel tried to run /usr/lib/system/systemd, and it returned an error (-2). Do you have any better explanation?

If the output literally was

Requested init /usr/lib/system/systemd failed (error -2)

That would be expected as the path is incorrect.
Edit:
If you change the initrd option to point to /dev/null so the initrd can not load does the error message change?

Last edited by loqs (2018-02-28 21:28:56)

Offline

#20 2018-02-28 21:30:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

ldd /usr/lib/system/systemd
file /usr/lib/system/systemd
pacman -Qkk systemd # you need to chroot into the installed system or pass the root to pacman

@loqs, he keeps coming up with this typo(?), but according to the screenshot the path is correct.

Offline

#21 2018-02-28 21:46:55

loqs
Member
Registered: 2014-03-06
Posts: 18,879

Re: Kernel panic with systemd (error -2)

Which init system are you using the ash script or systemd as provided by the systemd hook.  If the former does the break=postmount option drop the system to a shell just before switching root?
If the latter does rd.rescue drop the system to a shell at a similar point?

Offline

#22 2018-02-28 23:23:25

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

Yeah, I'm really sorry about the continued typos vis a vis /usr/bin/systemd/systemd - that's what it reports and that's what it should be.

So I checked lsinitcpio and, sure enough, there is no /usr/bin/systemd/systemd. I tried removing the init= and it failed to boot, this time with a Unable to find init, try using init=. So I installed systemd-sysvcompat package and, after asking if it should remove sysvinit, it installed it. I think ran 'pacman -S linux' to get it all set up again, but unfortunately, I still get the Unable to find init error.

Offline

#23 2018-03-01 08:00:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

chroot into the installed system and check the output of the commands in https://bbs.archlinux.org/viewtopic.php … 8#p1771068

Offline

#24 2018-03-01 14:44:54

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: Kernel panic with systemd (error -2)

loqs wrote:
jdarnold wrote:

Requested init /usr/lib/system/systemd failed (error -2)

To me, that says the kernel tried to run /usr/lib/system/systemd, and it returned an error (-2). Do you have any better explanation?

If the output literally was

Requested init /usr/lib/system/systemd failed (error -2)

That would be expected as the path is incorrect.
Edit:
If you change the initrd option to point to /dev/null so the initrd can not load does the error message change?

I assume you mean the init= option? Because if I do, it now says "Requested init /dev/null failed (error -2)", which now leads me back to a problem with just trying to load systemd...

For the above commands on systemd, this is what I get:

20180301_093229.jpg

Not sure what they mean.

Added: The ldd report is weird, but it says that for any binary I've tried. And yes, that's a blank. For instance:

 # ldd /bin/pacman
        not a dynamic executable

Am I not doing the arch-chroot right? From the commandline on the latest Arch ISO:

# mount /dev/sda2 /mnt
# arch-chroot /mnt

Yeah, I have a ton of partitions and the main Arch one is on /dev/sda2.

Last edited by jdarnold (2018-03-01 15:12:45)

Offline

#25 2018-03-01 15:09:17

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,444

Re: Kernel panic with systemd (error -2)

Nothing - that's the systemd from the archiso or whatever - the installed one should be linked dynamically...

Offline

Board footer

Powered by FluxBB