This tutorial is all about how to Fix Grub Bootloader after Deleting Ubuntu Partition?
If you are trying to use dual boot OS setup on a pc with Ubuntu and Windows, then it is really a handy idea. While setting the system up like this, be very careful with all the aspects of the installation. But, if somehow accidentally you deleted the Ubuntu Linux partition from Windows (which is something not to be done anyway), then you are left with no way to go back, and also you will not find a way to boot into your windows system. As the action of deleting the Linux partition from windows lead you to a situation where only the grub rescue prompt is visible whenever you restart the pc because your Grub Bootloader is all messed up now. In this article, we are about to discuss the solution of this problem step by step.
This problem can be solved by fixing the Grub Bootloader Configurations. This solution has been tested many times to make sure that it works, I even tested it by myself once, so this procedure is foolproof for sure (for most of the devices). There are normally two scenarios one may end up within this kind of Bootloader error.
We will discuss those scenarios one by one.
Not showing or Can’t Boot into Windows on Ubuntu & Windows Partition
(While booting into Ubuntu is still working)
This type of issue can even arise when you have both the OS (Ubuntu & Windows) installed on your pc systematically. In this kind of scenario, both Ubuntu and Windows 10 partitions are intact within your Hard Disk drive. Still, you are facing the problem, which means the Grub menu is unable to show the Windows boot option. If this is the case with you, there is quite a simple solution to get out of this problem, the bootloader can be brought back as well as the Windows Boot Option into the OS Selection menu at the time of system startup.
Things need to be noted before implementing this solution:
- Both Ubuntu and Windows Partition still exist on the HDD.
- None of the OS corrupted.
- Windows boot option is not shown on the bootloader list.
- Switch on the pc and try to boot into Ubuntu OS normally
- When at the desktop, launch the Linux command Terminal by pressing Ctrl+Alt+T
- Type the given command in the terminal window, “sudo update-grub”
- Now press Enter Key
- Type in your own sudo password when asked by the system, to execute your command.
- For reference, you can see the given image below
- Now you can see in the terminal window, that the processing is going on hence, the system is generating the grub configuration file again. After a few moments, once it found Windows (10) bootloader within the HDD, it will prompt you again.
- Now restart the Pc. When the system boots up again, you will see automatically the option to boot into Windows is available in there again.
How to restore Windows bootloader after deleting Ubuntu Partition: Grub rescue
(Cannot boot into Ubuntu)
Dual booting is a great way to increase range of functionality as well as productivity in a pc. As the user able to use both the platforms according to need. Also, one OS can be used to recover corrupted data by using another OS. It is also a good idea to get the most juice out of an old laptop. Most of the users use this technique to have it as an advantage, as this setup can help the user to get the work done even when one OS failed to do the job. However, in a complex setup like this, it is also easy to get into trouble if the user accidentally or intentionally deleted the Ubuntu Linux partition. If you are using such dual boot system, it is advised that do not let use your pc used by anyone else. Whatever the reason is, deleting the Ubuntu partition will definitely mess up the Windows Boot Manager. So, while the Linux partition is deleted from the HDD and the user restart the pc, he/she will end up in the grub rescue prompt by default.
Now we are going to talk about the solution for this bootloader corrupted issue…
Things that need to meet before implementing this part of the tutorial:
- Your pc had Dual boot setup.
- The Ubuntu partition is deleted from Windows OS somehow.
- Definitely Not Booting into Windows OS anymore.
- By default, keep showing grub rescue prompt on the screen.
Requirements for the Solution
- A bootable Ubuntu USB drive or CD drive.
- In case of laptop connect the charger, as it is going to take a while.
- A working internet connectivity (If your pc has a problem with Wi-Fi connectivity like missing driver or something, then the connection may not be possible, in that case only a LAN connected pc will work).
- Insert the Ubuntu bootable USB or CD whatever you are using.
- Reboot the system
- Enter into System BIOS Settings (by pressing Ctrl+Alt+Del or F9 or F2 or Del, it depends on your Motherboard manufacturer.)
- Select the Ubuntu USB or CD to boot from on BIOS Setting as the first booting device priority.
- Wait for the of booting process to be completed from USB/CD.
- First try your luck with the “Try Ubuntu without Installing” option, as there is actually no need to reinstall the Ubuntu OS actually. Now a day most of the Linux distros has the facility of trying the OS without even installing it on the HDD. This will directly run the OS from the USB/CD.
- Launch the Terminal by pressing Ctrl+Alt+T from Ubuntu desktop.
- Now type in the following command “sudo apt-get install lilo” and press Enter, now this command will try to download the package over the internet and will install it automatically.
- Hit Enter when the next dialog box that appears for the permission.
- Now again, enter the command “sudo lilo -M /dev/sda mbr” and press Enter.
- This command will automatically create a backup of the current configurations in a boot backup folder within the HDD, and if everything is completed successfully the it will show a successful completion message on the Ubuntu terminal stating “The Master Boot Record of /dev/sda updated”.
- This is it, now you are ready to restart the pc and also you should remove the USB/CD from the system. Now after fresh start the system will boot right into Windows OS as the default system.
I hope these methods helped you and your problem is solved. These given methods are better than reinstalling the OS again, as this will save your time as well as your valuable data. For any more problem’s solution related to LINUX keep connected with our website, and do not think that you are one of those very few who uses dual bootloader system, as there are thousands of users around the world who use this type of setup including me and my team and many IT professionals.
Other Useful Resource:
- How to create an active partition in Windows 10,8,7 & XP via command prompt
- 5 Best Linux Distros looks like Windows 7/10/XP Interface