How to Fix the GNU GRUB Bootloader After Accidentally Deleting Ubuntu in Dual Boot Setup

toofaan

New Member
Joined
Nov 29, 2024
Messages
1
Reaction score
0
Credits
11
I accidentally deleted ubuntu on windows disk management which is enabled in dual boot. Now the laptop is turned ON it shows GNU GRUB Version 2.12. Is it possible to fix it? How?
 

Attachments

  • IMG_20241129_184109~2.jpg
    IMG_20241129_184109~2.jpg
    339.1 KB · Views: 45


Is it possible to fix it? How?

Regrettably, it is likely to need a reinstall, unless you meet one of the following criteria -
  • You had Timeshift installed on Ubuntu and have a current snapshot stored on a different drive
  • You have or make a rescue disk or USB stick with something like Christophe Grenier's TestDisk and PhotoRec included on it. If using TestDisk, it may well require a deep scan (time-consuming), and prospects of success will be reduced if data is written to the area Ubuntu was on
Although that grub prompt you have can often be worked with, it cannot succeed when the underlying distro is gone.

HTH

Chris Turner
wizardfromoz
 
You can boot your windows recovery media & execute the command to fix the boot of windows. It's the same command (can vary on windows version/product) you should have run before you removed the OS that controlled your machine boot (bootrec etc)
 
I presume this be a recent-ish laptop...

Using BIOS:
(F2, F10, Del -- depending on make/model -- when you reboot)
Option 1:
There should be an OS recovery option in the BIOS menu (9/10 times).
Option 2:
Alternatively your BIOS may let you browse to boot the Windows EFI instead of GRUB. You're looking for this:
/EFI/Microsoft/Boot/bootmgfw.efi on the main/only drive

Using the GRUB prompt:
Alternatively, from the GRUB prompt, find what partition Windows is on:
1. List all partitions:
ls
Output will look something like:
(hd0), (hd0,msdos1), (hd0,msdos5)
2. Search paritions for 'Windows' directory.
ls (hdX,msdosX)/ -- where X is a number for the disk("hd" -- you probably only have one) and partition.
So it may look like so: ls (hd0,msdos1)/
Keep searching each of the partitions you got from step #1 until you find you a partition with a "Windows" directory.
3. Then set that partition as root partition:
set root=(hdX,msdosX) -- where X matched the search for 'Windows'
4. Set up for loading MS bootloader from current bootloader (sounds fit for a meme)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
5. Boot:
boot

Using a LiveCD:
If you have a second PC, download antiX and use the boot recovery menu. https://antixlinux.com/download/
(The reason I don't suggest a rescue CD is antiX is bloody useful as a portable USB OS for all kinds of tasks. I use it in place of system rescue disks as I can boot it on other people's Windows machines and get a Linux environment ;) )
You can also also reinstall GRUB if you wish.

Final notes:
As for your Ubuntu install, it's toast. You killed it with Windows Disk Manager. The data itself still exists, but the partition is gone (if I understand your post, "deleted" ubuntu). Nothing can bring it back (well, nothing feasible). Your data may be retrievable via forensic tools, if you didn't format it or overwrite it with data, so you could boot into a live forensics Linux CD and see what you can do.
 

Members online


Top