System Recovery - random-archer/mkinitcpio-systemd-tool GitHub Wiki
How to re-build initramfs after an mkinitcpio configuration error resulted in a broken boot?
-
unlock crypto root disk and bring system up inside
systemd-nspawncontainer, then re-build -
use only
systemd-nspawn: non-systemdcontainers, such aschrootare not supported
- system has luks root, for example:
/dev/sda1 -> /boot
/dev/sda2 -> [swap]
/dev/sda3 -> [luks root]
- system can boot form
archisousb disk
-
boot into
archisousb disk as host -
review soon-to-be-container disk layout
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 232.9G 0 disk
├─sda1 8:1 0 499M 0 part
├─sda2 8:2 0 4.9G 0 part
└─sda3 8:3 0 227.5G 0 part
- unlock
rootpartition formarchisohost
cryptsetup luksOpen /dev/sda3 root
- prepare
bootandrootmounts for the container
mkdir -p /mnt/{boot,root}
mount /dev/sda1 /mnt/boot
mount /dev/mapper/root /mnt/root
- launch and enter system-to-recover inside the machine container
systemd-nspawn --boot --bind=/mnt/boot:/boot --directory=/mnt/root
- read the manual
- study the units
- and try again