# GRUB2 and I, we don't get along very well

## Galumph

I just upgraded to GRUB2, and everything seems to be failing me. The mkconfig script didn't detect my drives correctly, so I had to add the entires to the grub.d files myself. Now GRUB refuses to start in a 1280x1024 resolution (I assume this replaces vga792), and it also uses some odd font.

Here's my grub.cfg:

```

#

# DO NOT EDIT THIS FILE

#

# It is automatically generated by grub2-mkconfig using templates

# from /etc/grub.d and settings from /etc/default/grub

#

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

if [ -s $prefix/grubenv ]; then

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

  insmod vbe

  insmod vga

  insmod video_bochs

  insmod video_cirrus

}

insmod part_msdos

insmod ext2

set root='(hd0,msdos3)'

search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127

if loadfont /usr/share/grub2/unicode.pf2 ; then

  set gfxmode=1280x1024

  load_video

  insmod gfxterm

fi

terminal_output gfxterm

if sleep --interruptible 0 ; then

  set timeout=10

fi

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

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

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

menuentry "Gentoo Linux Lorelei" --class gnu-linux --class gnu --class os {

   set root=(hd0,msdos3)

   search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127

   echo "Loading Gentoo Linux Lorelei"

   linux (hd0,msdos1)/lorelei root=/dev/sda3 ro quiet

}

menuentry "Gentoo Linux Recovery" --class gnu-linux --class gnu --class os {

        set root=(hd0,msdos3)

        search --no-floppy --fs-uuid --set=root bea9589c-c26b-4ae2-b1a2-78fb6b01f127

   echo "Loading Gentoo Linux Recovery"

        linux (hd0,msdos1)/lorelei root=/dev/sda3 ro 1

}

menuentry "Memtest86+" {

   linux16 (hd0,msdos1)/memtest86plus/memtest.bin

}

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

```

and my /etc/default/grub file:

```

# Copyright 1999-2011 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default,v 1.2 2011/08/30 06:45:04 scarabeus Exp $

#

# To populate all changes in this file you need to regenerate your

# grub configuration file afterwards:

#     'grub2-mkconfig -o /boot/grub2/grub.cfg'

#

# See the grub info page for documentation on possible variables and

# their associated values. 

GRUB_DEFAULT=0

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=true

GRUB_TIMEOUT=10

GRUB_CMDLINE_LINUX_DEFAULT=""

GRUB_CMDLINE_LINUX=""

# Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

# The resolution used on graphical terminal.

# Note that you can use only modes which your graphic card supports via VBE.

# You can see them in real GRUB with the command `vbeinfo'.

GRUB_GFXMODE=1280x1024

# Background image used on graphical terminal.

# Can be in various bitmap formats.

#GRUB_BACKGROUND="/boot/grub2/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel

#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY=true

```

The GRUB menu itself seems to start in 1280x1024, not the terminal. How do I get the terminal to start in 1280x1024?

(If anything is written wrong, it's because I didn't really read the documentation. I just messed with the console until I got something that worked and coupled it with some stuff from Slackware's grub.cfg)

----------

## PaulBredbury

Before the loadfont line, I suggest adding:

```
insmod video

# http://forums.gentoo.org/viewtopic-t-851847.html

# http://grub.enbug.org/gfxterm

insmod vbeinfo

# http://grub.enbug.org/gfxterm

insmod font
```

And for the loadfont block, I use:

```
# This wacky script taken from http://www.mail-archive.com/grub-devel@gnu.org/msg08932.html

if loadfont /boot/grub/dejavu.pf2 ; then

    set gfxmode="1920x1080"

    insmod gfxterm

    insmod vbe

    terminal_output gfxterm

fi

insmod png
```

----------

## Galumph

Adding "set gfxpayload=<resolution>" did the trick. Thanks

----------

