How do I totally remove grub and install it fresh so it works? (dual boot problem)
Run sudo update-grub
on your LiveCD. If that fails, follow the below directions.
For Windows, you will need to manually repair your bootloader.
On the LiveCD, run lsblk
.
One of the entries should have lots of sub-entries. It should look something like /dev/sda
. Remember what it is!
Then, run sudo grub-install /dev/sda
(or whatever it is, you found out above).
Reboot and enjoy.
If you get the infamous cow
error message, run these commands:
First off, mount your Linux partition using this command:
sudo mount /dev/sda1 /mnt #Replace sda1 with appropriate partition
Then, run:
sudo grub-install --root-directory=/mnt /dev/sda
Related videos on Youtube
Dana LaBerge
Updated on September 18, 2022Comments
-
Dana LaBerge over 1 year
Okay, so here it goes. I have two hard drives. One is a 1TB drive that I have Win 7 on, the other is a 250GB that I have Ubuntu on. Both installs work fine, neither is corrupted. I installed Win 7 Ultimate first because I know it screws up grub on a system with Ubuntu installed first. Then after I got it pretty much totally set up, I restarted because of updates. Then, with it restarting, I installed Ubuntu on the other drive by letting it install what it needed automatically. When I restarted, it went to grub, of course. However, that's when I noticed the problem. There was no entry for Windows. I restarted onto the Boot Repair live disk (results at http://paste.ubuntu.com/8405452) but it seems to have cloned the failed grub from the other disk to the Windows hard drive, as that one only sees Ubuntu as well.
How do I completely remove grub and then install it as fresh? I have the grub 2 disk as well as all install media I need for any of the operating systems I have installed.
-
oldfred over 9 yearsOne disadvantage of Boot-Repair is with multiple drives it just installs grub to every MBR. Often you want grub just on Ubuntu drive and keep Windows boot loader on Windows drive. But in Boot-Repair's advanced mode you can choose to install a Windows boot loader to which ever drive is Windows if not sda. And in BIOS set to boot from sdb. You can also use Windows to repair the MBR with the fixMBR command. Auto installs of Ubuntu always install grub boot loader to the MBR of sda. Better to use Something Else so you can choose which drive's MBR to install the boot loader into.
-
oldfred over 9 yearsCorrection: You installed Windows to one drive, with BIOS set to default boot from other drive. Windows then installed its 100MB boot partition on the now Ubuntu drive. And installing Ubuntu erased the Windows Boot partition. You can only repair Windows with a Windows repair CD or flash drive or your installer. You need to add bootmgr & BCD into main install on sdb. Make sure BIOS is set to boot from that drive when repairing or disconnect Ubuntu drive.
-
Dana LaBerge over 9 yearsBetter correction: I installed Windows without the other drive in the machine, then put in the other drive, set to boot from CD then the other drive & installed Ubuntu. This worked for years because grub saw the other hard drive and installed correctly. Grub is now on both drives thanks to boot repair, but can only see Ubuntu, so even setting BIOS to boot from the Windows drive means it only boots Ubuntu. I tried repairing from the windows repair & install media, both of which failed. I want to uninstall grub altogether & fresh install on the Ubuntu drive & set that in BIOS as my boot device.
-
oldfred over 9 yearsYour Boot script shows no 100MB Windows boot partition. Normal installs of Windows put that on drive set as boot in BIOS. But you can directly boot main install if you repair it with Windows to add bootmgr & BCD. Those repairs should also install Windows boot loader to the Windows drive. For Windows repairs to work, Windows drive must be default in BIOS, and you must have a boot flag on the NTFS partition. If running autofix then you have to run it 3 times. Or use command line and run the commands.
-
-
Dana LaBerge over 9 years"sudo update-grub" result was "/usr/sbin/grub-probe: error: failed to get canonical path of '/cow'." and so did "sudo grub-install /dev/sda. what does that mean? Also, how can I remove grub from my Windows hard drive (sdb) So I can at least still boot to it?
-
Kaz Wolfe over 9 yearsI assume your Linux partition is at
/dev/sda1
? Edited post -
Adil Saju over 3 yearsUnderrated answer. Thank you!