Reinstalled Win XP and repaired Grub, now I can't boot Linux or Windows. Please help.
Hi,
I installed Windows XP again last night after trying Vista for a bit. Then I couldn't boot Ubuntu of course, so I did the root (hd0,1) + setup (hd0) like I've done successfully once before. But this time something must have gone wrong, because when I try to boot Ubuntu I get this error message: Code:
Error 17: Cannot mount selected partition Code:
Error 12: Invalid device specified Thanks. |
What system were you running when you re-installed GRUB? If you were running from live CD, then the drives might not been seen the same.
If running from live CD---before running GRUB--do "fdisk -l" to see how the system sees your drives. This will determine what to put in the GRUB install commands. It's handy to keep GRUB on a floppy for situations like this (But I don't always follow my own advice...;)) |
Perhaps your partition numbers have changed after erasing vista?
Compare fdisk -l with /boot/grub/menu.lst (presumably from a live install... so make sure it is the menu.lst on the HDD and not the one on the CD.) |
Thanks for your reply.
I'm using an Ubuntu live CD right now. This is my fdisk -l: Code:
Disk /dev/sda: 300.0 GB, 300090728448 bytes Quote:
Code:
Disk /dev/sda: 300,0 GB, 300090728448 byte |
Do you think what's causing Windows not to boot is the fact that it was at sda1 before and now it's at sda5? Can I just change grub to boot XP at sda5? If so, how do I do it?
I did remove the FAT32 partition, so Linux has been bumped up from hdc3 to hdc2. Maybe I just have make some edits to grub to fix this. But the question is how do I do that? |
You can get into the grub interactive mode and enter the "kernel" & "initrd" lines manually. Using autocompletion makes it easy to locate the kernel and initrd file. Then enter the "boot" command to get into your regular linux installation. From there, examine the system. If the devices jive with what you used to boot with, then edit /boot/grub/menu.lst to reflect the changes and run grubinstall.
If the devices are different from what you saw earlier than edit /boot/grub/device.map. I ran into this situation on my desktop where the bios would have /dev/sda & /dev/sdb reversed. After booting I couldn't simply edit menu.lst. |
How do I get into the "grub interactive mode"? I'm pretty much a newbie to Linux and Grub.
I tried "gedit /boot/grub/device.map," but the file came up empty. |
Quote:
It looks like your partition numbers have certainly changed. Read grub(8) and update-grub(8), but most people edit the menu.lst file by hand following the conventions already present. sudo cp /boot/grub/menu.lst /boot/grub/menu-old.lst sudo gedit /boot/grub/menu.lst You'll probably only need to point the old linux root device to the correct place. Reboot then run update-grub. But you may want to edit the windows entry too. Note: you only need to edit the default linux entry and remove all others. |
Quote:
|
From the live mode?
First mount the partition that contains your normal /boot directory - if the linux root is /dev/hdc2 then: mount -t ext3 /dev/hdc2 /mnt ls /mnt/boot/grub ... now you see it? Code:
$ ls /mnt/boot/grub |
Yeah, I see it now. But I still don't know how to view the menu.lst
Edit: Never mind, I figured out how to view it. |
Do you think this will work?
Code:
title Ubuntu, kernel 2.6.20-16-generic |
So, I changed it and I rebooted back into the live cd and now I'm trying to run the update-grub command but I get this error:
Code:
No GRUB directory found. To create a template run 'mkdir /boot/grub' first. Edit: Okay, I managed to run the command but gave me an error about that it couldn't resolve something and then it changed the partition number back to the wrong ones. Then I just decided to try and boot up without update-grub and when I tried booting linux, it worked perfectly. However, when I tried booting Windows, I got the same Error 12. Edit again: I tried running update-grub inside of my real Ubuntu now but it just updated it back the old, erroneous value. Any ideas on how to get Win XP up and running again. I guess I should change the root value but to what... |
I'm bumping this so that it won't fall off of the first page while I get a few hours of sleep before I have to go to work.
|
Okay, so I guess I'll just test root (hd1,x) till I get the right one.
Is there any way I can test the path inside of Ubuntu to see if it works without having to reboot over and over? |
All times are GMT -5. The time now is 10:27 AM. |