我的笔记本电脑在更新过程中没电了,因此 Linux 内核被截断。arch-chroot
进入并重新安装后linux
,就可以了,但是/boot/initramfs-linux.img
(和后备)是空的。还有,/etc/mkinitcpio.d/linux.preset
是空的。我该如何解决这个问题,以及如何生成预设?
ls /etc/mkinitcpio.d/
什么也不返回
我破坏了 Arch Linux 安装。假设我在 PARTUUID 字符串中打错了字。结果是引导过程无法挂载根文件系统并在 mkinitcpio 预引导阶段停止并显示错误消息:
你现在被扔进了一个紧急外壳。
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)
和内核恐慌。
# …
Run Code Online (Sandbox Code Playgroud) 我已经在U 盘上安装了 Arch Linux,并使用 LUKS 进行了完整的系统加密。Arch wiki 像往常一样带我浏览了几乎所有内容。我遇到的唯一问题是在mkinitcpio
. Arch wiki 说对于 USB 安装,block
钩子必须紧跟在udev
钩子之后。维基还说对于加密,encrypt
钩子必须在钩子之前,但不一定是立即,filesystem
钩子。遵循这些规则我第一次尝试:
HOOKS="encrypt base udev block autodetect modconf filesystems keyboard fsck"
Run Code Online (Sandbox Code Playgroud)
但它没有用,所以我encrypt
后来搬到了:
HOOKS="base udev block autodetect modconf encrypt filesystems keyboard fsck"
Run Code Online (Sandbox Code Playgroud)
它工作正常。这引出了我的问题。哪些是对的依赖encrypt
挂钩和我在哪里可以找到有关钩依赖性的详细信息?
我有一个文件 /boot/initramfs.gz
使用tar -xzvf initramfs.gz -C ./
I got a file提取它initramfs
。
???? $ file initramfs
initramfs: ASCII cpio archive (SVR4 with no CRC)
可以使用ark
. 但我想更改此文件中的一些文件initramfs
。
我使用提取它ark
并得到一个文件夹initramfs
。现在我想像以前一样保存它。
如何像原始文件一样创建 ASCII cpio 存档(无 CRC 的 SVR4)?
在启动时我看到:
:: running hook [encrypt]
A password is required to access the volume:
Command requires device and mapped name as arguments
Command requires device and mapped name as arguments
Command requires device and mapped name as arguments
Run Code Online (Sandbox Code Playgroud)
最后一条消息每秒重复一次。
我没有机会输入密码。
我正在运行基于 Arch 的 Manjaro。
我究竟做错了什么?
我正在尝试修复和升级 Arch Linux 系统。我从比原始安装版本更新的 Live USB 启动。然后我将 sda 和 chroot 挂载到它的挂载点。当我运行时mkinitcpio -p linux
,我从标题中得到错误:
'/lib/modules/4.9.8-1-ARCH' is not a valid kernel module directory
Run Code Online (Sandbox Code Playgroud)
lib/modules/
有 4.13.3-1-ARCH。我如何告诉mkinitcpio
改用这个目录?
我有一个使用mkinitcpio
. 我在 Arch GNU/Linux 上。
不久前,我掉到了一个救援外壳上,并/bin
在 ramdisk 的底部四处探查,看看有什么可用的。出于某种原因,有一堆看起来无关紧要的实用程序(想想诸如ping
- 你为什么要在救援环境中使用它?)。
alex@alexs-arch-imac:/tmp$ mkdir initramfs
alex@alexs-arch-imac:/tmp$ cd initramfs
alex@alexs-arch-imac:/tmp/initramfs$ cp /boot/initramfs-linux.img .
alex@alexs-arch-imac:/tmp/initramfs$ cat initramfs-linux.img | unlzma - >
initramfs-linux # needed because unlzma complains that it doesn't recognize the .img extension
alex@alexs-arch-imac:/tmp/initramfs$ cpio -iV < initramfs-linux
.............................................................................................................................................................................................................................................................................................................................................................
24225 blocks
alex@alexs-arch-imac:/tmp/initramfs$ ls
bin buildconfig config dev etc hooks init init_functions initramfs-linux initramfs-linux.img lib lib64 new_root proc run sbin shutdown sys tmp usr VERSION
alex@alexs-arch-imac:/tmp/initramfs$ ls -l bin …
Run Code Online (Sandbox Code Playgroud) 我是Linux 的初学者,当我安装 arch Linux双引导时,下载基本系统,然后我进入chroot,然后使用以下命令创建 ram:mkinitcpio -p Linux
。当我写它时,给我找不到命令。
我使用此视频进行安装:https://www.youtube.com/watch?
v=METZCp_JCec 我在分钟停止:9.16。
mkinitcpio ×8
arch-linux ×6
initramfs ×2
boot ×1
cpio ×1
dependencies ×1
dm-crypt ×1
hook ×1
linux ×1
pacman ×1
ramdisk ×1
shell ×1
startup ×1
uefi ×1