Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 12805157af3ef6108c44c64c6b283471 > files > 28

grub2-2.00-59.mga4.src.rpm

Updated 08 Mar 2013

This package contains GRUB 2 release version 2.00. 

An optional Mageia theme comprising a graphical background and a nice font is also available in the package grub2-mageia-theme.

The default installation will generate a menu on installation comprising the distribution's kernel versions found in /boot
and if os-prober is installed, any other operating systems detected will also be included.

The grub2 package is for PC-bios machines - if you have EFI based hardware, then you should install grub2-efi.
There is a separate README.efi in that package, in addition to this README.Mageia file. 

The GRUB 2 boot files are installed in /boot/grub2/* so that an existing Mageia GRUB legacy installation (in /boot/grub/)
is unaffected.

The GRUB 2 user commands (executables) are all named grub2-* in this installation to avoid conflicts with 
similar tools used by GRUB legacy. The two can happily co-exist on the same machine.

In this context remember that when referring to GRUB 2 documentation a reference to e.g. "grub-install"
must be applied as "grub2-install" or the legacy version will be used.


****************************************************** WARNING ************************************************
The commands below if used carelessly may render your system un-bootable - before attempting any boot loader changes
it is advisable to learn how to boot manually by using a GRUB/GRUB2 boot CD or floppy or even a USB stick. 
(The latter is not recommended as an inserted USB stick is seen as a hard drive and can affect drive
assignment numbering.)
***************************************************************************************************************

##################################
A few quick-start notes :-
##################################
To test the installed GRUB 2 while still using the Mageia legacy GRUB as primary bootloader, you can add a menu item 
to your /boot/grub/menu.lst

title Mageia via GRUB 2
root (hdx,y)
kernel /boot/grub2/i386-pc/core.img

x and y need to be the same as the top entry in your menu (i.e. the drive and root partition counting from 0)

Selecting this entry will transfer control from GRUB to GRUB 2 

##################################
To install GRUB 2 to the MBR :-

# grub2-install --root-directory=/ /dev/sdX

This will install grub2 to /boot/grub2/* but it will not create/update the menu.

NOTE A menu is automatically generated during installation of the grub2 package, so this will be used.

##################################
To install GRUB 2 to the MBR and create a new menu you can use:-

# grub2-install /dev/sdX

##################################
To re-build the GRUB 2 menu

(for example after editing /etc/grub.d/40_custom or /etc/default/grub):-

$ update-grub

OR

$ update-grub2

Either of which may be run as root or regular user. Regualer users. will be asked for root password.

Alternatively as root use:

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

##################################
To re-generate /boot/grub2/i386-pc/core.img (or /boot/grub2/i386-efi/core.img)

# grub2-install --grub-setup=/bin/true /dev/sdXY

NOTE: this will also re-install the grub2 files under /boot/grub2/

##################################
Configuration

Most GRUB 2 configuration is done in /etc/default/grub

For example, to inhibit an installed os-prober (to restrict the menu entries to only show Mageia)
you can change the following line to "true":-

GRUB_DISABLE_OS_PROBER=false

If you need custom options in the kernel command line they may be added here:-

GRUB_CMDLINE_LINUX_DEFAULT="splash 3"

The above example has the default "splash" with the "3" added to change the boot run level
to 3 (non-graphical).

After any manual changes to /etc/default/grub you must re-build grub.cfg as mentioned
above in "To re-build the GRUB 2 menu"

##################################
Adding additional operating systems to the menu.

Most will be detected by os-prober if it is installed, but may also be added manually in /etc/grub.d/40_custom,
or in /boot/grub2/custom.cfg

Do not edit the Magiea grub.cfg directly, as changes there will be overwritten.
Items in /etc/grub.d/40_custom will be added when the menu is re-built as mentioned above
in "To re-build the GRUB 2 menu". Items in /boot/grub2/custom.cfg are added automatically to the menu
without re-building it.

NOTE
It is quite possible to manually create a grub.cfg and maintain it.
This situation generally arises when using a dedicated GRUB 2 boot partition to boot into many different
distributions.
The grub.cfg in this case is not owned (or updated) by any operating system - only you.

##################################
Minimal installations.

It is possible to install grub2 without a theme and/or without os-prober by
installing using:

# urpmi grub2 --no-suggests

This will install only grub2 which will have a plain text menu and reduce the installed size.
It will include only your Mageia system in the menu (showing all kernels available).

The theme may be installed later by selecting the package grub2-mageia-theme in MCC or by using:-

# urpmi grub2-mageia-theme

It will be displayed on the next boot.

Likewise, installing or uninstalling os-prober at any time will automatically add or remove any other detected operating
systems to or from your grub2 menu.


Enjoy.