How to repair GRUB for Dual Boot if you accidentally deleted it?
Recently, While trying to install windows on my System which already had Ubuntu 20.04 Focal Fossa installed in separate partitions. It happens usually when you are using two or more operating systems on Bare Metal you accidentally end up deleting GRUB while installing the New O.S.
What’s GRUB?
GRUB stands for GRand Unified Bootloader. Its function is to take over from BIOS at boot time, load itself, load the Linux kernel into memory, and then turn over execution to the kernel.
GRUB is used in order to make your system aware of the fact that Linux is installed and provides you with the functionality to navigate to your Linux.
How did I accidentally deleted my GRUB?
I was trying to install windows 10 in my HDD’s one fragment as my previous window 10 was corrupt. And I already had Ubuntu 20.04 Installed in my system.
Skip to Step 5 of the install section if you have already installed windows in your machine.
The steps that I followed to install Windows 10:
1. Create a bootable USB Disk — Tutorial that I followed
Despite trying several times to generate a bootable USB Disk using ubuntu, There were several restrictions that I faced.
Windows bootable drive needs to be in FAT32 format and while mounting the USB drive the copy restriction of 4 Gb file size.
Solution -> Ask any friend of yours to Generate windows Bootable Drive using Windows USB/DVD Download. Run the same in windows OS.
2. Followed my machine’s creator (H.P.) on how to install Windows 10.
3. While installing windows, I came across the problem “Insufficient Space to install windows in The Drive partition specified”. Whereas the partition had 150 GB free.
At this stage I searched the web about the error, The solution I found was to delete/format the recovery drive for old windows.
“This is the step where Iaccidentally deleted my GRUB”
4. After my windows finished installing, I went into the BIOS screen to find out that my Ubuntu’s Option was gone. My Linux’s partitions were intact as I was able to see the same using Try Ubuntu Mode using BOOTABLE USB UBUNTU DRIVE (generated using RUFUS).
5. The last step was finding out how to repair GRUB, Gladly I found an article in ubuntu’s help’s section.
6. I was able to repair my Grub and regain access to ubuntu already installed on my machine. Special thanks to the creators of boot-repair. This saved me the effort to reinstalling Ubuntu and also I got my data back.
That’s all about the steps which I followed to install windows 10 on my machine which already had Ubuntu 20.04 and ended up accidentally deleting GRUB. And the tool that I used to repair it.