PDA

View Full Version : [ubuntu] Grub 2



ericwwheeler
November 30th, 2009, 01:14 AM
I have Ubuntu 9.10 AMD 64 installed on my tx1220us I previously had Fedora 12 on the /dev/sda2 booting from the root partition (my boot partition was formatted ext4-Fedora12 livecd doesn't recognize ext4) So I installed 9.10 and let the installer handle the grub install. I have tried adding the Fedora 12 boot entry to the /etc/grub.d/40_custom file but I think the problem is that all kernel paths are relative to / because it didn't recognize my ext4 boot partition (when I installed Ubuntu I changed the boot partition to ext3). Here is my current grub.cfg:

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

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set ac697eb5-585a-4a73-85a1-b250ed069d73
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-15-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 ac697eb5-585a-4a73-85a1-b250ed069d73
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ac697eb5-585a-4a73-85a1-b250ed069d73 ro quiet splash
initrd /boot/initrd.img-2.6.31-15-generic
}
menuentry "Ubuntu, Linux 2.6.31-15-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 ac697eb5-585a-4a73-85a1-b250ed069d73
linux /boot/vmlinuz-2.6.31-15-generic root=UUID=ac697eb5-585a-4a73-85a1-b250ed069d73 ro single
initrd /boot/initrd.img-2.6.31-15-generic
}
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 ac697eb5-585a-4a73-85a1-b250ed069d73
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ac697eb5-585a-4a73-85a1-b250ed069d73 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 ac697eb5-585a-4a73-85a1-b250ed069d73
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=ac697eb5-585a-4a73-85a1-b250ed069d73 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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.
title Fedora (2.6.31.5-127.fc12.x86_64)

root (hd0,0)

kernel/boot/vmlinuz-2.6.31.5-127.fc12.x86_64 ro root=UUID=28257f3b-84e3-4823-a8b6-b4570bc36eb5 noiswmd LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBORDTYPE=pc KEYTABLE=us rhgb quiet

initrd /boot/initramfs-2.6.31.5-127.fc12.x86_64.img
### END /etc/grub.d/40_custom ###

and my current partition table, fdisk -l

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 11499 92160000 83 Linux
/dev/sda3 11499 12009 4096000 82 Linux swap / Solaris
/dev/sda4 12010 24321 98896140 5 Extended
/dev/sda5 12010 23815 94831663+ 83 Linux
/dev/sda6 23816 24321 4064413+ 82 Linux swap / Solaris


Any suggestions on how to get /dev/sda2 (Fedora 12) to boot?

oldfred
November 30th, 2009, 06:35 AM
I do not know Fedora, but grub 2 counts partitions differently than grub legacy.

Perhaps

root (hd0,0)

should be in grub2

root (hd0,1)

ericwwheeler
December 11th, 2009, 12:13 AM
i still haven't been able to add a bootable entry into grub 2 as I can't get grub 2 to stop and give me a menu or a chance to write down the error I'm seeing flashed briefly before it boots the default. I'm thinking of using my flip video camera to capture the message.

oldfred
December 11th, 2009, 02:44 AM
You also look like you are missing the { }. Another choice is to install Fedora's boot loader to its partition and use a simple chainboot.

# Entry N - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,N)
chainloader +1
}

All entries now require the {} like the example above.