Grub Bootloader

Grub and Serial Console

Grub and RAID 1

To install your bootloader on both parts of a software RAID 1 the following steps have to be performed (after every kernelupdate). Our RAID consists of 2 SATA drives (sda1 and sdb1):

Start grub:

grub
    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

       [ Minimal BASH-like line editing is supported.   For
         the   first   word,  TAB  lists  possible  command
         completions.  Anywhere else TAB lists the possible
         completions of a device/filename. ]

grub>

enter the following commands:

# select sdb1 as the target:
 root (hd1,0)
# write bootloader:
 setup (hd1)

Upgrade from Grub-legacy to Grub2

apt-get update
apt-get install grub2

You want to chainload from grub-legacy into grub2 to verify if everything works as expected. If OK, proceed:

upgrade-from-grub-legacy

When configuring grub-pc you have to select where to install grub. Usually a device without a partition number fits. But think twice. It is up to you to select the right device(s) where grub should be installed!

Installation finished. No error reported.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found linux image: /boot/vmlinuz-2.6.32-5-amd64
Found initrd image: /boot/initrd.img-2.6.32-5-amd64
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done

GRUB Legacy has been removed, but its configuration files have been preserved,
since this script cannot determine if they contain valuable information.  If
you would like to remove the configuration files as well, use the following
command:

  rm -f /boot/grub/menu.lst*

This looks good. Now verify you can reboot.

Grub2

How things work in Ubuntu 12.04.

The main configuration goes to:

/etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# 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=640x480

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

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

What the options mean can be read via info -f grub -n 'Simple configuration'

After modifying this file run sudo update-grub

Grub2: Add Bootparameter

If you have to add a parameter to your kernel, this can be done like so:

Open /etc/default/grub with your favorite editor and modify the following line:

[...]

GRUB_CMDLINE_LINUX="rootdelay=60 transparent_hugepage=never"


[...]

Parameters are seperated with a space.

# when finished apply the modified configuration:
update-grub
linux/grub.txt · Last modified: 2015-01 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready