Fixing grub rescue

14,520

Boot on Ubuntu with Ubuntu Live DVD/USB and executesudo fdisk -l, note your hdd ID (sda in your case)

Now sudo apt-get update && sudo apt-get install syslinux

Finally sudo dd if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sda

Exit and you can now reboot on Windows. Hope it helps, thanks

Share:
14,520

Related videos on Youtube

Abhishek Bhatia
Author by

Abhishek Bhatia

"The purpose of computing is insight, not numbers."- Richard Hamming, 1961 Abhishek has had a unique interdisciplinary research exposure to AI systems. His projects range from designing artificially intelligent autonomous systems that operate in varied setups, all the way to studying common emergent phenomena in natural systems. He has published 5 research papers in the field of complex systems, artificial intelligence and statistical inference. He is currently working on Deep Reinforcement Learning applications for Natural Language Processing and General-game Playing. He is also enthusiastic about open-source tools and frequently contributes to many open-source projects.

Updated on September 18, 2022

Comments

  • Abhishek Bhatia
    Abhishek Bhatia over 1 year

    I removed the ubuntu partition from windows and extended the volume to a existing windows partition. Earlier I had a dual boot windows and ubuntu. Now it shows me the grub rescue.

    grub rescue>ls

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

    I loaded a livecd of ubuntu and did boot repair. Still it is showing grub resue. And I don't have a windows cd.

    After trying doing a

    "ls (hd0,msdos1) /boot" 
    

    on all of partition shown by ls[1]. In each case, it shows Filesystem is unknown.

    In the liveCD, I get this:

    sudo fdisk -l
    Device     Boot     Start        End   Sectors   Size Id Type
    /dev/sda1            2048   31791103  31789056  15.2G 27 Hidden NTFS WinRE
    /dev/sda2  *     31791104   32507903    716800   350M  7 HPFS/NTFS/exFAT
    /dev/sda3        32507904  780682991 748175088 356.8G  7 HPFS/NTFS/exFAT
    /dev/sda4       780685310 1465147391 684462082 326.4G  f W95 Ext'd (LBA)
    /dev/sda5       780685312 1465143607 684458296 326.4G  7 HPFS/NTFS/exFAT
    

    I don't have any linux partition, should I install linux? Is there anyway to fix this?

    Gparted: enter image description here

    • Abhishek Bhatia
      Abhishek Bhatia about 8 years
      @Zacharee1 I tried ls (hdX,msdosX) \ boot on all partitions. All of them show Filesystem is unknown.
    • TheWanderer
      TheWanderer about 8 years
      I don't see that command in the answer there. Follow the procedure exactly.
    • Abhishek Bhatia
      Abhishek Bhatia about 8 years
      @Zacharee1 I can't identify the partition. Please check question again, I have edited.
    • TheWanderer
      TheWanderer about 8 years
      I think you need to burn a Windows install disc and use it.
    • Abhishek Bhatia
      Abhishek Bhatia about 8 years
      @Zacharee1 Does it make sense to install linux from a liveCD and then try maybe?
    • TheWanderer
      TheWanderer about 8 years
      Then you'll just be back with Ubuntu installed. If you remove it, you'll be back in this situation. Can you take a screenshot of what Gparted shows in the LiveCD?
    • Abhishek Bhatia
      Abhishek Bhatia about 8 years
      @Zacharee1 okay. I have added a gparted screenshot. Please check.
    • Abhishek Bhatia
      Abhishek Bhatia about 8 years
      @Zacharee1 To be clear, I removed the ubuntu partition from windows and extended the volume to a existing windows partition.
    • TheWanderer
      TheWanderer about 8 years
      I'm not very familiar with MBR, but I think your only option is to get a Windows install medium and use its command prompt to fix boot.
    • Arijit Chatterjee
      Arijit Chatterjee about 8 years
      Install EasyBCD on Windows and you can resolve your problem from there.
  • Abhishek Bhatia
    Abhishek Bhatia about 8 years
    Thanks for answer! But I am getting this error while running it : ubuntu@ubuntu:~$ sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda dd: failed to open ‘/usr/lib/syslinux/mbr.bin’: No such file or directory
  • Arijit Chatterjee
    Arijit Chatterjee about 8 years
    Possibly a change in mbr location, try /usr/lib/syslinux/mbr/mbr.bin
  • Abhishek Bhatia
    Abhishek Bhatia about 8 years
    Thanks so much! That works! If possible please provide some explanation. I have limited to no knowledge about mbr.
  • Arijit Chatterjee
    Arijit Chatterjee about 8 years
    Dear Abhishek, I suggest you to read more on Google about it, as I am not an expert too. Regards