如何从预启动紧急 shell 手动启动 Arch Linux?

Pro*_*kup 7 shell boot arch-linux uefi mkinitcpio

我破坏了 Arch Linux 安装。假设我在 PARTUUID 字符串中打错了字。结果是引导过程无法挂载根文件系统并在 mkinitcpio 预引导阶段停止并显示错误消息:

你现在被扔进了一个紧急外壳。

回归#1:mount + exec

blog.entwicklerseite.de 有一个如何从 手动启动的示例rootfs,例如:

# mount /dev/sda2 /new_root/
# exec /usr/bin/switch_root /new_root /sbin/init
Run Code Online (Sandbox Code Playgroud)

这会将这些消息带到控制台输出:

Trying to run as user instance, but the system has not been booted with systemd. 
Trying to continue (this will most likely fail) ... 
...
ERROR: Failed to mount the real root device. 
Bailing out, you are now on your own. Good luck.
... 
Run Code Online (Sandbox Code Playgroud)

和内核恐慌。

回归 #2:设置 root + mount + exec

# root=/dev/sda2
# mount /dev/sda2 /new_root/
# exec /usr/bin/switch_root /new_root /sbin/init
Run Code Online (Sandbox Code Playgroud)

该版本的输出没有变化。

我可以使用哪些命令从 Arch Linux 紧急 shell 继续(手动)引导?

Pro*_*kup 16

后来我在 Arch Linux 论坛上发现了一个帖子,主题是“ Arch 无法挂载我的根分区”。

从紧急 shell 启动 Arch Linux的解决方案甚至更少输入:

# mount /dev/sda2 new_root
# exit
Run Code Online (Sandbox Code Playgroud)

  • 你救了我的命。 (2认同)