PDA

View Full Version : [ubuntu] how to mandriva to ubuntu grub



ajay.eeralla
February 11th, 2011, 11:34 AM
hi all,
First,I have installed vista and mandriva in my system, then i installed ubuntu ,now mandriva is not booting..
i can able to boot vista and ubuntu, but not mandriva..
help me .......
when i used ..
sudo update-grub


[sudo] password for ajay:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-22-generic
Found initrd image: /boot/initrd.img-2.6.35-22-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows Recovery Environment (loader) on /dev/sda1
Found Mandriva Linux 2010.1 (2010.1) on /dev/sda7
done

but my grub configuration in ubuntu is ..
#
# 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,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
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,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=9bcc8298-aa9f-4aa5-abf0-00fe79714a2e ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=9bcc8298-aa9f-4aa5-abf0-00fe79714a2e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-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/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos10)'
search --no-floppy --fs-uuid --set 9bcc8298-aa9f-4aa5-abf0-00fe79714a2e
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 01cb5ef1139e93c0
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "linux (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set ef3995e4-29ba-43a0-b0d4-179872bbf8c5
linux /boot/vmlinuz BOOT_IMAGE=linux root=UUID=ef3995e4-29ba-43a0-b0d4-179872bbf8c5 resume=UUID=7a160326-7044-4a27-b84e-2296d928448a splash=silent vga=788
initrd (hd0,6)/boot/initrd.img
}
menuentry "linux-nonfb (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set ef3995e4-29ba-43a0-b0d4-179872bbf8c5
linux /boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=ef3995e4-29ba-43a0-b0d4-179872bbf8c5 resume=UUID=7a160326-7044-4a27-b84e-2296d928448a
initrd (hd0,6)/boot/initrd.img
}
menuentry "failsafe (on /dev/sda7)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set ef3995e4-29ba-43a0-b0d4-179872bbf8c5
linux /boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=ef3995e4-29ba-43a0-b0d4-179872bbf8c5 failsafe
initrd (hd0,6)/boot/initrd.img
}
### 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 ###

oldfred
February 11th, 2011, 06:25 PM
Mandriva duplicates its partition info in the initrd line. Set root should be all that is required. But Mandriva is using old grub and Ubuntu grub2, so the partition number is wrong.

Install in sda7 - Delete red.
initrd (hd0,6)/boot/initrd.img

Copy the Mandriva entrie(s) from this:
gedit /boot/grub/grub.cfg
Copy them to and edit:
gksudo gedit /etc/grub.d/40_custom
Then do:
sudo update-grub

once you know it works, turn off osprober to eliminate the incorrect entries:
In /etc/default/grub I added this:
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER=true

The other way is to install Mandriva's old grub to the Mandriva partition and chainload from grub2. Then you will not have to edit Ubuntu's grub entry on every kernel update in Mandriva.