Page 1 of 1

[solved] reinstall XP, dual boot ruined

Posted: Sun Mar 16, 2008 8:53 am
by Paul Unger
I'm currently trying to regain access to the Linux portion of my dual-boot setup. I had to reinstall XP, which overwrote the GRUB. A friend helped me restore the GRUB, but now it get an error when I try to boot to Ubuntu . . . Here's the GRUB list I see when I boot:

Ubuntu 7.10, kernel 2.6.22-14-generic
Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
Ubuntu 7.10, memtest86+
Other operating systems:
Microsoft Windows XP Pro
Windows NT/2000/XP

If I try option 1 or 2 (Ubuntu 7.10) I get "Error 17: Cannot mount selected partition. Press any key to continue". Option 4 (XP Pro) works just fine. Do I need to reinstall Ubuntu, or can I fix this?

Posted: Sun Mar 16, 2008 9:15 am
by aaa
Start->Run->diskmgmt.msc

Check if the Ubuntu partition's still there. It will be listed as an "unknown" partition. Then you have to figure out what number the partition is, if it's still there. So you need to know if it's the second primary partition, or first logical partition, etc.

Posted: Sun Mar 16, 2008 9:35 am
by Paul Unger
I see four partitions in the order:

______ | Healty (Unknown Partition) | 27.67 GB
______ | Healty (Unknown Partition) | 1.23 GB
Preload (C:) | Healty (System) | 58.68 GB
SERVICE001 | Healthy (EISA Configuration) | 5.55 GB

These are ordered:
Preload (C:) 58.68 GB | _____ 27.67 GB | _____ 1.23 GB | SERVICE001 5.57 GB
in the 'graphical display' of disk usage. They are all dark blue (i.e., Primary) except the _____ 1.23 GB which is light blue (i.e., Logical). Hope that helps.

Posted: Sun Mar 16, 2008 10:19 am
by carbon_unit
Is that the entire error message?

Posted: Sun Mar 16, 2008 12:01 pm
by al7kz
You should be able to use the command line or edit feature of grub. I would try command line. So at the grub menu hit 'c' for command line. That will get the grub prompt.

Then type
> find /boot/grub/stage1

that will give the partition where the grub files are found, say (hd0,2). Enter that

> root (hd0,2)

then enter

> cat /boot/grub/menu.lst

and scroll down for the command entries for 'generic' & write them down. You need two:

kernel
initrd

enter each of those at the grub prompt, then enter
>boot

Posted: Sun Mar 16, 2008 12:45 pm
by K0LO
GRUB Error 17 from the GRUB Manual:
17 : Cannot mount selected partition
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.
So, more than likely you are getting this error because the menu.lst file is probably pointing to the Windows partition instead of the Ubuntu partition.

Your Windows partition should be (hd0,0) and the Ubuntu partition should be (hd0,1), according to your posted Windows Disk Management data. If your entry for Ubuntu was referencing (hd0,0) then you would get that error message when trying to boot.

So, I agree with AL7KZ - let the GRUB menu come up, scroll to the Ubuntu menu item and type 'e' (for edit) and examine the boot stanza. If it starts with:

root (hd0,0)

then manually edit it to:

root (hd0,1)

and then try it out. If it boots correctly, edit the menu.lst file to make the change permanent.

Posted: Sun Mar 16, 2008 3:08 pm
by Paul Unger
carbon_unit wrote:Is that the entire error message?
Yep. Just "Error 17: Cannot mount selected partition. Press any key to continue".

Posted: Sun Mar 16, 2008 4:21 pm
by Paul Unger
OK, I found my way in using k0lo's instructions. I typed 'e', root was (hd0,2), I changed it to (hd0,1), and it booted Ubuntu. Now I'm looking at menu.lst in gedit and see this:

Code: Select all

title		Ubuntu 7.10, kernel 2.6.22-14-generic
root		(hd0,2)
kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=11f17d7b-75fc-4401-8a4e-cd7206dd7a7d ro quiet splash
initrd		/boot/initrd.img-2.6.22-14-generic
quiet

title		Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root		(hd0,2)
kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=11f17d7b-75fc-4401-8a4e-cd7206dd7a7d ro single
initrd		/boot/initrd.img-2.6.22-14-generic

title		Ubuntu 7.10, memtest86+
root		(hd0,2)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title		Windows NT/2000/XP
root		(hd0,1)
savedefault
makeactive
chainloader	+1
I'm thinking that I need to change all the Ubuntu root lines to (hd0,1) and the Windows NT/2000/XP root line to (hd0,2). Is that a fair assumption?

Posted: Sun Mar 16, 2008 4:29 pm
by K0LO
Paul:

Yes; that is correct.

And the current entry for Windows XP Professional is correct as-is (hd0,0), but you already knew that since XP was booting correctly.

Posted: Sun Mar 16, 2008 5:07 pm
by Paul Unger
Yay! Solved. Thanks, guys!

Posted: Sun Mar 16, 2008 5:16 pm
by K0LO
Paul:

Excellent! Ya gotta love Linux at times like this. It's almost always possible to nurse a non-booting or defective system back to life without resorting to a reinstall.

Posted: Sun Mar 16, 2008 5:43 pm
by tylerwylie
Paul Unger wrote:Yay! Solved. Thanks, guys!
I was kinda rooting for Windows to be gone forever and you go "screw it" but good for you anyways :)

Posted: Sun Mar 16, 2008 5:58 pm
by Paul Unger
tylerwylie wrote:
Paul Unger wrote:Yay! Solved. Thanks, guys!
I was kinda rooting for Windows to be gone forever and you go "screw it" but good for you anyways :)
So you've been lurking behind a virtual tree, hoping I'd bite the bullet, eh? :twisted: :lol: Well, Windows was always working--it took over, after all--but I enjoy Linux enough that I wanted to get it back. I hope that's some consolation . . . :wink:

Posted: Sun Mar 16, 2008 6:00 pm
by tylerwylie
Paul Unger wrote:
tylerwylie wrote:I was kinda rooting for Windows to be gone forever and you go "screw it" but good for you anyways :)
So you've been lurking behind a virtual tree, hoping I'd bite the bullet, eh? :twisted: :lol: Well, Windows was always working--it took over, after all--but I enjoy Linux enough that I wanted to get it back. I hope that's some consolation . . . :wink:
I'd do it for my friends too, if they dual boot I'd try to make it so Windows doesn't work, and they go screw it I'll learn Linux instead. It never works :(