Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

50%
+0 −0
Q&A Grub rescue error

If you print out ls than you will see disks. You have to check which have your Linux. One by one you have to try following commands. set boot=(hd0,msdosN) #N is number is disk. set prefix=(h...

posted 3y ago by deleted user

Answer
#1: Initial revision by (deleted user) · 2021-05-27T14:49:29Z (over 3 years ago)
If you print out `ls` than you will see `disks`. You have to check which have your Linux. One by one you have to try following commands.

![code](https://i.stack.imgur.com/QwMos.png)

```
set boot=(hd0,msdosN)    #N is number is disk.
set prefix=(hd0,msdosN)/boot/grub
set root=hd0,msdosN   
insmod normal
normal
reboot
```

Then, you have to update grub loader. 

```
sudo update-grub
```

Above solution may work for you. But, if it doesn't work than try following process. You need live bootable USB for this process. Start Ubuntu, Mint, Kali or any debian-based linux than write following commands in terminal.

```
sudo mount /dev/sda5 /mnt   #/dev/sda5 is where you installed your Linux Distro
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
```