Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
klaren:fixnonbootingarch [2022/08/29 20:56] – klaren | klaren:fixnonbootingarch [2022/08/31 20:26] (aktuell) – [Reboot] klaren | ||
---|---|---|---|
Zeile 113: | Zeile 113: | ||
==== Reboot ==== | ==== Reboot ==== | ||
- | ==== | + | ==== Alles in einem Script |
+ | < | ||
+ | #################################################### | ||
+ | # | ||
+ | # Restoring a defective GRUB | ||
+ | # | ||
+ | # start a temporary arch OS from stick then | ||
+ | # source the file and follow the instructions | ||
+ | #################################################### | ||
+ | # this is the partition logical name from / | ||
+ | LUKS_DRIVE=luks-a41aeaeae-1b9-431e-94a6-0032440889fd | ||
+ | # | ||
+ | # define mount options for subvol mounts | ||
+ | MOUNT_OPT_ROOT=subvol=/ | ||
+ | MOUNT_OPT_HOME=subvol=/ | ||
+ | MOUNT_OPT_CACHE=subvol=/ | ||
+ | MOUNT_OPT_LOG=subvol=/ | ||
+ | # | ||
+ | # Open the LUKS container - will ask for password interacively | ||
+ | cryptsetup open / | ||
+ | # | ||
+ | # Mount subvolumes into a temporary path | ||
+ | mount -o $MOUNT_OPT_ROOT | ||
+ | mount -o $MOUNT_OPT_HOME | ||
+ | mount -o $MOUNT_OPT_CACHE / | ||
+ | mount -o $MOUNT_OPT_LOG | ||
+ | # | ||
+ | # Add bind mounts for important system file systems: | ||
+ | for x in dev dev/pts sys sys/ | ||
+ | # | ||
+ | # Give some hint text what to do inside the chroot environment, | ||
+ | # | ||
+ | echo "mount / | ||
+ | echo "mount -t efivarfs efivarfs / | ||
+ | |||
+ | echo " | ||
+ | echo " | ||
+ | |||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | # | ||
+ | # This starts bash inside of the new root under /mnt: | ||
+ | # | ||
+ | chroot /mnt / | ||
+ | # | ||
+ | # inside of the bash execute above commands to fix GRUB or rescue data or do something else | ||
+ | # | ||
+ | # after leaving, cleanups: | ||
+ | for x in /proc / | ||
+ | cryptsetup close $LUKS_DRIVE | ||
+ | |||
+ | </ | ||