How to Reinstall Grub When Ubuntu or Linux Mint Won’t Boot

November 1, 2013 — 18 Comments

repair, reinstall, restore grub

Grub 2, the Ubuntu and Linux Mint’s default bootloader typically gets overridden when you install Windows as a dual-boot OS. To make Ubuntu and its derivatives boot again, you need to reinstall (repair/restore) Grub using a bootable Ubuntu/LinuxMint CD or USB.

Typically you’ll get the following error boot screen:

error: no such partition.

grub rescue> _

Tutorial Objectives:

  • Reinstall Grub 2 when Ubuntu or Linux Mint won’t boot
  • Enjoy!

To get started, insert your Ubuntu USB into computer and boot up. When you’re in, follow the steps below to reinstall grub 2:

1. Open Gparted Partition Editor from Unity Dash to check out which partition your Ubuntu/Linux Mint system installed. It is usually a EXT4 Partition.

In my case, there’re 3 Ext4 partitions. We can check the user names on each partition after step 2 by command cd /mnt/ && ls home/

gparted partition editor

gparted partition editor

2. Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command below to mount the partition:

sudo mount /dev/sda7 /mnt

3. Now reinstall Grub2 via command below:

grub-install --root-directory=/mnt /dev/sda

If the installation is successful, you will get the similar output:

Installation finished. No error reported.

4. Finally update grub boot loader and done!

sudo update-grub

I'm a freelance blogger who started using Ubuntu 5+ years ago and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me on Google Plus or email to ubuntuhandbook1@gmail.com

18 responses to How to Reinstall Grub When Ubuntu or Linux Mint Won’t Boot

  1. When I type in “sudo mount /dev/sda7 /mnt” it says

    unshare failed: Operation not permitted
    grub-probe: error: failed to get canonical path of /cow.
    mkdir: cannot create directory ‘/mnt/boot/grub/i386-pc’ : Permission denied

    What should I do?

    • Try:

      Run the command below to get super user privilege:

      sudo -i

      Then run previous command without sudo:

      mount /dev/sda7 /mnt

      Make sure “/dev/sda7″ is the broken Ubuntu partition

  2. Thanks for the reply.
    Got the second command to work but then when I try the third

    mint ~ # grub-install –root-directory=/mnt /dev/sda
    grub-probe: error: failed to get canonical path of /cow.
    Path `/mnt/boot/grub’ is not readable by GRUB on boot. Installation is impossible. Aborting.

  3. This might be more helpful

    mint@mint ~ $ sudo mount /dev/sda2 /mnt
    mint@mint ~ $ grub-install –root-directory=/mnt /dev/sda
    unshare failed: Operation not permitted
    grub-probe: error: failed to get canonical path of /cow.
    rm: cannot remove ‘/mnt/boot/grub/i386-pc/915resolution.mod’: Permission denied
    mint@mint ~ $ sudo -i
    mint ~ # grub-install –root-directory=/mnt /dev/sda
    grub-probe: error: failed to get canonical path of /cow.
    /usr/sbin/grub-bios-setup: warning: this GPT partition label contains no BIOS Boot Partition; embedding won’t be possible.
    /usr/sbin/grub-bios-setup: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
    /usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
    mint ~ #

    • Hi Jake,

      I’m having exactly the same issue. Did you find any solution?
      I believe the reason why that does not work for us is because we are not using MBR but UEFI boot. Is that correct?

      • No solution yet Ill let you know
        I was reading around and I read a lot about the MBR and UEIF boots but could not find the option in the boot menu. I think sometimes UEIF is called “legacy” or something close incase you have that option.

        • Hi Diego & Jake, i’d the same error by reinstalling grub2. I followed the guid here: http://community.linuxmint.com/tutorial/view/245
          but i got also the message: grub2 failed to get canonical path
          and a message that the installation was successfully finished (?) a reboot later – it wasn’t -.-
          My PC has 2 SATA drives, SATA1 for windows SATA2 for Linux Mint, here is also the additional /boot partition. Anyway: i found the solution by using boot-repair. This program detects linux, where the bootloader is and install grub2 again.
          The steps are described here: https://help.ubuntu.com/community/Boot-Repair
          I booted the LM 14 Live DVD and installed boot-repair via terminal. After the reboot the problem was solved :) but another steps up :( Windows XP won’t boot anymore “hal.dll is missing”. The solution here was a reboot into the recovery console and let run the “chkdsk /r” – everything was fine. I finally edited under LM the boot.ini.A entry below [operation systems] has pointed to a wrong partition. If you’re not sure where the correct location is, but you know it’s e.g. the 1. disk in your system, just copy and paste the entry below [operation systems] e.g. 4times (4 partitions) and increase / decrease the last number e.g.
          multi(0)disk(0)rdisk(0)partition(1)\winnt = “Windows NT-1″ /NODEBUG C:\ = “Previous Operating System on C:\”
          multi(0)disk(0)rdisk(0)partition(2)\winnt = “Windows NT-2″ /NODEBUG C:\ = “Previous Operating System on C:\”
          multi(0)disk(0)rdisk(0)partition(3)\winnt = “Windows NT-3″ /NODEBUG C:\ = “Previous Operating System on C:\”
          multi(0)disk(0)rdisk(0)partition(4)\winnt = “Windows NT-4″ /NODEBUG C:\ = “Previous Operating System on C:\”

          Try out which entry let you start your OS and get a beer or wine :)

          https://support.microsoft.com/kb/314081/de

    • Realizing this is a 1.5 year-old post.

      I also had a problem with “failed to get canonical path of /cow” errors. But, after hunting around, finding a partial solution at community(dot)linuxmint(dot)com, and piecing it together with another piece of information successfully led to using Mint LiveCD to reinstall grub2.

      I posted a tutorial ‘How to Reinstall grub2 Using Mint LiveCD!’ https://community.linuxmint.com/tutorial/view/2283

  4. hi, i tried booting with a live dvd (and also tried it with a usb) but it won’t. It just goes straight to Grub rescue and it does not allow me to change my boot preferences (tried pressing F9 and F12 but nothing changes,it just goes straight to grub rescue)

    • Some CPUs/Laps is ESC, F2, F10 or SUP it depends on the computer.. check your manual or enter in the BIOS to change the default option to boot

  5. i am really realy needing help with my laptop its a dell inspiron N5030 it will not boot or open windows and its saying no such partition grub rescue

  6. Nonya F Bizzness February 16, 2015 at 6:09 am

    Everything worked for me until the sudo update-grub command returned the error “grub-probe: error: failed to get canonical path of /cow.” I was able to boot into Linux Mint, and from a root terminal run grub-update sucessfully. I hope that this can help someone.

  7. Thanks for the guide. Unfortunately, what’s lacking is (an explanation of) how you chose partition /dev/sda7 out of the 3 EXT4 partitions found. What did you do that led you to conclude this right? Does it have to be the /boot partition. Since sda6 has a ‘/’ mount point, I was thinking this would be where to install grub (if we’re not looking for the /boot partition). Please help with that. Thanks.

  8. This worked for Lubuntu 14.04 too. Cheers.
    Though I had to ID the partition in Disk Manager and needed to add a ‘sudo’ to the grub install command. Thanks. You’re a superstar.

  9. The grub-install didn’t work for me. i got:

    grub-install: error: cannot open directory `/mnt/boot/grub/i386-pc’: No such file or directory.

  10. I found a stupid/simple fix to the /cow problem:
    In a root shell (“sudo su”), do this:
    dd if=/dev/zero of=/cowfile bs=1024 count=1024
    mkfs.fat /cowfile
    mv /cowfile /cow

    This creates a 1MB file with a FAT filesystem in it, and moves it to /cow, which is the “fake” path that grub-mkconfig can’t find. With it in place, /cow looks like an empty FAT partition to grub-mkconfig, and will be quietly ignored.

Leave a Reply

*

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>