[SOLVED] Windows install broke grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

[SOLVED] Windows install broke grub

Post by Reljoy »

Installed win xp
Dual boot installed Mint 17.1 Mate 64bit
Installed win 8 to upgrade the windows XP partition
Lost my grub boot menu.


Now when I try to
sudo grub-install /dev/sda
I get
Grub-probe: error: failed to get canonical path of '/cow'.
Installing for i386-pc platform.
Grub-install.real: error: failed to get canonical path of '/cow'.

If i try
Sudo mount /dev/sda2 /mnt/boot
It says
Mount: mount point /mnt/boot does not exist

I have been looking at and trying things from
https://help.ubuntu.com/community/Grub2 ... ken_System

Code: Select all

mint@mint ~ $ sudo fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00011056

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048  1024002047   512000000    7  HPFS/NTFS/exFAT
/dev/sda2      1024002048  1025025485      511719   83  Linux
/dev/sda3      1025028094  3907028991  1441000449    5  Extended
Partition 3 does not start on physical sector boundary.
/dev/sda5      1025028096  1034790911     4881408   82  Linux swap / Solaris
/dev/sda6      1034792960  1151987711    58597376   83  Linux
/dev/sda7      1151989760  3907028991  1377519616   83  Linux

Code: Select all

mint@mint ~ $ sudo blkid
/dev/loop0: TYPE="squashfs" 
/dev/sr0: LABEL="Linux Mint 17.1 MATE 64-bit" TYPE="iso9660" 
/dev/sda1: UUID="B694CBEC94CBAD65" TYPE="ntfs" 
/dev/sda2: UUID="d250d8b4-82c9-4b40-9fd1-40fb4ecf547a" TYPE="ext2" 
/dev/sda5: UUID="e56b41bd-3849-442b-8f6e-052f6ad308e3" TYPE="swap" 
/dev/sda6: UUID="29a46605-59c0-4845-b9cd-a22d5bfeb672" TYPE="ext4" 
/dev/sda7: UUID="ffd02ebf-6297-473e-a65f-f77bcb318bde" TYPE="ext4" 
I have booted from the live DVD to try to fix it and to post this request for help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pierre
Level 21
Level 21
Posts: 13227
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Windows install broke grub

Post by Pierre »

the Windows O/S typically overwrites the MBR and any boot_menu.

so - you have to boot the Mint live_disk / stick,
& you will then have to re-install the LinuxMint boot_loader AKA : GRUB_LOADER.
http://community.linuxmint.com/tutorial/view/245

& so you will have to use the live_disk to do that.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Thanks for the reply. Unfortunately I cannot get it to work.
I went to the link you gave Pierre, and steps 1 and 2 were fine:
Now we need to mount the Linux Mint partition so that we are able to use it (access it) . To do this copy and paste this code into the terminal sudo mount /dev/sdXY /mnt

Code: Select all

mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo mount /dev/sda2 /mnt
Note: sda2 is /boot
sda6 is /

But I got confused on step 3 which says:
sudo grub-install --root-directory=/mnt/ /dev/sdX

Code: Select all

mint@mint ~ $ sudo grub-install --root-directory=/mnt/ /dev/sda
grub-probe: error: failed to get canonical path of `/cow'.
Installing for i386-pc platform.
Installation finished. No error reported.
I do not know what that means but it doesn't look right to me.
You should then see a message saying Grub installer finished or something like that.

Code: Select all

mint@mint ~ $ sudo grub-install --root-directory=/mnt/ /dev/sda
grub-probe: error: failed to get canonical path of `/cow'.
Installing for i386-pc platform.
Installation finished. No error reported.
Well it did say "Installation finished. No error reported."
So now I will reboot and see if it works.
User avatar
Pjotr
Level 24
Level 24
Posts: 20140
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Windows install broke grub

Post by Pjotr »

Reljoy wrote:grub-probe: error: failed to get canonical path of `/cow'.
That particular error is harmless. You should be fine now. :)
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Well, I managed to stop it booting straight into windows.
Now it stops in grub. There is a heading :
GNU GRUB version 2.02~beta2-9ubuntu1
and a couple of sentences about Minimal BASH-like line editing being supported.
Then it has on the left hand side

Code: Select all

grub>
So I tried:

Code: Select all

mint@mint ~ $ sudo mount /dev/sda2 /mnt
mint@mint ~ $ sudo grub-install --root-directory=/mnt/ /dev/sda
grub-probe: error: failed to get canonical path of `/cow'.
Installing for i386-pc platform.
Installation finished. No error reported.
mint@mint ~ $ sudo update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `/cow'.
But it didn't work.
I do not know what to do now.
User avatar
Pjotr
Level 24
Level 24
Posts: 20140
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Windows install broke grub

Post by Pjotr »

You've got Grub back in the MBR (it replaced NTLoader from Windows), but apparently it doesn't point to your Linux root partition yet. Edit: I see that you've apparently separated /boot (sda2) from root (sda6). Why this complication?

Oh, and by the way: you shouldn't run "sudo update-grub" afterwards. That you should only do when back in your successfully booted Linux (in order to make it recognize the new Windows).
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

This looks helpful. I will reboot and try it. By putting the link here I will not lose it when I reboot with the live DVD.
http://askubuntu.com/questions/207663/c ... n-live-usb

I separate /boot from / as it was recommended in a tutorial about partitioning and installing Linux Mint. I also have a separate /home

Code: Select all

mint@mint /mnt $ blkid
/dev/loop0: TYPE="squashfs" 
/dev/sda1: UUID="B694CBEC94CBAD65" TYPE="ntfs" 
/dev/sda2: UUID="d250d8b4-82c9-4b40-9fd1-40fb4ecf547a" TYPE="ext2" 
/dev/sda5: UUID="e56b41bd-3849-442b-8f6e-052f6ad308e3" TYPE="swap" 
/dev/sda6: UUID="29a46605-59c0-4845-b9cd-a22d5bfeb672" TYPE="ext4" 
/dev/sda7: UUID="ffd02ebf-6297-473e-a65f-f77bcb318bde" TYPE="ext4" LABEL="Home" 
/dev/sr0: LABEL="Linux Mint 17.1 MATE 64-bit" TYPE="iso9660" 
sda2 is /boot
sda6 is /
sda7 is /home
User avatar
Pjotr
Level 24
Level 24
Posts: 20140
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Windows install broke grub

Post by Pjotr »

Reljoy wrote:I separate /boot from / as it was recommended in a tutorial about partitioning and installing Linux Mint. I also have a separate /home
A separate /home is no problem in this case (although I don't find that very useful, so I don't have one myself). But the separate /boot is at best a needless complication, which might well be an extra problem in this case.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo mount /dev/sda2 /mnt/boot
So far so good.

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

Code: Select all

mint@mint ~ $ sudo grub-install --root-directory=/mnt /dev/sda
grub-probe: error: failed to get canonical path of `/cow'.
Installing for i386-pc platform.
Installation finished. No error reported.
That doesn't look good. Looks like something didn't work.

Code: Select all

mint@mint ~ $ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/cow             1764912   78708   1686204   5% /
udev             1720464      12   1720452   1% /dev
tmpfs             352984    1360    351624   1% /run
/dev/sr0         1594656 1594656         0 100% /cdrom
/dev/loop0       1554816 1554816         0 100% /rofs
none                   4       0         4   0% /sys/fs/cgroup
tmpfs            1764912       4   1764908   1% /tmp
none                5120       0      5120   0% /run/lock
none             1764912      76   1764836   1% /run/shm
none              102400      36    102364   1% /run/user
/dev/sda6       57546748 5229748  49370748  10% /mnt
/dev/sda2         495560    6781    463195   2% /mnt/boot
User avatar
Pjotr
Level 24
Level 24
Posts: 20140
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Windows install broke grub

Post by Pjotr »

Reljoy wrote:mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo mount /dev/sda2 /mnt/boot
So far so good.

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

Code: Select all

mint@mint ~ $ sudo grub-install --root-directory=/mnt /dev/sda
grub-probe: error: failed to get canonical path of `/cow'.
Installing for i386-pc platform.
Installation finished. No error reported.
That doesn't look good. Looks like something didn't work.
That *does* look good! As I said before: the "cow" error is harmless. :)

I advise to try a normal boot now.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Just tried a normal boot - no luck.
It stops at grub exactly the same as before.

Code: Select all

grub>
User avatar
Pjotr
Level 24
Level 24
Posts: 20140
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: Windows install broke grub

Post by Pjotr »

Well, in this case I'd consider the "nuclear option": do a clean re-install of Linux Mint 17.1. In this case you have a separate /home anyway, so that should save you some time and trouble.

When you do this: do *not* create a separate /boot again. It's an unnecessary complication.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Windows install broke grub

Post by Laurent85 »

Reljoy wrote:

Code: Select all

mint@mint ~ $ sudo update-grub
/usr/sbin/grub-probe: error: failed to get canonical path of `/cow'.
But it didn't work.
I do not know what to do now.
You need to chroot before updating grub menu list. Try :

Code: Select all

$ sudo mount /dev/sda6 /mnt
$ sudo mount /dev/sda2 /mnt/boot
$ sudo mount -o bind /dev /mnt/dev
$ sudo -s
# chroot /mnt
# mount -t proc proc /proc && mount -t sysfs sysfs /sys && mount -t devpts devpts /dev/pts
# grub-install /dev/sda
# update-grub
# umount /dev/pts /sys /proc
# exit
another exit
# exit
$ sudo umount /mnt/dev /mnt/boot /mnt
Then reboot.
Image
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

That looks a lot better!

Code: Select all

mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo mount /dev/sda2 /mnt/boot
mint@mint ~ $ sudo mount -o bind /dev /mnt/dev
mint@mint ~ $ sudo -s
mint ~ # chroot /mnt
mint / # mount -t proc proc /proc && mount -t sysfs sysfs /sys && mount -t devpts devpts /dev/pts
mint / # grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
mint / # update-grub
Generating grub configuration file ...
  No volume groups found
Found Windows 8 (loader) on /dev/sda1
done
mint / # umount /dev/pts /sys /proc
mint / # exit
exit
mint ~ # exit
exit
mint@mint ~ $ sudo umount /mnt/dev /mnt/boot /mnt
mint@mint ~ $ 
What does this line do?

Code: Select all

sudo mount -o bind /dev /mnt/dev
And what does this line do?

Code: Select all

mount -t proc proc /proc && mount -t sysfs sysfs /sys && mount -t devpts devpts /dev/pts
About to reboot now.
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Grub menu has Windows 8 in it.
I can boot into Windows 8.

But there is no entry for Linux Mint in the Grub menu.
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Windows install broke grub

Post by Laurent85 »

Reljoy wrote:

Code: Select all

mint / # update-grub
Generating grub configuration file ...
  No volume groups found
Found Windows 8 (loader) on /dev/sda1
done 
Humm no kernel image reported by update-grub. Grub could not find any kernel image installed. Please check :

Code: Select all

$ sudo mount /dev/sda2 /mnt
$ sudo ls /mnt
$ sudo umount /mnt
$ sudo mount /dev/sda6 /mnt
$ sudo ls /mnt/boot
$ sudo umount /mnt
Please report command output.
Image
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Code: Select all

mint@mint ~ $ sudo mount /dev/sda2 /mnt
mint@mint ~ $ sudo ls /mnt
boot  grub  lost+found
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo ls /mnt/boot
grub
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ 
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Windows install broke grub

Post by Laurent85 »

Please report output command

Code: Select all

$ sudo mount /dev/sda2 /mnt
$ sudo ls /mnt/boot
$ sudo umount /mnt
$ sudo mount /dev/sda6 /mnt
$ sudo cat /mnt/etc/fstab
$ sudo umount /mnt
Image
User avatar
Reljoy
Level 4
Level 4
Posts: 311
Joined: Sat Mar 13, 2010 12:12 am

Re: Windows install broke grub

Post by Reljoy »

Code: Select all

mint@mint ~ $ sudo mount /dev/sda2 /mnt
mint@mint ~ $ sudo ls /mnt
boot  grub  lost+found
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo ls /mnt/boot
grub
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ sudo mount /dev/sda2 /mnt
mint@mint ~ $ sudo ls /mnt/boot
grub
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ sudo mount /dev/sda6 /mnt
mint@mint ~ $ sudo cat /mnt/etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=29a46605-59c0-4845-b9cd-a22d5bfeb672 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda2 during installation
UUID=2efbf722-5cd4-4f18-a1cb-dbfa18e403d0 /boot           ext2    defaults        0       2
# /home was on /dev/sda7 during installation
UUID=ffd02ebf-6297-473e-a65f-f77bcb318bde /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=e56b41bd-3849-442b-8f6e-052f6ad308e3 none            swap    sw              0       0
mint@mint ~ $ sudo umount /mnt
mint@mint ~ $ 
Laurent85
Level 17
Level 17
Posts: 7081
Joined: Tue May 26, 2015 10:11 am

Re: Windows install broke grub

Post by Laurent85 »

So your boot directory has no kernel image installed. Type this commands to fix :

Code: Select all

$ sudo mount /dev/sda6 /mnt
$ sudo mount /dev/sda2 /mnt/boot
$ sudo mount -o bind /dev /mnt/dev
$ sudo -s
# chroot /mnt
# mount -t proc proc /proc && mount -t sysfs sysfs /sys && mount -t devpts devpts /dev/pts
Cleaning boot
# rm -r /boot/*
# grub-install /dev/sda
# apt-get --reinstall install linux-kernel-generic linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic linux-image-3.13.0-37-generic linux-image-extra-3.13.0-37-generic
Reinstall shoud update initramfs & grub but to be sure :
# update-initramfs -u
# update-grub
Grub should report kernel image found
# umount /dev/pts /sys /proc
# exit
another exit
# exit
$ sudo umount /mnt/dev /mnt/boot /mnt
Reboot.
Image
Locked

Return to “Installation & Boot”