You are not logged in.

#1 2013-01-16 00:44:55

Midnight Sun
Member
Registered: 2008-06-23
Posts: 42

[SOLVED] - Grub2 - Trouble setting up second bootable partition.

Hi all. Thanks for taking time to look at my troubles.

I have installed from latest Arch into sda2 (only got one drive) following the Arch Beginners Guide. Everything is good, i'm on Firefox writing this now.

I also have several other Arch installs on other partitions on the same disk which I would like to be able to boot as I used to with Grub1 before.
The problem is I can't work out how to get it working on Grub2.

I been reading all I can, and from what I've learned, and since one of the Arch's boots fine, I must have...

    grub installed
    a file on the mbr of sda
    a core.img installed (somewhere, just after the mbr maybe?)
    grub's files in /etc/grub.d  /etc/default/grub  /boot/grub
    linux kernel and initrd in /boot

The problem is I can't get it to boot the other Arch from sda12
The os-prober has found the other Arch and written to the grub.cfg, and when I reboot it appears in the list.
But if I select it the screen goes blank and nothing happens, silence, no disk noise, nothing.

I guess this means that the kernel and initrd are not getting found or something.

Does it matter that grub's stuff is on sda2 /boot/grub, but I'm using it to point to sda12 /boot/(the Arch files)?
I know that is two different 'roots', but doesn't the grub.cfg allow for that with two different root=... lines?

Struggling to understand.
Any ideas.

Last edited by Midnight Sun (2013-01-16 04:19:55)

Offline

#2 2013-01-16 00:49:12

Midnight Sun
Member
Registered: 2008-06-23
Posts: 42

Re: [SOLVED] - Grub2 - Trouble setting up second bootable partition.

...By the way a very good resource for anyone with Grub2 troubles I found is:

http://moi.vonos.net/linux/Booting_Linu … ith_Grub2/

A good overview of the boot process and grub.


Or, I could RTFM : https://www.gnu.org/software/grub/manual/grub.html

Last edited by Midnight Sun (2013-01-16 02:21:09)

Offline

#3 2013-01-16 02:20:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,662

Re: [SOLVED] - Grub2 - Trouble setting up second bootable partition.

If you are still having trouble, post your config. Please use [code ] [/code ] tags. e.g. from /etc/default or /etc/grub.d and, especially, grub.cfg (even though it is generated).

Last edited by cfr (2013-01-16 02:22:36)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#4 2013-01-16 02:28:22

Midnight Sun
Member
Registered: 2008-06-23
Posts: 42

Re: [SOLVED] - Grub2 - Trouble setting up second bootable partition.

HI, thanks for looking. I'm wading through the Grub manual trying to get my head round things.

Here's my /boot/grub/grub.cfg , I'm afraid it looks like a bit of a mess.

#

# 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 ###

insmod part_gpt

insmod part_msdos

if [ -s $prefix/grubenv ]; then

load_env

fi

set default="0"

 

if [ x"${feature_menuentry_id}" = xy ]; then

menuentry_id_option="--id"

else

menuentry_id_option=""

fi

 

export menuentry_id_option

 

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 load_video {

if [ x$feature_all_video_module = xy ]; then

insmod all_video

else

insmod efi_gop

insmod efi_uga

insmod ieee1275_fb

insmod vbe

insmod vga

insmod video_bochs

insmod video_cirrus

fi

}

 

if [ x$feature_default_font_path = xy ] ; then

font=unicode

else

insmod part_msdos

insmod ext2

set root='hd0,msdos2'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 64b15d8f-85f1-412a-8fa9-fd054849176e

else

search --no-floppy --fs-uuid --set=root 64b15d8f-85f1-412a-8fa9-fd054849176e

fi

font="/usr/share/grub/unicode.pf2"

fi

 

if loadfont $font ; then

set gfxmode=auto

load_video

insmod gfxterm

set locale_dir=$prefix/locale

set lang=en_GB

insmod gettext

fi

terminal_input console

terminal_output gfxterm

set timeout=120

### END /etc/grub.d/00_header ###

 

### BEGIN /etc/grub.d/10_linux ###

menuentry 'Arch GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-64b15d8f-85f1-412a-8fa9-fd054849176e' {

load_video

set gfxpayload=keep

insmod gzio

insmod part_msdos

insmod ext2

set root='hd0,msdos2'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 64b15d8f-85f1-412a-8fa9-fd054849176e

else

search --no-floppy --fs-uuid --set=root 64b15d8f-85f1-412a-8fa9-fd054849176e

fi

echo 'Loading Linux core repo kernel ...'

linux /boot/vmlinuz-linux root=UUID=64b15d8f-85f1-412a-8fa9-fd054849176e ro quiet

echo 'Loading initial ramdisk ...'

initrd /boot/initramfs-linux.img

}

menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-64b15d8f-85f1-412a-8fa9-fd054849176e' {

load_video

set gfxpayload=keep

insmod gzio

insmod part_msdos

insmod ext2

set root='hd0,msdos2'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 64b15d8f-85f1-412a-8fa9-fd054849176e

else

search --no-floppy --fs-uuid --set=root 64b15d8f-85f1-412a-8fa9-fd054849176e

fi

echo 'Loading Linux core repo kernel ...'

linux /boot/vmlinuz-linux root=UUID=64b15d8f-85f1-412a-8fa9-fd054849176e ro quiet

echo 'Loading initial ramdisk ...'

initrd /boot/initramfs-linux-fallback.img

}

 

### 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+ ###

### END /etc/grub.d/20_memtest86+ ###

 

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

menuentry 'Arch' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-75bc8965-beb0-4ae6-98e1-62c8a6ff65fd' {

insmod part_msdos

insmod ext2

set root='hd0,msdos11'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos11 --hint-efi=hd0,msdos11 --hint-baremetal=ahci0,msdos11 9575e331-14a8-494e-ab9b-d915d178f9f0

else

search --no-floppy --fs-uuid --set=root 9575e331-14a8-494e-ab9b-d915d178f9f0

fi

linux /vmlinuz26 root=/dev/sda12

}

submenu 'Advanced options for Arch' $menuentry_id_option 'osprober-gnulinux-advanced-75bc8965-beb0-4ae6-98e1-62c8a6ff65fd' {

menuentry 'Arch (on /dev/sda12)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz26--75bc8965-beb0-4ae6-98e1-62c8a6ff65fd' {

insmod part_msdos

insmod ext2

set root='hd0,msdos11'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos11 --hint-efi=hd0,msdos11 --hint-baremetal=ahci0,msdos11 9575e331-14a8-494e-ab9b-d915d178f9f0

else

search --no-floppy --fs-uuid --set=root 9575e331-14a8-494e-ab9b-d915d178f9f0

fi

linux /vmlinuz26 root=/dev/sda12

}

}

 

menuentry 'Arch1' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-c0c0c7d6-e4a5-48f2-bcbf-24257526600a' {

insmod part_msdos

insmod ext2

set root='hd0,msdos1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 c069505a-31f3-487a-8ebc-923d6ee9a200

else

search --no-floppy --fs-uuid --set=root c069505a-31f3-487a-8ebc-923d6ee9a200

fi

linux /vmlinuz26 root=/dev/disk/by-uuid/7ede646d-2b81-4989-9ba1-a9720d81f736 ro vga=773

initrd /kernel26.img

}

submenu 'Advanced options for Arch1' $menuentry_id_option 'osprober-gnulinux-advanced-c0c0c7d6-e4a5-48f2-bcbf-24257526600a' {

menuentry 'Arch Linux STABLE (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz26--c0c0c7d6-e4a5-48f2-bcbf-24257526600a' {

insmod part_msdos

insmod ext2

set root='hd0,msdos1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 c069505a-31f3-487a-8ebc-923d6ee9a200

else

search --no-floppy --fs-uuid --set=root c069505a-31f3-487a-8ebc-923d6ee9a200

fi

linux /vmlinuz26 root=/dev/disk/by-uuid/7ede646d-2b81-4989-9ba1-a9720d81f736 ro vga=773

initrd /kernel26.img

}

menuentry 'Arch Linux (Old) (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz26--c0c0c7d6-e4a5-48f2-bcbf-24257526600a' {

insmod part_msdos

insmod ext2

set root='hd0,msdos1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 c069505a-31f3-487a-8ebc-923d6ee9a200

else

search --no-floppy --fs-uuid --set=root c069505a-31f3-487a-8ebc-923d6ee9a200

fi

linux /vmlinuz26 root=/dev/disk/by-uuid/75bc8965-beb0-4ae6-98e1-62c8a6ff65fd ro vga=773

initrd /kernel26.img

}

menuentry 'Arch Linux TEST (on /dev/sda3)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz26--c0c0c7d6-e4a5-48f2-bcbf-24257526600a' {

insmod part_msdos

insmod ext2

set root='hd0,msdos1'

if [ x$feature_platform_search_hint = xy ]; then

search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 c069505a-31f3-487a-8ebc-923d6ee9a200

else

search --no-floppy --fs-uuid --set=root c069505a-31f3-487a-8ebc-923d6ee9a200

fi

linux /vmlinuz26 root=/dev/disk/by-uuid/c0c0c7d6-e4a5-48f2-bcbf-24257526600a ro vga=773

initrd /kernel26.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.

menuentry "OLD LINUX" {

set root='hd0,msdos2'

linux /boot/vmlinuz26 root='hd0,msdos12'

initrd /boot/kernel26.img

}

### END /etc/grub.d/40_custom ###

 

### BEGIN /etc/grub.d/41_custom ###

if [ -f ${config_directory}/custom.cfg ]; then

source ${config_directory}/custom.cfg

elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then

source $prefix/custom.cfg;

fi

### END /etc/grub.d/41_custom ###

Offline

#5 2013-01-16 04:19:25

Midnight Sun
Member
Registered: 2008-06-23
Posts: 42

Re: [SOLVED] - Grub2 - Trouble setting up second bootable partition.

Solved! RTFM

Lesson learned...err Again!

There were three problems:

1    The way the kernel files were being pointed to was the wrong syntax. /boot/... would point to 'grub root'/boot/...
         but that would be on sda2. It should have been (hd0,msdos12)/boot/... then it points to sda12.

2    The way the kernel options were specified was wrong. I had copied the syntax from the other menuenrtys in the config.
         But I don't think they are right for the old kernel I was booting. vmlinuz26 root=UUID=... should hve been
         vmlinuz26 root=/dev/disk/by-uuid/...

3    This is the stupid one: when I used mv to move the kernel files at some point I accidentally renamed it kenel!


Below is the (now corrected) custom config file used by grub-mkconfig to create the grub.cfg file I pasted above:

Thanks cfr for your interest smile

#!/bin/sh

exec tail -n +3 $0

# 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.

menuentry "OLD LINUX" {

set root='hd0,msdos2'

linux (hd0,msdos12)/boot/vmlinuz26 root=/dev/disk/by-uuid/75bc8965-beb0-4ae6-98e1-62c8a6ff65fd ro quiet

initrd (hd0,msdos12)/boot/kernel26.img

}

Offline

Board footer

Powered by FluxBB