-
Notifications
You must be signed in to change notification settings - Fork 28
System Recovery
Andrei Pozolotin edited this page Apr 26, 2020
·
17 revisions
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-nspawn
container, then re-build -
use only
systemd-nspawn
: non-systemd
containers, such aschroot
are not supported
- system has luks root, for example:
/dev/sda1 -> /boot
/dev/sda2 -> [swap]
/dev/sda3 -> [luks root]
- system can boot form
archiso
usb disk
-
boot into
archiso
usb 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
root
partition formarchiso
host
cryptsetup luksOpen /dev/sda3 root
- prepare
boot
androot
mounts 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