📜  如何从 grub 救援启动 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:47.386000             🧑  作者: Mango

代码示例1
ls
# This will list all your devices

# Then you have to go through each, type something like this (depends on what is shown by the ls command):
ls (hd0,1)/
ls (hd0,2)/
# ... and so on, until you find:
(hd0,1)/boot/grub OR (hd0,1)/grub
# ... or, in case of "UEFI", it look something like:
(hd0,1)/efi/boot/grub OR (hd0,1)/efi/grub

# Now you have to set the boot parameters accordingly - just type the following (with the correct numbers for your case) and after each line press return:
set prefix=(hd0,1)/grub
# ... or (if grub is in a sub-directory):
set prefix=(hd0,1)/boot/grub

# Then continue with
set root=(hd0,1)
insmod linux
insmod normal
normal

# Now it should boot. Go to the commandline (e.g. start a "terminal") now, and execute:
sudo update-grub
# ... this should correct the missing information and it should boot next time.

# If NOT - you have to go through the steps again an might have to repair or install grub again.