Re: starting networking from within single user mode?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 11, 2022 at 12:04 AM Brian Reichert <reichert@xxxxxxxxxxx> wrote:
I've managed to hose a SLES12 SP5 host; it starts to boot, then hangs.

If I get it into single-user mode (getting into the grub menu, and adding
init=/bin/bash) I can at least review the file system.

What I want to do is get networking running, so that I can at least gather
logs, etc.

When I try to start networking with 'systemctl', I see this error:

systemd "failed to connect to bus; No such file or directory"

What can I do to minimally bring up the networking service? I don't even
have any network devices at this point...

Running without init isn't really single-user mode. You won't be able to start any services using systemctl without init, because... systemctl controls init. You also won't have any network devices because drivers for those are loaded by a service that's not running without init (namely systemd-udevd).

Boot with either "s" (aka "single" aka "rescue") or "-b" (aka "emergency") for two variants of single-user mode with init. The former starts some basic stuff (it's the real single-user mode) including udev so that modules for your network interfaces still get loaded automatically, while the latter doesn't start anything except init and a shell (emergency mode is *almost* like init=/bin/sh but in theory might at least let you `systemctl start` something).

If udev is not running, try to `modprobe` whichever drivers you need for the Ethernet interface. (The name can be found by PCI ID, e.g. for 10ec:8136 "grep -i 10EC.*8136 /lib/modules/`uname -r`/modules.alias") Then manually bring eth0 up, add the IP address, add a default route (dhclient or dhcpcd will also work without udev, while systemd-networkd probably won't).

ip link set eth0 up
ip addr add 192.168.1.55/24 dev eth0
ip route add default via 192.168.1.1

--
Mantas Mikulėnas

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux