Have you ever encountered the below error (it occurs mostly on linux):
Minimal bash-like editing is supported. For the first word, TAB listing is possible with possible command completions
Anywhere else TAB is used, possible device or file completions are done. ESC anytime exists.
If you however use Windows, click here
Cause:
** Overwritten bootloader: ** When two partitions exist (windows and linux) one's bootloader may overwrite GRUB
** Accidental deletion: ** You may have deleted grub configuration files eg boot/grub/grub.cfg
** GRUB ** GRand Unified Bootloader is responsible for showing you selection of Operating system after booting
Perform the below set of commands for each partition listed:
grub> ls
#This lists all partitions of your system
(hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
grub> ls (hd0,msdos1)
#Let us assume this is the partition containing the system files
grub> set root=(hd0,msdos1)
#Setting this particular partition as root
grub> set prefix=(hd0,msdos1)/boot/grub
#Setting this partition as the prefix
grub> insmod normal
grub> normal
After regaining access, reinstall and update you grub
It is stored in
/boot/grub
for legacy BIOS and boot/efi/grub
or
/efi/grub
for UEFI
Install G-parted or gnome disks
sudo apt install gparted
sudo apt install gnome-disk-utility
To reinstall and update grub, we run:
sudo grub-install /dev/sdXY
#X is the disk number and Y is the partition number of EFI
sudo update grub
Reboot your system and confirm if the error persists
Pictures used belong to twitter user
@known_mike
Further reading:
https://twitter.com/Known_Mike/status/1553180270815223809