GRUB rescue problem after deleting Ubuntu partition!

899,297

Solution 1

Try the following ..

grub rescue > ls
(hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
grub rescue > ls (hd0,msdos1) # try to recognize which partition is this
grub rescue > ls (hd0,msdos2) # let's assume this is the linux partition
grub rescue > set root=(hd0,msdos2)
grub rescue > set prefix=(hd0,msdos2)/boot/grub # or wherever grub is installed
grub rescue > insmod normal # if this produced an error, reset root and prefix to something else ..
grub rescue > normal

For a permanent fix run the following after you successfully boot:

sudo update-grub
sudo grub-install /dev/sdX

where /dev/sdX is your boot drive.

Solution 2

To remove GRUB just download Windows 8 or 10 from another PC. Burn the iso into the USB with Rufus. Boot from USB, click Troubleshooting, then Command Prompt, and type:

Bootrec /fixmbr  

Windows will start normally without Ubuntu's GRUB. You can reinstall Ubuntu again.

Solution 3

Boot your computer on a Ubuntu live-CD or live-USB

then follow the section 2nd option : install Boot-Repair in Ubuntu from this link:

https://help.ubuntu.com/community/Boot-Repair

Solution 4

I did the same thing. Deleted Ubuntu partition. I am able to enter into BIOS.

If you have a bootable USB for Ubuntu, enter BIOS and choose the USB first in boot sequence. Restart. Then install Ubuntu again. And you can delete SAFELY this time.

Share:
899,297

Related videos on Youtube

user302065
Author by

user302065

Updated on September 18, 2022

Comments

  • user302065
    user302065 over 1 year

    After I deleted my Ubuntu partition, I rebooted my computer and I only get a prompt:

    grub rescue >
    

    The command ls lists

    (hd0) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos1)
    

    I check them one by one:

    ls (hd0,msdos5)/
    ls (hd0,msdos1)/
    

    But I cannot find the right partition.

    • Dalton
      Dalton almost 10 years
      Do you have another linux installation on your computer?
    • user302065
      user302065 almost 10 years
      No, just ubuntu 13.04, but dual with win 7
    • user302065
      user302065 almost 10 years
      And when I tried rebooting by usb or dvd, it said " Error loading operating system"
    • Elder Geek
      Elder Geek almost 10 years
      It's unclear what you are asking. Please define "right partition" Are you trying to recover a partition that you accidentally deleted?
    • MagTun
      MagTun over 8 years
      I can't post an answer so I write my answer her: create a ubuntu bootable USB, then launch ubuntu from the USB, launch ubuntu terminal and write sudo apt-get install syslinux ENTER and then sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda. To create a bootable USB : ubuntu.com/download/desktop/create-a-usb-stick-on-windows, to launch ubuntu from the usb, press F11 or F12 when your computer boot (before windows start). To launch ubuntu terminal Ctrl - Alt + T
  • Rafed Nole
    Rafed Nole almost 10 years
    grub rescue > ls (hd0,msdos1) # try to recognize which partition is this -----> I am getting error : Unknown filesystem in each of the three partitions I get listed by the ls Command.Please help.Thanks.
  • Aakash
    Aakash almost 9 years
    the ls commands should be like "ls (hd0,msdos1) /boot"
  • samsamara
    samsamara almost 9 years
    this worked for me as well! but next time when i restart the machine i had to issue the same commands again. how do i resolve that?
  • Amr Ayman
    Amr Ayman almost 9 years
    @KillBill: insmod inserts the normal module to kernel using the root and prefix variables that are responsible for configuring the boot operation. A solution I can think of is to use the enhanced version of insmod, modprobe and run: modprobe normal from your installation. I don't really expect this to work, just tell me what output you get.
  • samsamara
    samsamara almost 9 years
    thanks for the reply. but i fixed it by login in through a live USB and issuing 'update-grub' command
  • ArcaneDominion
    ArcaneDominion almost 8 years
    This works and I'm able to boot. But I face this problem every time I boot, and I have to repeat this. How do I make this solution permanent?
  • Amr Ayman
    Amr Ayman almost 8 years
    @Jim See comment above
  • ArcaneDominion
    ArcaneDominion almost 8 years
    @AmrAyman I did run update-grub upon booting, but not from a live USB. That didn't fix the problem.
  • Heena
    Heena about 7 years
    I run the command without the dot at the end:Bootrec /fixmbr
  • Gondrup
    Gondrup about 7 years
    Great instructions, got my system back up and running in a couple of minutes thanks!
  • Sigur
    Sigur almost 7 years
    @AmrAyman, after I tried those 2 last commands, no success. I have to repeat every time. Do you have idea?
  • Amr Ayman
    Amr Ayman almost 7 years
    Yes. Look here.
  • Yasser Mohseni
    Yasser Mohseni over 6 years
    I had the same problem and after a day of searching and trying I think this is the best solution in this case. I have win 10 (UEFI) which works normally. I want to remove grub resuce from my legacy bios and install a new Ubuntu there. However, my laptop does not have CD-ROM. I had created a bootable USB for Ubuntu that worked perfectely for me before. But now the grub rescue refuses to acknowlege it and says uknown filesystem for all the partitions (including the inserted USB). I believe I would have the same problem with bootable USB for windows. So how can I get rid of grub rescue?
  • Admin
    Admin over 6 years
    It seems that you are not booting from USB correctly! Select your usb from BIOS settings before grub appear!
  • mgiuca
    mgiuca over 6 years
    Fantastic! It works. One helpful thing would be that you can type ls (hd0,msdos1)/ (the trailing slash is important) in order to actually show you the files on the drive.
  • Anusha Prasanth
    Anusha Prasanth over 6 years
    I tries 'ls (hd0,msdos1) /boot' for all. it shows 'unknown filesystem'. what should I do? Please help
  • Giszmo
    Giszmo about 6 years
    On the machine I try to rescue, I find (hd0,msdos1)/grub/grub.cfg, accordingly set root=(hd0,msdos1) and set prefix=(hd0,msdos1)/grub but insmod normal only gives me an error: file not found.. What gives?
  • hakatashi
    hakatashi almost 6 years
    I tried boot-repair and still got black screen. In my case the problem was boot-repair attempted to repair my SD-card on laptop (based on log). So I removed the card from PC and re-ran boot-repair, then the boot was repaired.
  • lmeurs
    lmeurs about 5 years
    Worked exactly as described on a dual boot PC with Ubuntu 14.04 and Windows 7 after removing an empty partition, thanks a million! NB: for finding the boot drive, see askubuntu.com/a/542360/438017
  • reducing activity
    reducing activity over 4 years
    Can I legally install Windows 7 this way? I have Windows 7 recovery partition and I am both unable and uninterested in installing Windows 8 on that computer.
  • Joshua Detwiler
    Joshua Detwiler about 4 years
    It's very important circa 2020 to recognize that fixmbr commands will restore an MBR style boot. If you had UEFI before, it would now be MBR again. I don't see many correct answers floating around, so if you've already fallen into that place, you should look into Windows' mbr2gpt program which is part of the WinPE bootable. It's an absolute PAIN to use, but it works to get your disk back to GPT/UEFI. It possibly also has repair tools to restore a UEFI setup supposing you didn't run fixmbr.
  • mon
    mon about 3 years
    Boot from USB -> "Repair Windows" instead of "Install Windows", then "Trouble Shooting".