Unable to boot into Wiindows dual-boot from grub2.

ColKurtz

Senior member
Dec 20, 2002
429
0
0
I recently attempted to upgrade from 10.04 to 10.10 but the install locked up. I tried to do a "repair install" ala XP, but 10.10 ended up taking freespace from my existing Linux partition and installing into a new partition.

Whatever happened during the repair/reinstall, I can no longer dual-boot to XP. I see the entry in grub, but when I select it I boot into Ubuntu. When I look at Grub.cfg, it shows the XP entry as

menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set d4d8e33bd8e31b0e
drivemap -s (hd0) ${root}
chainloader +1


Any ideas? Windows indeed is on sda1... can I just run lilo -M /dev/sda mbr to get Windows operational until I find time to reinstall linux? I could boot windows and run fixmbr but I don't want to screw anything else up at this point.

TIA.

Edit - BTW, I can see and am able to access the XP ntfs filesystem from within linux.
 

MrColin

Platinum Member
May 21, 2003
2,403
3
81
you could try "sudo update-grub" to try and autodetect the bootable OSes and rewrite the grub.cfg. you might also try commenting out "chainloader +1" if update-grub doesn't fix it.

the snippet above doesn't have a closing curly brace
 

VinDSL

Diamond Member
Apr 11, 2006
4,869
1
81
www.lenon.com
I'd try wiping & reinstalling grub, and see it that fixes the problem.

Here are the commands that I use (in run order):

Code:
$ sudo mv /boot/grub /boot/grub_backup

$ sudo apt-get purge grub grub-pc grub-common

$ sudo mkdir /boot/grub

$ sudo apt-get install grub-pc grub-common

$ sudo apt-get clean

$ sudo grub-install -v

$ sudo update-grub

$ sudo grub-install --recheck /dev/sda

Once I'm confident that the old grub has been wiped, and the new grub is installed, I do a system restart, and life is beautiful.
 

ColKurtz

Senior member
Dec 20, 2002
429
0
0
Thanks guys... I'll try that. (fyi closing bracket is there... just didn't paste it)
 

ColKurtz

Senior member
Dec 20, 2002
429
0
0
VinDSL - When I try to do the "sudo grub-install -v" I get an error "sudo: grub-install: command not found".

When I did the purge command I got a text pop-up that indicated the system would be unbootable until I reinstallled grub. I answered yes b/c I assumed the point was that I was reinstalling grub.

I tried doing an "apt-get grub-install" but got invalid operation error.

Thanks for any advice.
 

VinDSL

Diamond Member
Apr 11, 2006
4,869
1
81
www.lenon.com
Try doing a whereis...

Code:
vindsl@Zuul:~$ whereis grub-install
grub-install: /usr/sbin/grub-install /usr/share/man/man8/grub-install.8.gz
 

ColKurtz

Senior member
Dec 20, 2002
429
0
0
Returns nothing.

stu@stu-H55M-S2H:~$ whereis grub-install
grub-install:
stu@stu-H55M-S2H:~$

(btw what tags are you using for pasting code?)

EDIT -- I can see grub-install in the /usr/sbin directory on my other (dead) partition. Tried copying to the current /usr/bin but got permissions error.
 
Last edited:

VinDSL

Diamond Member
Apr 11, 2006
4,869
1
81
www.lenon.com
Hrm...

Try...

Code:
$ sudo /usr/sbin/grub-install -v

If that doesn't work, open Nautilus as an admin:

Code:
$ gksudo nautilus

...and see if you can copy/move it.
 
Last edited:

ColKurtz

Senior member
Dec 20, 2002
429
0
0
Grrr... yeah I had tried specifying the path, but still get command not found.

I launched gksudo nautilus but don't see the other filesystem that has grub-install. Do I need to mount it manually? Usually it auto-mounts. I looked in the /dev directory but don't know what the heck I'd be mounting.

Moreover, can I run lilo -M /dev/sda and call it a day? I don't see sda under /dev but obviously it must be there. Or boot to XP disc and run fixmbr?
 

VinDSL

Diamond Member
Apr 11, 2006
4,869
1
81
www.lenon.com
Are grub-mkimage & grub-setup present on your system?

Code:
vindsl@Zuul:~$ whereis grub-mkimage
grub-mkimage: /usr/bin/grub-mkimage /usr/share/man/man1/grub-mkimage.1.gz
vindsl@Zuul:~$ whereis grub-setup
grub-setup: /usr/sbin/grub-setup /usr/share/man/man8/grub-setup.8.gz
 

VinDSL

Diamond Member
Apr 11, 2006
4,869
1
81
www.lenon.com
Neither are present.
Whoa! :eek:

Those are the workhorses. grub-install is just a shell script for those proggies.

Well, if it was me, I'd...

  • rename /boot/grub to /boot/grub_fail (or whatever)

  • then rename /boot/grub_backup to /boot/grub

  • cross my fingers and hope it reboots

Looks like you have a borked install (as reported in your original post). Who knows what else is missing!?!?!

You're probably looking at having to re-install 10.10, unless someone else has some ideas...
 

ColKurtz

Senior member
Dec 20, 2002
429
0
0
Thanks again for alll the (quick) suggestions. I'll try those in the morning. I'll copy off anything important from my XP partition from within linux to a NAS box, then - worst case - try fixmbr to get XP to boot again. Thanks again.