GRUB rescue problem after deleting Ubuntu partition!
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.
Related videos on Youtube
user302065
Updated on September 18, 2022Comments
-
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 almost 10 yearsDo you have another linux installation on your computer?
-
user302065 almost 10 yearsNo, just ubuntu 13.04, but dual with win 7
-
user302065 almost 10 yearsAnd when I tried rebooting by usb or dvd, it said " Error loading operating system"
-
Elder Geek almost 10 yearsIt's unclear what you are asking. Please define "right partition" Are you trying to recover a partition that you accidentally deleted?
-
MagTun over 8 yearsI 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 thensudo 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 almost 10 yearsgrub 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 almost 9 yearsthe ls commands should be like "ls (hd0,msdos1) /boot"
-
samsamara almost 9 yearsthis 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 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 almost 9 yearsthanks for the reply. but i fixed it by login in through a live USB and issuing 'update-grub' command
-
ArcaneDominion almost 8 yearsThis 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 almost 8 years@Jim See comment above
-
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 about 7 yearsI run the command without the dot at the end:
Bootrec /fixmbr
-
Gondrup about 7 yearsGreat instructions, got my system back up and running in a couple of minutes thanks!
-
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 almost 7 yearsYes. Look here.
-
Yasser Mohseni over 6 yearsI 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 over 6 yearsIt seems that you are not booting from USB correctly! Select your usb from BIOS settings before grub appear!
-
mgiuca over 6 yearsFantastic! 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 over 6 yearsI tries 'ls (hd0,msdos1) /boot' for all. it shows 'unknown filesystem'. what should I do? Please help
-
Giszmo about 6 yearsOn the machine I try to rescue, I find
(hd0,msdos1)/grub/grub.cfg
, accordinglyset root=(hd0,msdos1)
andset prefix=(hd0,msdos1)/grub
butinsmod normal
only gives me anerror: file not found.
. What gives? -
hakatashi almost 6 yearsI 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 about 5 yearsWorked 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 over 4 yearsCan 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 about 4 yearsIt'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 runfixmbr
. -
mon about 3 yearsBoot from USB -> "Repair Windows" instead of "Install Windows", then "Trouble Shooting".