PDA

View Full Version : [SOLVED] 9.10 Installed twice and still weird files in /boot/grub ???



Browser_ice
February 5th, 2010, 09:18 PM
I have re-written my thread following some infos I found on other threads.

Ok, here's the thing.

I have a multi-boot:
/dev/sda1 = Windows XP
/dev/sda5 = Xubuntu 9.10 (just installed but can't boot to it)
/dev/sda6 = Ubuntu 9.04
/dev/sda7 = Ubuntu 9.04 server

The main booting grub is from /dev/sda6. In it, for all other O/S, it just does a chainloader to them. So all other O/S have their own Grub installed on their partition. This was an easy solution for maintaining Grubs on every O/S updates.

Now since my /dev/sda5 is 9.10, it means it now has GRUB2.

So on PC booting, it does not seam to work to chainloader from Grub to Grub2.

How can I fix this ?

This is my main booting grub:

## ## End Default Options ##
...

title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
chainloader +1

title Ubuntu 9.04, kernel 2.6.28-17-generic
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
kernel /boot/vmlinuz-2.6.28-17-generic root=UUID=eae75493-2ebb-42cf-866b-02502ebef0d5 ro quiet splash
initrd /boot/initrd.img-2.6.28-17-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-17-generic (recovery mode)
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
kernel /boot/vmlinuz-2.6.28-17-generic root=UUID=eae75493-2ebb-42cf-866b-02502ebef0d5 ro single
initrd /boot/initrd.img-2.6.28-17-generic

title Ubuntu 9.04, memtest86+
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
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

title Xubuntu
root (hd0,4)
chainloader +1

title Ubuntu server
root (hd0,6)
chainloader +1

Browser_ice
February 5th, 2010, 09:36 PM
I think I am starting to understand.


My xubuntu grub.d
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 622f7d8d-bbaa-43b1-bdc4-2bd2c696669a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=622f7d8d-bbaa-43b1-bdc4-2bd2c696669a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 622f7d8d-bbaa-43b1-bdc4-2bd2c696669a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=622f7d8d-bbaa-43b1-bdc4-2bd2c696669a ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###


since my xubuntu 9.10 which has Grub2 has been installed on /dev/sda5, my main Grub sees it as (hd0,4) but as I can see in my grub.d, Grub2 sees it as (hd0,5).

So the solution in my main grub is to map (hd0,4) as (hd0,5) before chainloading to it ??
syntax is map (hd0,5) (hd0,4) or map (hd0,4) (hd0,5) ???

ranch hand
February 5th, 2010, 10:38 PM
OK, chain loading is not something that I am good at because I have no use for it on my setup. Grub1.98 is in the jaunty repo and works fine if you want to upgrade (Yup I like the new grub).

What we need to do first, though is see what your system thinks it is using and doing.

Get this script and run it;

http://sourceforge.net/projects/bootinfoscript/

and post the results file that should appear on your desk top. Then we will have all the info we need if we are smart enough to see it.

The easiest way to maintain grub on updates is to have all grub, no grub-legacy (it is not supported), use symbolic menu entries that never, ever need updated, change the permissions on /etc/grub.d/30_os-prober and 40_custom (and 20_memtest86 if you never use it). Multi boot systems work great on that setup. My test platform has11 OS' 9 with grub1.97beta4 or 1.98. I don't care which one is boot root as they all carry the same menu (except each one has its own entry on top), the default is set on all to be the OS I am on right now.

Browser_ice
February 5th, 2010, 10:56 PM
I ran your script as you requested.

The primary GRUB being executed on PC boot is Grub from /dev/sda6 and not Grub2

ranch hand
February 5th, 2010, 11:33 PM
I will post here again in a bit. Just need to write an entry for your grub0.97 for your Xubuntu. Then you should be able to boot to it and that is the easy way to get grub1.97beta4 straight (you can do it all ahile booted into the OS). Makes it easy.

ranch hand
February 5th, 2010, 11:46 PM
Alright.

You need to run;


gksudo <your text editor> /boot/grub/menu.lst
and add this entry in with the other ubuntus;


menuentry "Xubuntu 9.10 (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 622f7d8d-bbaa-43b1-bdc4-2bd2c696669a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=622f7d8d-bbaa-43b1-bdc4-2bd2c696669a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
Save the file and reboot and try the bugger.

I believe that will boot you to Xubuntu.

Let us find out before getting on with it.

EDIT = IMPORTANT
Cause = senility
Change those (hd0,5)s to ((hd0,4)
Forgot the syntax difference in grub and grub-legacy. Sorry, just a moron.

Browser_ice
February 6th, 2010, 12:04 AM
I put those lines in the Xubuntu part of my Grub 0.97 of my main booting Grub. I will now reboot. But one thing puzzles me, you coded the kernel version into it directly so that means that I will have to manually update it everytimes I update my Xubuntu since this is not xubuntu's own grug.

Browser_ice
February 6th, 2010, 12:14 AM
I have just rebooted. There is no xubuntu line in the booting Grub.

Just to make sure there is no misunderstanding, i'll explain my setup:

When I boot the PC, it boots my /dev/sda6 0.97 Grub. In that Grub, I had a chainloader section to boot my xubuntu 8.10 own Grub. Now that xubuntu Grub is now a Grub2 but it is still is being called by my 0.97 Grub. I do not directly boot into my xubuntu. I boot into my Ubuntu 9.04 /dev/sda6 0.97 Grub which then gives me a choice of re-directing me to other O/S's Grubs.

Here is my 0.97 grub like you asked me to change :

...
## ## End Default Options ##

title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
chainloader +1

title Ubuntu 9.04, kernel 2.6.28-17-generic
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
kernel /boot/vmlinuz-2.6.28-17-generic root=UUID=eae75493-2ebb-42cf-866b-02502ebef0d5 ro quiet splash
initrd /boot/initrd.img-2.6.28-17-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-17-generic (recovery mode)
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
kernel /boot/vmlinuz-2.6.28-17-generic root=UUID=eae75493-2ebb-42cf-866b-02502ebef0d5 ro single
initrd /boot/initrd.img-2.6.28-17-generic

title Ubuntu 9.04, memtest86+
uuid eae75493-2ebb-42cf-866b-02502ebef0d5
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

menuentry "Xubuntu 9.10 (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 622f7d8d-bbaa-43b1-bdc4-2bd2c696669a
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=622f7d8d-bbaa-43b1-bdc4-2bd2c696669a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}

title Ubuntu server
root (hd0,6)
chainloader +1


so when I boot my PC, all I see in the booting 0.97 grub is this :

Microsoft Windows XP Professional
Ubuntu 9.04, kernel 2.6.28-17-generic
Ubuntu 9.04, kernel 2.6.28-17-generic (recovery mode)
Ubuntu 9.04, memtest86+
Other operating systems:
Ubuntu server


There is no xubuntu line.

presence1960
February 6th, 2010, 12:32 AM
The simplest solution is to use GRUB2 to boot all your OSs since 1. you have karmic installed on sda5 and 2. your grub.cfg file in sda5 has entries that will work for all your OSs.

Boot the 9.10 Live Cd and choose "try ubuntu without any changes." When the desktop loads open a terminal and run
sudo mount /dev/sda5 /mntThis will mount your karmic partition. Then in terminal run
sudo grub-install --root-directory=/mnt/ /dev/sdaThis will put GRUB2 on MBR of sda. Reboot without the CD. Boot into karmic and just to be safe run
sudo update-grubeven though your grub.cfg entries look good it won't hurt to update them.

ranch hand
February 6th, 2010, 12:44 AM
You need to move the entry up with the others and you need to save the file. It should show up even if it doesn't work.

You also need this entry instead (I haven't done this for a while);


title Xubuntu 9.10, kernel 2.6.31-14-generic
uuid 622f7d8d-bbaa-43b1-bdc4-2bd2c696669a
kernel /boot/vmlinuz-2.6.31-14-generic root=UUID=622f7d8d-bbaa-43b1-bdc4-2bd2c696669a ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
quiet

Put this up with the other Ubuntu stuff. Don't stick it down there with in the MS section. Terrible thing to do to an entry for a good OS.

ranch hand
February 6th, 2010, 12:49 AM
The simplest solution is to use GRUB2 to boot all your OSs since 1. you have karmic installed on sda5 and 2. your grub.cfg file in sda5 has entries that will work for all your OSs.

Boot the 9.10 Live Cd and choose "try ubuntu without any changes." When the desktop loads open a terminal and run
sudo mount /dev/sda5 /mntThis will mount your karmic partition. Then in terminal run
sudo grub-install --root-directory=/mnt/ /dev/sdaThis will put GRUB2 on MBR of sda. Reboot without the CD. Boot into karmic and just to be safe run
sudo update-grubeven though your grub.cfg entries look good it won't hurt to update them.
This would likely work.

I would not do it that way for these reasons.
1>Grub should have installed there when the OS was installed.
2>We may have to do some things that are just easier when booted in.
3>This will give a backup way to boot the system if there are more problems in the future.

kansasnoob
February 6th, 2010, 12:56 AM
You know I have a different feeling about this for two reasons.

#1. I've been beating my brains out over failed booting of kernel 2.6.31-19.

#2. You know what you want to do with legacy grub.

So IMHO just revert to legacy grub:

http://ubuntuforums.org/showthread.php?t=1298932

Browser_ice
February 6th, 2010, 12:58 AM
I tried Presence1960's suggestion. I am now in xubuntu 9.10 currently updating it (few updates too !). I will check if I can boot to all other O/S too.

If this solution works ok, I will next need to setup windows XP as the default to be booted too (after a few sec).

ranch hand
February 6th, 2010, 01:43 AM
kansasnoob and I have a little difference in opinion about grub. If you do decide to go with grub-legacy in 9.10 be sure to follow these instructions;

http://ubuntuforums.org/showthread.php?t=1298932

The guy that wrote that knows his stuff.

I suggest that you try this entry in your /etc/grub.d/40_custom file;


echo "Adding Lounge on sda7" >&2
cat << EOF
menuentry "Lounge on sda7" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 ro quiet splash
initrd /initrd.img
}
EOF

Don't change a thing. Just put it in there and run "sudo update-grub". Should be at the very bottom of your menu and should boot you right in to that partition on your box. If you like it you can use it for all your booting by just pulling up that file again and plugging in the rest of your Ubuntus and then save it as 06_custom and it will be first on the menu. In your case you would also want to add the entry for MS.

Then you can shut down all of the scripts from 10_linux through 40_custom. Small, clean menu, never needs editing unless you are adding to it.