You are not logged in.

#1 2011-01-13 20:28:16

ChatNoir
Member
Registered: 2011-01-13
Posts: 10

GRUB2 config with ubuntu

Hi,

I've just installed arch on top of Win7 and Ubuntu 10.10. During the install I just skipped the GRUB installation bit since I am trying to use the already installed GRUB2 from ubuntu.

Now, when I boot (I think this happened after I did the partitioning), GRUB2 goes into rescue mode, so I have to do:

set prefix=(hd0,5)/boot/grub
set root=(hd0,5)
insmod linux
normal

and I am returned to the standard grub menu.

My first question is how can I reconfigure grub to go straight into the menu without rescue mode? I've already tried update-grub (alias or grub-mkconfig) from ubuntu, which adds arch but doesn't fix the rescue mode problem.

Here is my fdisk -l for reference:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x67296729

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          10199    81920000    7  HPFS/NTFS                       --Win7
/dev/sda2           10199       43288   265784320    7  HPFS/NTFS                      --Win7
/dev/sda3           43288       60801   140678144    5  Extended
/dev/sda5           50355       58479    65254400   83  Linux                              --Ubuntu /
/dev/sda6           58479       58830     2820096   82  Linux swap / Solaris       --Shared swap
/dev/sda7           58831       60801    15831040   83  Linux                              --arch /var
/dev/sda8           43288       45846    20550656   83  Linux                              --arch /
/dev/sda9           45847       50355    36216832   83  Linux                              --arch /home

Partition table entries are not in disk order

So second question:

Using update-grub in ubuntu added arch to my grub menu but arch doesn't finish the boot process. It comes up with the following:

Waiting 10 seconds for device /dev/sda8
root device 'dev/sda8' doesn't exist. Attempting to recreate it.
ERROR: Unable to determine major/minor number of root device '/dev/sda8'.
You are being dropped to a recovery shell
    Type 'exit' to try and continue booting
/bin/sh:can't access tty; job control turned off
[ramfs /]#

I have no idea why this might happen. Here is the relevant bit from grub.cfg

menuentry "Arch (on /dev/sda8)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set cfc8dff3-3b52-48df-a0b9-f37d673602cd
    linux /boot/vmlinuz26 root=/dev/sda8
    initrd /boot/kernel26.img
}

Any help would be much appreciated.

Thanks

Offline

#2 2011-01-13 21:40:14

ChatNoir
Member
Registered: 2011-01-13
Posts: 10

Re: GRUB2 config with ubuntu

Perhaps I should have posted this in the installation forum?

Offline

#3 2011-01-13 21:50:50

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: GRUB2 config with ubuntu

It's fine here.

I don't use Grub2, but according to the wiki page numbering starts at 1 for partitions https://wiki.archlinux.org/index.php/Grub2

Device naming has changed between GRUB and GRUB2. Partitions are numbered from 1 instead of 0 while drives are still numbered from 0. For example, /dev/sda1 would be referred to as (hd0,1) using GRUB2.

So your Arch / would be (hd0,7)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2011-01-13 22:02:39

ChatNoir
Member
Registered: 2011-01-13
Posts: 10

Re: GRUB2 config with ubuntu

Great, I can boot arch now... Thank you!

Anyone got any ideas on the grub config problem?

Offline

#5 2011-01-13 22:21:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: GRUB2 config with ubuntu

I'm sure they have, but without seeing what the rest of grub.cfg looks like, they would need to be psychic to help smile

https://wiki.archlinux.org/index.php/Fo … ow_to_Post


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2011-01-13 22:26:42

ChatNoir
Member
Registered: 2011-01-13
Posts: 10

Re: GRUB2 config with ubuntu

Sorry about that, didn't think it was needed...

#
# 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,msdos5)'
search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
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,msdos5)'
search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=2
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-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    linux    /boot/vmlinuz-2.6.35-24-generic root=UUID=621ce34c-3bc2-4402-97e8-adcb20ad0ec1 ro   splash
    initrd    /boot/initrd.img-2.6.35-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    echo    'Loading Linux 2.6.35-24-generic ...'
    linux    /boot/vmlinuz-2.6.35-24-generic root=UUID=621ce34c-3bc2-4402-97e8-adcb20ad0ec1 ro single 
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.35-24-generic
}
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,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=621ce34c-3bc2-4402-97e8-adcb20ad0ec1 ro   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,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    echo    'Loading Linux 2.6.35-22-generic ...'
    linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=621ce34c-3bc2-4402-97e8-adcb20ad0ec1 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,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set 621ce34c-3bc2-4402-97e8-adcb20ad0ec1
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set b2ca6564ca6525b7
    chainloader +1
}
menuentry "Windows Vista (loader) (on /dev/sda2)" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos2)'
    search --no-floppy --fs-uuid --set cc0088e00088d33e
    chainloader +1
}
menuentry "Arch (on /dev/sda8)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set cfc8dff3-3b52-48df-a0b9-f37d673602cd
    linux /boot/vmlinuz26 root=/dev/sda8
    initrd /boot/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.
### 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 ###

Last edited by ChatNoir (2011-01-13 22:32:57)

Offline

#7 2011-01-13 23:48:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: GRUB2 config with ubuntu

It seems you have the same numbering issue with your Ubuntu entry:

set root='(hd0,msdos5)'

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2011-01-14 00:26:40

ChatNoir
Member
Registered: 2011-01-13
Posts: 10

Re: GRUB2 config with ubuntu

Yep, I noticed that too but Ubuntu seems to boot fine. It also now seems like changing Arch to sda7 is only working intermittently now. I'm not sure what's going on. This is getting really frustrating so I think I will just reinstall arch with grub on the MBR and add everything else to the old, lovely, familiar GRUB.

Thanks for all the replies jason.

Offline

#9 2011-01-14 00:34:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: GRUB2 config with ubuntu

No problem. Read the dual boot page and chainload your additional OSes - it will work so much more smoothly.

https://wiki.archlinux.org/index.php/Wi … _Dual_Boot


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB