Kernel update overwritten dual boot options grub 2

Asked by pete smout on 2010-04-29

Hi,

Just updated to the latest 9,10 (karmic) kernel 2.6.31-21-generic, and since then have noot had the option to boot into xp at grub2. This is a fairly new install and it detected the NTFS partition fine during installation, I have 3 questions:-

1- how to put my xp option back into grub2?

2- How to prevent it from happening again

3- the reason it did it in the first place

any suggestions?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2010-04-30
Last reply:
2010-04-30
subliminalfix (subliminalfix) said : #1

im assuming your not that new to linux does this help you

boot into linux, then go to /etc/fstab and edit it.

 change your drive letters to corrispond to the propper linux boot partition and the swap partition.

not sure if that will do it you may be able to change your settings by going to the terminal

grub --help

or if you are bold enough

grub man

Hans Spaans (hspaans) said : #2

This would suggest that the package "os-probe" has been removed. Please check in Synaptics if all recommended packages have been installed and run "sudo update-grub" afterwards.

Tom (tom6) said : #3

Hi :)

I would be wary of editing the fstab, particularly in the next 2 or 3 days while Community Documentation might be inaccessible due to heavy downloading of the new 10.04 release. Doubling the servers didn't seem to be enough today!!

I would just reinstall grub2 as we really do not yet understand any finesse with it. Ok, from this guide
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
we can help you if you give us the output of

sudo fdisk -l

where "-l" is a lower-case "-L"
Good luck and regards from
Tom :)

Marc Stewart (marc.stewart) said : #4

This reminds me of bug 570765 in GRUB. If it is the cause of your problem, running Update Manager to update to the fixed version should solve the problem. It's certainly worth trying before tinkering.

Tom (tom6) said : #5

Hi :)

Yeh, updating usually solves a lot of problems & is quickest thing to try. I hadn't thought of it because i often assume people have already tried stuff like that, sry. If updates didn't cure it then simple reinstall of Grub2 from LiveCd seems to fix this in most cases. I'm sure there is a more elegant way but after the "sudo fdisk -l" it is just 2 lines to copy&paste to the command-line and takes about 5 mins tops. If it still doesn't work (unlikely) then fstab might be the next thing to try.

Regards from
Tom )

pete smout (petersmout03) said : #6

Hi,

Tried sudo update-grub, no joy still no xp option on grub menu.
The result of sudo fdisk -l below:

pete@pete-desktop:~$ sudo fdisk -l
[sudo] password for pete:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8d098d09

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 9417 75642021 7 HPFS/NTFS
/dev/sda2 9418 19457 80646300 5 Extended
/dev/sda5 18850 19457 4883728+ 82 Linux swap / Solaris
/dev/sda6 9418 17998 68926819+ 83 Linux
/dev/sda7 17999 18849 6835626 83 Linux

Partition table entries are not in disk order

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcdb1cdb1

   Device Boot Start End Blocks Id System
/dev/sdb1 1 19457 156288321 83 Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x70987098

   Device Boot Start End Blocks Id System
/dev/sdc1 1 60801 488384001 b W95 FAT32
pete@pete-desktop:~$

Hope this helps! Not that new to linux but my girlfriend insists on having xp (for work) but does seem strange that it 'found' /dev/sd1 on install approx 2 weeks ago, and now cant.

With regards to 'grub2 live cd' have downloaded SuperGrub2 when I boot from that it only give me the option for 'First linux kernel and intrid' will try some more later

Pete

Tom (tom6) said : #7

Hi :)

Ok, i fed the numbers into a spreadsheet i keep for this and it showed that sda7 is 7Gb and sda6 is 70Gb so hopefully sda7 is your / and sda6 your /home? Assuming that sda7 is where we want to install grub2 then.

Sorry i confused the issue. I was not talking about the SuperGrub Cd. That has been a handy tool in the past but currently Ubuntu appears to be he only distro using grub2. The SuperGrub Cd still uses the original grub as far as i know & so it will only confuse things.

Use the Ubuntu Cd! Place the Ubuntu Cd in your cd/dvd-drive and reboot the machine. This should get you to a menu with the top (default) choice being "Try Ubuntu without changes to the machine". That should get you to a working desktop which we call a "LiveCd session" (if it works). Now on a command-line enter

sudo mount /dev/sda7 /mnt

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

Notice that there are 3 spaces in each line. Most people forget the space before and after "/dev/sda1" & "--root-directory=/mnt/". Hopefully you got the spaces in? Then a reboot should show the problem's been fixed?

Good luck and regards from
Tom :)

Tom (tom6) said : #8

Hi :)

Just to confirm that the correct commands will be

sudo mount /dev/sda7 /mnt

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

assuming that the / partition is on sda7. My notes after the commands gave a different number but the right one is one of the linux partitions, not the Windows one! Alternatively we could try installing grub2 onto sdb1! That might be quite interesting! In that case try

sudo mount /dev/sdb1 /mnt

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

Either of these ways around should work!
Good luck and regards from
Tom :)

Can you help with this problem?

Provide an answer of your own, or ask pete smout for more information if necessary.

To post a message you must log in.