From e4a0ef25e1e63c432125c97a8e60cde8dee228f2 Mon Sep 17 00:00:00 2001 From: Akbar Rahman Date: Mon, 29 Jan 2024 15:37:30 +0000 Subject: [PATCH] help i think my device shut down after deleting the current kernel and before installing the second (no entries in systemd-boot/grub/) --- computery_stuff/linux.md | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/computery_stuff/linux.md b/computery_stuff/linux.md index 07351b8..ef4b8c9 100755 --- a/computery_stuff/linux.md +++ b/computery_stuff/linux.md @@ -20,3 +20,47 @@ usermod -a -G group user ```bash usermod -g group user ``` + +# help i think my device shut down after deleting the current kernel and before installing the second (no entries in systemd-boot/grub/) + +0. boot into a live usb of current disto +1. mount the root partition to `/mnt` and the boot partition to the appropriate folder (check + fstab which should be in `/mnt/etc/fstab`, if it says `/efi`, mount it to `/mnt/efi`) +2. chroot into the mounted filesystem: + + on arch based systems you can simply run: + + ``` + arch-chroot /mnt + ``` + + on non arch based systems[^1]: + + ``` + mount -t proc /proc /mnt/proc/ + mount -t sysfs /sys /mnt/ys/ + mount --rbind /dev /mnt/dev/ + # only if using uefi + mount --rbind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars/ + # for internet access + cp /etc/resolv.conf /mnt/etc/resolv.conf + chroot /mnt /bin/bash + ``` +3. the system can now be force updated/kernel images can be generated + + on arch based systems[^2]: + + ``` + # reinstall all current packages + pacman -Qqen > /root/pkgs.txt # list all installed packages + pacman -S $(< /root/pkgs.txt) # reinstall all installed packages + rm /root/pkgs.txt # clean up + + # reinstall dependencies (if there are issues) + pacman -Qqdn > /root/deps.txt # list all installed dependencies + pacman -S $(< /root/deps.txt) # reinstall all installed dependencies + rm /root/deps.txt # clean up + ``` + +[^1]: https://wiki.archlinux.org/title/Chroot [wayback machine](https://web.archive.org/web/20240121115548/https://wiki.archlinux.org/title/Chroot) +[^2]: https://bbs.archlinux.org/viewtopic.php?id=193174 [wayback machine](https://web.archive.org/web/20240129153400/https://bbs.archlinux.org/viewtopic.php?id=193174)