PDA

View Full Version : [SOLVED] grub doesn't find other ubuntu!



tanoloco
February 28th, 2011, 04:32 PM
Hello!

I've got:
sda1 ext4 w/ubuntu 10.10
sda2 ext4 w/ubuntu 10.10
sda3 ext4 w/lubuntu 10.10

the command:

sudo update-grub

generates correct grub.cfg if evocated from sda1 or sda2 (both ubuntu, for example this is grub.cfg generated from sda1

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set baa037cf-df10-4bbd-9c44-4aa2dc2aaeef
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set baa037cf-df10-4bbd-9c44-4aa2dc2aaeef
set locale_dir=($root)/boot/grub/locale
set lang=it
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=5
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set baa037cf-df10-4bbd-9c44-4aa2dc2aaeef
insmod png
if background_image /usr/share/images/grub/ubuntu-inspiration-640x480.png ; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu (sda1)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set baa037cf-df10-4bbd-9c44-4aa2dc2aaeef
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=baa037cf-df10-4bbd-9c44-4aa2dc2aaeef ro quiet splash
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry 'Ubuntu (sda1) (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set baa037cf-df10-4bbd-9c44-4aa2dc2aaeef
echo 'Loading Linux 2.6.35-25-generic ...'
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=baa037cf-df10-4bbd-9c44-4aa2dc2aaeef ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-25-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu Test (sda2)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set 8355cd3e-da6d-4638-8c82-f22f240ce544
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=8355cd3e-da6d-4638-8c82-f22f240ce544 ro quiet splash
initrd /boot/initrd.img-2.6.35-24-generic
}
menuentry "Ubuntu Test (sda2) (recovery mode)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set 8355cd3e-da6d-4638-8c82-f22f240ce544
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=8355cd3e-da6d-4638-8c82-f22f240ce544 ro single
initrd /boot/initrd.img-2.6.35-24-generic
}
menuentry "Lubuntu (sda3)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=af1df4b4-3274-49aa-8c63-4ef9616925aa ro quiet splash
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry "Lubuntu (sda3) (recovery mode)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=af1df4b4-3274-49aa-8c63-4ef9616925aa ro single
initrd /boot/initrd.img-2.6.35-25-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


while it doesn't find other ubuntus if evocated from sda3

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
set locale_dir=($root)/boot/grub/locale
set lang=it
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=5
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
insmod png
if background_image /usr/share/images/grub/ubuntu-inspiration-640x480.png ; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
linux /boot/vmlinuz-2.6.35-25-generic root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set af1df4b4-3274-49aa-8c63-4ef9616925aa
echo 'Loading Linux 2.6.35-25-generic ...'
linux /boot/vmlinuz-2.6.35-25-generic root=/dev/sda3 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-25-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

The file 30_os-prober on sda3 is +x chmodded and correctly loaded but there's something going wrong.

Any idea?

Thanks

Quackers
February 28th, 2011, 04:45 PM
In your problematic system (Lubuntu, I believe), go to synaptic package manager and in the search box enter os-prober. When it appears in the main window, is there a green box next to it (in other words is it shown as installed). Sometimes, mostly with Lubuntu it seems that os-prober is not installed for some reason. If it isn't installed, install it and then re-run sudo update-grub.

tanoloco
February 28th, 2011, 06:47 PM
Great intuition!
=D>

That was the problem .. everything is working right now!

I was trying sudo update-grub from a new fresh installation of Lubuntu .. strange that os-prober is not installed by default .. anyhow I didn't know this package, I thought that 30_os-prober file on /etc/grub.d did the trick itself ..

so thank you very much for your help! I couldn't find the solution by my own. .. I'm still ignorant about so much things!

Quackers
February 28th, 2011, 06:49 PM
It's quite a rare thing, fortunately! But it has happened before. I have no idea why it is not installed by default, it should be.
Anyway I'm glad that solved it :-)
Please mark the thread as solved using the Thread Tools near the top of the page, thanks.