Skip to content

Instantly share code, notes, and snippets.

@heriipurnama
Last active May 6, 2023 14:03
Show Gist options
  • Save heriipurnama/f5199ccef8e2e1c57fce310b8c90e1c8 to your computer and use it in GitHub Desktop.
Save heriipurnama/f5199ccef8e2e1c57fce310b8c90e1c8 to your computer and use it in GitHub Desktop.
Fix grub rescue on English version of Linux
1. There is a mistake when booting like
Error: no such partition.
Entering rescue mode ...
grub rescue>
2. Check where the Linux File partition is stored using the command> ls
grub rescue> ls
(hd1) (hd1, gpt9) (hd1, gpt8) (hd1, gpt7) (hd1, gpt6) (hd1, gpt5) (hd1, gpt6) (hd1, gpt5) (hd1, gpt2) (hd1, gpt1)
grub rescue> ls (hd1, gpt9)
error: uknown system file [this error indicates the system file that has linux content is not there]
grub rescue> ls (hd1, gpt6)/
lost + found /bin /boot /cdrom /dev /etc /home /lib /lib64 /media /mnt /opt /proc /root /run /sbin
/srv /sys /tmp /usr /var /vmlinuz vmlinuz.old initrd.img initrd.img.old .... [here is the SystemLinux file]
check again to make sure.
grub rescue> ls (hd1, gpt6)/boot
./ ../ device.map stage1 stage2 e2fs_stage1_5 fat_stage1_5 jfs_stage1_5
minix_stage1_5 reiserfs_stage1_5 xfs_stage1_5 default installed-version menu.lst
Conclusion: linux system partition is in (hd1, gpt6)
3. Grub settings
grub rescue> set prefix=(hd1, gpt6)/boot/grub
grub rescue> set root=(hd1, gpt6)
grub rescue> set
grub rescue> normal insmod
grub rescue> normal
yes ... yes ... yes ... it has entered lining linux here is assumed to use ArchLinux linux for other distributions,
not that different.
4. For the permanent boot settings so that "grub rescue>" doesn't appear again
use the root user or user who has sudo access rights
$ sudo update-grub
$ sudo grub-install /dev/sda # where /dev/sda #where your boot drive
@mmrasheed
Copy link

It was very helpful, thanks! However, there is an error or difference in command for ubuntu at-
"grub rescue> normal insmod
grub rescue> normal"

For ubuntu it is -
grub rescue> insmod normal
grub rescue> normal

@codelif
Copy link

codelif commented May 6, 2023

It was very helpful, thanks! However, there is an error or difference in command for ubuntu at- "grub rescue> normal insmod grub rescue> normal"

For ubuntu it is - grub rescue> insmod normal grub rescue> normal

It is insmod normal, I believe it is a typo, by the author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment