You are not logged in.

#1 2019-02-12 19:56:30

slackcub
Member
Registered: 2009-03-14
Posts: 144

[SOLVED] /sbin/init exists but couldn't execute

I did a system update and I am now getting an error on boot:

Failed to execute /init (error -13)
Console: switching to colour frame buffer device 400x112
Run /sbin/init as init process
Starting init: /sbin/init exists but couldn't execute it (error -13)
Run /etc/init as init process
Run /bin/init as init process
Starting init: /sbin/init exists but couldn't execute it (error -13)
Run /bin/sh as init process
Starting init: /bin/sh exists but couldn't execute it (error -13)

I then get a kernel panic after that.

/init doesn't exist, /bin/init and /sbin/init are both symlinks to /lib/systemd/systemd, which has 755 permissions owned by root. 

I had read around that this could be caused by a read only root filesystem, but in the kernel options, I have

root=/dev/nvme0n1p5 rw

.

I'm using system-boot, and /boot/loader/entries/linux.conf contains:

title  Arch Linux
linux    /vmlinux-linux
initrd    /initramfs-linux.img
options    root=/dev/nvme0n1p5 rw    

Last edited by slackcub (2019-02-12 21:37:14)

Offline

#2 2019-02-12 20:17:16

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] /sbin/init exists but couldn't execute

Is this in the initramfs or when it tries to switch_root into the archlinux installation? Are you using an initramfs which is systemd-based or busybox-based?

Does /usr/lib/systemd/systemd function if you try to run it after chrooting in from the live installation media?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2019-02-12 20:34:04

slackcub
Member
Registered: 2009-03-14
Posts: 144

Re: [SOLVED] /sbin/init exists but couldn't execute

These are the first messages I get after hitting enter on the boat loader to pick which option I want.

I'm pretty sure it's a systemd-based initramfs.  It's whatever the stock initramfs is (I haven't done anything custom for that)

when I try to run /usr/lib/systemd/systemd in the arch-chroot from the installation media, I get this error:

Trying to run as user instance, but the system has not been booted with systemd

Offline

#4 2019-02-12 20:37:59

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: [SOLVED] /sbin/init exists but couldn't execute

If you have not added the systemd mkinitcpio hook then it will be busybox based.  If you add the boot option root=/dev/null are the error messages the same?

Offline

#5 2019-02-12 20:56:18

slackcub
Member
Registered: 2009-03-14
Posts: 144

Re: [SOLVED] /sbin/init exists but couldn't execute

I looked at my /etc/mkinitcpio.conf  and I don't see systemd in the hooks statement, so I guess it's busybox.

and yes, I get the same error if I change the option to root=/dev/null.

Looks like I need to rebuild my initramfs.  So I know I can do it if I were actually on the system by running

mkinitcpio -g /boot/initramfs-linux.img

Can I do that in an arch-chroot as well, or are there other flags I need to add?

Offline

#6 2019-02-12 21:19:54

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] /sbin/init exists but couldn't execute

It works fine in arch-chroot as well. EDIT: also, use mkinitcpio -p linux to load /etc/mkinitcpio.d/linux.preset which does all this.

But I'm still curious why the current initramfs doesn't work... if you wanted to investigate, you could use lsinitcpio --extract and examine the contents.

Last edited by eschwartz (2019-02-12 21:26:28)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2019-02-12 21:36:59

slackcub
Member
Registered: 2009-03-14
Posts: 144

Re: [SOLVED] /sbin/init exists but couldn't execute

yeah, I did the mkiniticpio -p linux and mkinitcpio -p linux-lts.  I now have a functioning laptop once again big_smile

I wish I knew what the initramfs was doing, too.  Unfortunately I wasn't paying attention, ran the lsinitcpio --extract in /boot/, filled up that partition, and when I was cleaning it up, I accidentally deleted all my initramfs files before I could truly inspect them hmm

Offline

#8 2019-02-12 21:40:55

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] /sbin/init exists but couldn't execute

Ah well, the important thing is that rebuilding the initramfs based on the current version of everything results in a correctly functioning boot image.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB