假期更新的时候断电自动关机,随后无法启动,需要进入chroot修复系统。

开机显示如下,但键盘无法键入任何值:

:: running early hook [udev]
Warning: /lib/modules/4.15.3-Z-AEVH,modules.devname not found - ignoring
starting version 237
:: running hook [udev]
:: Triggering uevents...
Waiting 10 seconds for device /dev/disk/by-partuuid/5322e576-3c60-4605-b394-542a3fcb5ed1 ...
ERROR: device 'PARTUUID=5322e576-3c60-4605-b394-542a3fcb5ed1' not found. Skipping fsck.
:: mounting 'PARTUUID=5322e576-3c60-4605-b394-542a3fcb5ed1' on real root
mount: /new_root: can't find PARTUUID=5322e576-3c60-4605-b394-542a3fcb5ed1.
You are now being dropped into an emergency shell.
sh: can't access tty; jog control turned off
[rootfs ]#

一脸懵逼……

Google一下,要进入chroot修复系统

查看wiki pacman更新时崩溃,似乎是内核出现问题。

制作启动盘

使用USBWriter做好启动盘,进入系统。

检查网络

ping一下检查是否已经自动获取网络。

发现没网,用ip link 命令检查网卡。

发现仅识别出有线网卡,而无线网卡没有被识别出。

插上网线,利用pppoe进行ADSL拨号上网(使用pppoe-strat 命令,并根据提示连接网络)。

挂载分区

mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

进入chroot

挂载好分区后,使用arch-chroot命令进入chroot:

arch-chroot /mnt

修复内核

pacman -Syu mkinitcpio systemd-tools linux

重新安装内核(linux 软件包)将会自动运行mkinitcpio -p linux 重新生成 initramfs 镜像,不需要单独生成。

卸载分区

使用exit, umount /mnt/{boot,}卸载分区,然后reboot ,可以正常开机。